Search code examples
google-maps-api-3google-maps-markers

How to position the label inside the Marker in Google Map?


enter image description here

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)


Solution

  • See the documentation for the Icon anonymous object:

    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.

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