我正在嘗試向我的地圖添加另一個標記。添加標記
{
//google map functionality
if($("#map_canvas").length > 0) {
initGmap(52.089115,-7.619437, 15);
}
}); // END jQuery(document).ready
沒有任何人有任何想法,我該怎麼辦中央社此,我擡頭對谷歌,但似乎是做錯了。
我正在嘗試向我的地圖添加另一個標記。添加標記
{
//google map functionality
if($("#map_canvas").length > 0) {
initGmap(52.089115,-7.619437, 15);
}
}); // END jQuery(document).ready
沒有任何人有任何想法,我該怎麼辦中央社此,我擡頭對谷歌,但似乎是做錯了。
要添加你要定義這樣創建一個new marker:
// Barcelona coordinates
var myLatlng = new google.maps.LatLng(2.19, 40.4);
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title:"Hello World!"
});
檢查here如果需要多個標記。
請參考google maps API頁面 - https://developers.google.com/maps/documentation/javascript/examples/marker-simple – Pankucins 2015-03-02 15:13:46