2010-10-13 89 views

回答

5

Google Maps API V3現在是正式版本。

http://code.google.com/apis/maps/documentation/javascript/overlays.html#Icons

在聲明標記使用「圖標」屬性設置的圖像。

從文檔:

var image = 'beachflag.png'; 
    var myLatLng = new google.maps.LatLng(-33.890542, 151.274856); 
    var beachMarker = new google.maps.Marker({ 
     position: myLatLng, 
     map: map, 
     icon: image 
    }); 

您還可以使用圖表API生成標記圖像。

E.g. http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=A|FF0000|000000爲紅色的大頭針

http://groups.google.com/group/google-chart-api/web/chart-types-for-map-pins?pli=1

+0

+1圍棋的V3。它更乾淨。 – 2010-10-13 14:15:34