1

I created a marker with a custom image, but the image is anchored to the bottom of the image. I want to give the the centre if the image as the anchor point so that even if I rotate the image, it rotates around the centre.

I followed this excellent solution Rotating image / marker image on Google map V3 to rotate the custom image on the marker in agm/core (angular 4).

thanks to @ErDmKo

thanks in advance

Srikanth
  • 21
  • 6

2 Answers2

7

It is possible by using the Object like in the official Google Maps Doc instead of the string like in the AGM Doc.

It works like:

<agm-marker [iconUrl]="{url: '/assets/icons/icon-map-home.png',  anchor : {x:19, y:19}}">
Simon Hansen
  • 622
  • 8
  • 15
0

Actually the functionality existed in the @agm/core, but its not documented...

we can give like this in iconUrl (it is supposed to be icon ) anchor : {x:25, y:25}

Srikanth
  • 21
  • 6