作者:日本化妆品专卖_703 | 来源:互联网 | 2023-05-18 09:18
HowcanIusethelatestversionofGMaps.jstochangethepiniconIsetincode?如何使用最新版本的GMaps.js
How can I use the latest version of GMaps.js to change the pin icon I set in code?
如何使用最新版本的GMaps.js更改我在代码中设置的图钉图标?
Here's what I'm trying to do:
这是我正在尝试做的事情:
$('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"
}
});
}
}
});
});
When running this script, the following errors flare up in Firebug's console:
运行此脚本时,Firebug控制台中会出现以下错误:
"NetworkError: 404 Not Found - http://localhost:17680/Account/undefined"
"NetworkError: 404 Not Found - http://localhost:17680/Account/undefined"
I don't understand why it's trying to HTTP GET that URL since I've never invoked it anywhere in the code.
我不明白为什么它试图HTTP GET该URL,因为我从未在代码中的任何地方调用它。
1 个解决方案