3
如何使用最新版本的GMaps.js更改我在代碼中設置的圖釘圖標?如何更改Gmaps.js在Google地圖中使用的圖標?
這裏就是我想要做的事:
$('input[name="Address"]').blur(function() {
GMaps.geocode({
address: $('input[name="Address"]').val(),
callback: function (results, status) {
if (status == 'OK') {
var latlng = results[0].geometry.location;
map.setCenter(latlng.lat(), latlng.lng());
map.addMarker({
lat: latlng.lat(),
lng: latlng.lng(),
icon: {
image: "http://i.imgur.com/12312.png"
}
});
}
}
});
});
運行此腳本,下面的錯誤爆發在Firebug的控制檯:
"NetworkError: 404 Not Found - http://localhost:17680/Account/undefined"
"NetworkError: 404 Not Found - http://localhost:17680/Account/undefined"
我不明白爲什麼它試圖因爲我從來沒有在代碼中的任何地方調用它,所以HTTP GET那個URL。
@RASG:我已經回答了我的問題,謝謝! – sergserg