我們在一年前完成了此腳本,並且不顯示標記圖標。我知道它的gmap 2,現在應該是gmap3 ..但是對於我的生活無法轉換。任何幫助表示讚賞,或幫助我們解決這個問題,請。谷歌地圖自定義標記不顯示
腳本是:
var userLocation = '<?php echo $homelocation; ?>';
if (GBrowserIsCompatible()) {
var geocoder = new GClientGeocoder();
geocoder.getLocations(userLocation, function (locations) {
if (locations.Placemark)
{
var north = locations.Placemark[0].ExtendedData.LatLonBox.north;
var south = locations.Placemark[0].ExtendedData.LatLonBox.south;
var east = locations.Placemark[0].ExtendedData.LatLonBox.east;
var west = locations.Placemark[0].ExtendedData.LatLonBox.west;
var bounds = new GLatLngBounds(new GLatLng(south, west),
new GLatLng(north, east));
var map = new GMap2(document.getElementById("map_canvas"));
var Icon = new GIcon();
Icon.image = "images/422marker.png";
Icon.iconSize = new GSize(33, 50);
map.setCenter(bounds.getCenter(), map.getBoundsZoomLevel(bounds));
map.addOverlay(new GMarker(bounds.getCenter()), Icon);
}
});
}
你將不得不重寫大部分內容,沒有辦法繞過它,你將不得不去閱讀和研究文檔和例子 - 這很清楚。也加入Gmaps v3 Google Group。 – Cups 2011-05-20 13:17:15
它曾經工作過,但不再?或者標記不工作? – Trott 2011-05-20 14:35:52
它實際上是完美的,只是不顯示我們的自定義標記。 – 422 2011-05-21 01:02:18