google-maps - 在 Google map 标记中创建标签

标签 google-maps

我想在谷歌地图标记中创建一个标签。 我创建了一个标题,但我希望文本每次都可见。 看我的代码:

var marker = new google.maps.Marker({
position: myLatLng,
map: map,
title: 'My Label'

});

最佳答案

试试这个例子:https://jsfiddle.net/mapquintal/hpkahh8f/3/

要更改标签外观,请编辑 css 代码,要更改位置,请编辑 javascript 代码labelAnchor: new google.maps.Point(40, 0)

字体:http://www.glerl.noaa.gov/res/glcfs/kml/test1.html

查看另一个示例:http://www.glerl.noaa.gov/res/glcfs/kml/test2.html

关于google-maps - 在 Google map 标记中创建标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37948711/

相关文章:

javascript - 如何使用 gmaps4rails 在 rails 中旋转标记?

javascript - Div 位于另一个 div 之上

php - 是否可以使用 Google Maps API v3 的 map.getBounds() 的结果来查询 MySQL 数据库?

android - 自动显示谷歌地图标记的工具栏

ios - "Reached the max number of texture atlases, can not allocate more"使用谷歌地图

javascript - 如何替换 Google Map Api 中的 A 和 B 标记

javascript - 根据屏幕/设备宽度设置 Google Maps API V3 缩放级别

android - 在谷歌地图上添加图层后未调用 map 单击监听器

jquery - 谷歌地图标记随机消失

angular - 如何将 html 添加到 angular 2 中的 agm-marker?