我希望通过jQuery api(例如http://s9.picofile.com/file/8304656450/map.JPG
)在谷歌地图中的位置上显示标题我的代码:
marker = new google.maps.Marker({
position: position,
map: map,
title: "12",
visible: true,
icon: '/images/location.png'
});
答案 0 :(得分:0)
您可以使用解决方案
marker = new google.maps.Marker({
position: position,
map: map,
title: "12",
label: "12", // --- this is what you need to use.
visible: true,
icon: '/images/location.png'
});
您应该使用label
始终在marker
上显示值。
参考文档: https://developers.google.com/maps/documentation/javascript/marker-clustering
来自Google文档的另一个小提琴链接https://jsfiddle.net/api/post/library/pure/
希望这会对你有所帮助。