PDA

View Full Version : QWebView Problem Drag&Drop Markers in Google Maps



MightTower
4th December 2010, 18:49
Hi,
i try to show Google Maps in a QWebView (this works) and to play around with a marker. The html code for the WebView is:


<html>
<head>
<script type="text/javascript" src="http://www.google.com/jsapi?autoload={'modules':[{name:'maps',version:3,other_params:'sensor=false' }]}"></script>
<script type="text/javascript">
function initialize() {
var latlng = new google.maps.LatLng(-34.397, 150.644);
var myOptions = {
zoom: 8,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
},
navigationControlOptions: {
style: google.maps.NavigationControlStyle.ZOOM_PAN
},
scaleControl: true
};
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var distanceWidget = new DistanceWidget(map);
}

function DistanceWidget(map) {
this.set('map', map);
this.set('position', map.getCenter());
var marker = new google.maps.Marker({
draggable: true,
title: 'Move me!'
});
// Bind the marker map property to the DistanceWidget map property
marker.bindTo('map', this);
// Bind the marker position property to the DistanceWidget position
// property
marker.bindTo('position', this);
}
DistanceWidget.prototype = new google.maps.MVCObject();
</script>
</head>

<body onload="initialize()">
<div id="map_canvas" style="width: 100%; height: 100%"></div>
</body>
</html>


My problem is that in the WebView i can not drag & drop the marker, with the Fancy Browser example of QT its the same.
If I try to load the page with IE, Firefox or Chrome it works as supposed.
Some one know what i can do or where is the problem?

Thanks,
Marc

desertpilot
5th March 2011, 04:50
Marc, I have the same problem here. Worked with Google's API V2, not with V3. Did you find a solution to this?

Thanks,

Holger

nuage125
29th April 2011, 23:10
I have the same pb, did you solve it ?
Thank you very much !

Olivier

desertpilot
29th April 2011, 23:19
For a while I had a solution: pointed to the Google Maps API v.3.1. Now they retired it, and we're back to broken maps. The only solution I am aware of right now is to recompile QtWebKit, with the flag ENABLE_TOUCH_EVENTS=0 (that's in the .pri). I believe it needs a commercial license to do that legally. Our build engineer tried that and it didn't build. We're going to try it again though.

Let me know if you find something out, too please!

Holger


I have the same pb, did you solve it ?
Thank you very much !

Olivier