×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    83

    QWebView with Google Map JS API v3

    Hi forum,

    I have exactly the same problem as http://developer.qt.nokia.com/forums/viewthread/1643, mouse event just doesn't work. Has anyone got a solution for this yet? Thank you.

  2. #2
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    83

    Re: QWebView with Google Map JS API v3

    My code to set the webview
    Code:
     
    QFile file;
        file.setFileName("./jquery.min.js");
        file.open(QIODevice::ReadOnly);
        jQuery = file.readAll();
        file.close();
    
    	QNetworkProxyFactory::setUseSystemConfiguration(true);
    	
    	setUrl(QUrl("qrc:/gmaps_files/googlemap.html"));
    and the html file:
    Code:
    <!--DOCTYPE html-->
    <html style="HEIGHT: 100%" xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <style type="text/css">
      html { height: 100% }
      body { height: 100%; margin: 0px; padding: 0px }
      #map_canvas { height: 100% }
    </style>
    
    <script type="text/javascript"
        src="http://maps.google.com/maps/api/js?sensor=true">
    </script>
    
    <script type="text/javascript">
      function initialize() {
        var latlng = new google.maps.LatLng(-34.397, 150.644);
        var myOptions = {
          zoom: 3,
          center: latlng,
    	  disableDefaultUI: true,
          mapTypeId: google.maps.MapTypeId.ROADMAP
        };
        var map = new google.maps.Map(document.getElementById("map_canvas"),
            myOptions);
      }
    
    </script>
    </head>
    <body onload="initialize()">
      <div id="map_canvas" style="width:100%; height:100%"></div>
    </body>
    </html>

Similar Threads

  1. [moved] Open source a simple Symbian C++ code with use Google static map API
    By zhang_guoqing in forum News and Announcements
    Replies: 8
    Last Post: 2010-09-16, 20:04
  2. Problem with Google Map API
    By smartsumit in forum Mobile Java General
    Replies: 5
    Last Post: 2009-04-02, 15:31
  3. Google Map Api...
    By Twub in forum Mobile Java General
    Replies: 9
    Last Post: 2008-09-17, 16:37

Posting Permissions

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