QWebKit doesn't handle click and dblclick for Google Maps

耗尽温柔 提交于 2020-01-06 14:53:23

问题


I just copy/pasted this code from google maps API in a my index.html

<!DOCTYPE html>
<html>
  <head>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <style type="text/css">
      html { height: 100% }
      body { height: 100%; margin: 0; padding: 0 }
      #map_canvas { height: 100% }
    </style>
    <script type="text/javascript"
      src="http://maps.googleapis.com/maps/api/js?key=MYKEY&sensor=false">
    </script>
    <script type="text/javascript">
      function initialize() {
        var mapOptions = {
          center: new google.maps.LatLng(-34.397, 150.644),
          zoom: 8,
          mapTypeId: google.maps.MapTypeId.ROADMAP
        };
        var map = new google.maps.Map(document.getElementById("map_canvas"),
            mapOptions);
      }
    </script>
  </head>
  <body onload="initialize()">
    <div id="map_canvas" style="width:100%; height:100%"></div>
  </body>
</html>

Every things is OK in a browser like chrome. I mean when I double click on the map it zooms in. And When I drag the map the center point of the map changes. But when I load this file in a QWebView object, the map loads but QWebView doesn't pay attention to clicks and double clicks !

来源:https://stackoverflow.com/questions/12070604/qwebkit-doesnt-handle-click-and-dblclick-for-google-maps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!