位置图标

时间:2017-08-26 11:31:39

标签: jquery google-maps

我希望通过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'
});

1 个答案:

答案 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/

希望这会对你有所帮助。