我在谷歌地图中有几个图标的下一个代码,但在尝试调整serval图标的大小时不起作用。
我需要帮助,因为我的图标大小不同
var iconBase = '../../Content/images/';
var icons = {
WIND: {
icon: iconBase + 'turbin.gif',
origin: new google.maps.Point(0, -15),
size: new google.maps.Size(40, 80),
scaledSize: new google.maps.Size(40, 80)
},
OTHER: {
icon: iconBase + 'library_maps.png'
},
SOLAR: {
icon: iconBase + 'panel.gif'
},
};
答案 0 :(得分:0)
您的代码中有一个拼写错误,每个the documentation,下面的icon
应为url
:
WIND: {
icon: iconBase + 'turbin.gif',
origin: new google.maps.Point(0, -15),
size: new google.maps.Size(40, 80),
scaledSize: new google.maps.Size(40, 80)
}
应该是:
WIND: {
url: iconBase + 'turbin.gif',
origin: new google.maps.Point(0, -15),
size: new google.maps.Size(40, 80),
scaledSize: new google.maps.Size(40, 80)
}