Alex Rivera | Logout

Google Maps API - Offset for Marker Image - Replace Marker - Not at GeoPosition

Asked 2012-08-24T07:42:01.213
15

I've an image (a circle) which should indicate a specific metropolitan area. Also I've got the GeoPosition of all my relevant areas.

If I place my markers, the bottom-center of my image is at the marker's GeoPosition. But because its an aerial view I'd like to give the image an offset, so the center of my cirle-image is at that GeoPosition...

Any ideas how to achieve this?

Thanks!

Edit
Report

1 Answer

3

You have to specify where the anchor point in your markerImage is. See docs: https://developers.google.com/maps/documentation/javascript/reference?hl=de#MarkerImage

If not specified google assume the center of the bottom edge of your markerImage as anchor point.

Here is an example at the API docs how to build a complex marker with correct markerImage: https://google-developers.appspot.com/maps/documentation/javascript/examples/icon-complex?hl=de

answered 2012-08-24T09:51:54.023

Your Answer