2015-03-02 91 views
-1

我正在嘗試向我的地圖添加另一個標記。添加標記

{ 
    //google map functionality 
    if($("#map_canvas").length > 0) { 
     initGmap(52.089115,-7.619437, 15); 
    } 

}); // END jQuery(document).ready 

沒有任何人有任何想法,我該怎麼辦中央社此,我擡頭對谷歌,但似乎是做錯了。

+0

請參考google maps API頁面 - https://developers.google.com/maps/documentation/javascript/examples/marker-simple – Pankucins 2015-03-02 15:13:46

回答

0

要添加你要定義這樣創建一個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如果需要多個標記。

+0

感謝您的幫助 – TedSquee 2015-03-03 09:30:34

+0

它的工作?如果是這樣,請接受爲正確答案;) – 2015-03-03 09:31:38

+1

現在就完成它。 – TedSquee 2015-03-03 09:53:32