如何在Google Map中的Marker中放置标签? [英] How to position the label inside the Marker in Google Map?

查看:204
本文介绍了如何在Google Map中的Marker中放置标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如图所示,我的标签"150"严格位于中心.但是我想一点点向上移动.这可能吗? 请注意,我正在使用标记聚类.所以我必须使用标记"类型(如果我输入错了,请纠正我)

As shown in the picture, my label '150' is strictly located at the center. But i would like to move up a little bit. Is this possible? Note that I am using markers clustering. So i have to use 'Markers' type (correct me if I am wrong)

推荐答案

请参见

See the documentation for the Icon anonymous object:

labelOrigin
类型:点
如果标记是由标签提供的,则标签相对于图标图像左上角的原点.默认情况下,原点位于图像的中心点.

labelOrigin
Type: Point
The origin of the label relative to the top-left corner of the icon image, if a label is supplied by the marker. By default, the origin is located in the center point of the image.

要移动标签,请将Icon的labelOrigin属性设置为所需值.

To move the label, set the labelOrigin property of the Icon to the required value.

这篇关于如何在Google Map中的Marker中放置标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆