Pieter
Pieter

Reputation: 32805

Centering a Google Maps marker over its position

I've created a Google Maps JavaScript embed with a RichMarker placed at the arbitrary coordinate 50.85, 4.35. I've marked this coordinate by approximation with a green dot in the screenshot below.

Marker is placed above its LatLng location.

As you can see, the content of the marker is placed above the coordinate. This is not the behavior I'm looking for. Instead, I want the marker to be centered over the coordinate, as shown here:

Marker is centered over its position.

Is there an easy way to enforce this type of placement using the standard Google Maps API, a plugin or jQuery? I'm using v3 of the API.

Upvotes: 1

Views: 1270

Answers (2)

geocodezip
geocodezip

Reputation: 161404

You need to set the anchor for the RichMarker to be the center of the image (not the bottom center).

Upvotes: 2

Related Questions