谷歌地图图标不会显示
我一生都无法弄清楚为什么我的图标不会显示
function placeMarker(location) {
var marker = new google.maps.Marker({
position: location,
map: W.map,
icon: "/files/icons/maps/beacon_16.png"
});
W.map.setCenter(location);
}
当我注释掉图标行时,它显示标准标记,所以我显然错过了一些东西,但谷歌指南没有帮助如何我应该格式化我的变量
I can't for the life of me figure out why my icon won't show up
function placeMarker(location) {
var marker = new google.maps.Marker({
position: location,
map: W.map,
icon: "/files/icons/maps/beacon_16.png"
});
W.map.setCenter(location);
}
When I comment out the icon line, it shows the standard marker, so I'm obviously missing something but the google guides aren't helping in how I'm supposed to format my variables
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
更多
发布评论
评论(1)
您应该为图标属性提供绝对 URL,而不是相对路径。
You should provide an absolute URL for the icon attribute rather than relative path.