2010-10-18 29 views

回答

0

您可以使用Google地图API来显示地图。 像这样显示的信息弹出:

<!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> 

要在运行时,你可以从你的Qt编写JavaScript代码的互动地图上添加点。看看这里: Qt QWEBview JavaScript callback