0
我在我的應用程序中使用谷歌地圖API。如何在地圖上顯示縮略圖圖像以代替紅色氣泡作爲特定地址。我怎樣才能顯示縮略圖圖像,儘管泡沫在谷歌地圖API
我在我的應用程序中使用谷歌地圖API。如何在地圖上顯示縮略圖圖像以代替紅色氣泡作爲特定地址。我怎樣才能顯示縮略圖圖像,儘管泡沫在谷歌地圖API
當您創建標記時,您設置圖標。即
var marker = new google.maps.Marker({
map: null,
position: new google.maps.LatLng(jdata.locationLat, jdata.locationLon),
visible: true,
clickable: true,
title: jQuery.trim(jdata.locationName),
icon: 'http://www.mysite.com/mythumb.png',
shadow: 'http://www.mysite.com/markershadow.png'
});
可以初始化後,將其設置爲好:
marker.setIcon('http://www.mysite.com/mythumb.png');
marker.setShadow('http://www.mysite.com/markershadow.png');
我使用我在哪裏通過JavaScript喜歡 - map.setCenter指向的地址(用戶控制的新的GLatLng(經度,緯度) parseFloat(的document.getElementById(hdnZoom)。價值)); var point = new GLatLng(latlons [0],latlons [1]); map.addOverlay(new GMarker(point)); – topi 2010-10-07 13:17:20
你說你使用的是版本3,但看起來像版本2的調用。該選項將參考創建一個新的標記。 – Fosco 2010-10-07 13:18:36