2016-12-27 125 views
-1

我正在嘗試使用標記創建地圖。 但在下面的代碼中,我看不到標記。HTML Google地圖無法看到標記

<html> 
<head> 
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> 
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/> 
<title>Google Maps - pygmaps </title> 
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?libraries=visualization&sensor=true_or_false"></script> 
<script type="text/javascript"> 
    function initialize() { 
     var centerlatlng = new google.maps.LatLng(37.427000, -122.145000); 
     var myOptions = { 
      zoom: 16, 
      center: centerlatlng, 
      mapTypeId: google.maps.MapTypeId.ROADMAP 
     }; 
     var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); 

     var latlng = new google.maps.LatLng(37.427000, -122.145000); 
     var img = new google.maps.MarkerImage('C:\Python27\lib\site-packages\gmplot\markers\D8BFD8.png'); 
     var marker = new google.maps.Marker({ 
     title: "no implementation", 
     icon: img, 
     position: latlng 
     }); 
     marker.setMap(map); 

     var latlng = new google.maps.LatLng(37.428000, -122.146000); 
     var img = new google.maps.MarkerImage('C:\Python27\lib\site-packages\gmplot\markers\6495ED.png'); 
     var marker = new google.maps.Marker({ 
     title: "no implementation", 
     icon: img, 
     position: latlng 
     }); 
     marker.setMap(map); 

     var latlng = new google.maps.LatLng(37.429000, -122.144000); 
     var img = new google.maps.MarkerImage('C:\Python27\lib\site-packages\gmplot\markers\000000.png'); 
     var marker = new google.maps.Marker({ 
     title: "no implementation", 
     icon: img, 
     position: latlng 
     }); 
     marker.setMap(map); 

    } 
</script> 
</head> 
<body style="margin:0px; padding:0px;" onload="initialize()"> 
    <div id="map_canvas" style="width: 100%; height: 100%;"></div> 
</body> 
</html> 

例如:C:\Python27\lib\site-packages\gmplot\markers\6495ED.png存在的方式。我可以看到有圖像,但圖像不出現在地圖上。任何人都可以說我該如何解決這種情況?

+0

使用的標記圖標一個公開的URL。 – geocodezip

回答