2010-10-18 4 views

Répondre

0

Vous pouvez utiliser l'API Google Maps pour afficher des cartes. Quelque chose comme ceci affiche la fenêtre d'information:

<!DOCTYPE html> 
<html> 
<head> 
<script type="text/javascript" 
    src="http://maps.googleapis.com/maps/api/js?sensor=false"> 
</script> 
<script type="text/javascript"> 
    function initialize() { 
    var latlngmap_canvas = new google.maps.LatLng(45.819735,10.023033); 
    var myOptionsmap_canvas = { 
     zoom: 16, 
     center: latlngmap_canvas, 
     mapTypeId: google.maps.MapTypeId.ROADMAP 
    }; 
    var mapmap_canvas = new google.maps.Map(document.getElementById("map_canvas"), 
     myOptionsmap_canvas); 
     var markermap_canvas = new google.maps.Marker({ 
         map: mapmap_canvas, 
         title: 'Title', clickable: true, 
         position: new google.maps.LatLng(45.819735,10.023033) 
         }); 
     var tooltipmap_canvas = '<div id="tooltip"><p><strong>Title</strong><br>Line of text</p></div>'; 
    var infowindowmap_canvas = new google.maps.InfoWindow({ 
     content: tooltipmap_canvas 
    }); 
    google.maps.event.addListener(markermap_canvas, 'click', function() { 
     infowindowmap_canvas.open(mapmap_canvas,markermap_canvas); 
    }); 
    } 

</script> 
</head> 
<body onload="initialize()"> 
    <div id="map_canvas" style="width:500px; height:400px"></div> 
</body> 
</html> 

Pour ajouter des points sur la carte lors de l'exécution, vous pouvez interagir avec votre code javascript de Qt. Jetez un coup d'oeil ici: Qt QWEBview JavaScript callback