shramov / leaflet-plugins

Plugins for Leaflet library
http://psha.org.ru/b/leaflet-plugins.html
MIT License
722 stars 289 forks source link

How to rotate in place? #257

Closed distante closed 7 years ago

distante commented 7 years ago

I want to use Market.Rotate.js to rotate a marker that is basically a circle with an arrow inside and the marker position is in the middle of this circle.

Right now this does not work because it assumes the marker is a pin and I can not find the correct way to make it rotate in place.

How can I accomplish that?

brunob commented 7 years ago

Hmm have you set your icon anchor ? Can you provide a fiddle or a demo page ?

distante commented 7 years ago

I make a quick fiddle Here, as you can see, when I set the angle to 100 it moves from the map point

brunob commented 7 years ago

As i said, set your icon anchor with the right value and u're done :)

https://jsfiddle.net/r4y9awp4/3/

distante commented 7 years ago

Ah, sorry, you where rigth. I left here my updated fiddle because you forgot to put the icon anchor on yours :) Updated Fiddle