×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Nov 2009
    Posts
    16

    display google map in webview too slowly

    <html>
    <head>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <title>Google Maps JavaScript API v3 Example: Map Simple</title>
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
    <script type="text/javascript">

    var myOptions = {
    zoom:4,
    mapTypeId: google.maps.MapTypeId.ROADMAP,
    mapTypeControl: false,
    navigationControl: false
    }
    var map;
    var marker;
    function initialize() {
    var myLatlng = new google.maps.LatLng(39.9208, 116.4001);

    map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
    map.setCenter(myLatlng);

    marker = new google.maps.Marker({
    position: myLatlng,
    map: map
    });
    }

    </script>
    </head>
    <body style="margin:0px; padding:0px;" onload="initialize()">
    <div id="map_canvas" style="width:100%; height:100%"></div>
    </body>
    </html>

    I use a QWebView to display the above html file a dynamic google map in S60,but it loads too slowly.this is the Qt code:

    QWebView map = new QWebView(this);
    map->setUrl(QUrl("qrc:/gmap/gmap.htm"));

    Why does the map load so slowly?the QWebView is blank in a long time
    Can anybody tell me if I can call the google map API package from local path to make the loading speed up?How to do it if I can?
    What are these two files "maps.js" and "main.js"? What are functions of them?

  2. #2
    Registered User
    Join Date
    Nov 2009
    Posts
    16

    Re: display google map in webview too slowly

    now I've got it. Because app loads a library file named "main.js" from google map server before loading the corresponding map. So I should save the file to local folder or add it into qrc file in project.I choose the second way.like this "<script type="text/javascript" src="qrc:/gmap/index.js"></script>" and then add the path into index.js "getScript("qrc:/gmap/main.js");"

Similar Threads

  1. Google static map path and marker
    By HasithaRandika in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2009-06-30, 09:16
  2. Recording in Amr Format
    By losym in forum Symbian Media (Closed)
    Replies: 12
    Last Post: 2009-03-26, 06:41
  3. GPS related Google map support in Flashlite and Widget application
    By rsuthar in forum [Archived] Flash Lite on Nokia Devices
    Replies: 0
    Last Post: 2008-10-03, 06:37
  4. How to scroll static google map image ?
    By vinod_mrd in forum Browsing and Mark-ups
    Replies: 1
    Last Post: 2008-08-19, 11:55

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×