QWebView Problem Drag&Drop mit Markern in Google Maps
Verfasst: 4. Dezember 2010 18:27
Hallo zusammen,
folgenden Code zeige ich in einer QWebView Komponente an:
Problem ist das ich den Marker nicht per Drag & Drop bewegen kann, auch im Fancy Browser Beispiel gehts nicht. Rufe ich die html in einem Browser auf gehts ohne Probleme.
Hat jemand eine Idee woran das liegen könnte, bzw. noch besser wie ich es beheben kann?
Vielen Dank
Marc
folgenden Code zeige ich in einer QWebView Komponente an:
Code: Alles auswählen
<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>
Hat jemand eine Idee woran das liegen könnte, bzw. noch besser wie ich es beheben kann?
Vielen Dank
Marc