terikon / marker-animate-unobtrusive

Google Maps markers become animated, unobtrusively
MIT License
222 stars 52 forks source link

rotating #16

Closed ezekel closed 7 years ago

ezekel commented 7 years ago

Hi @viskin , first of all I would like to say thank you for the hard work and it's awesome 👍 , I used this in my project... I just want to wish if you can add feature that can rotate png file because I want to use png as my marker and I have heading value that was save in database and I want to rotate it the png file marker base on the heading.

Thank you in advance.

viskin commented 7 years ago

Thank you. Why don't you rotate the marker image using css transform: rotate()?

ezekel commented 7 years ago

@viskin ,

Thank you for the reply but I have no clue how to use that transform. rotate() in css ? can you please show how to apply.

Thank you in advance.

viskin commented 7 years ago

I will try to create a demo ASAP

ezekel commented 7 years ago

@viskin,

Thank you so much in advance... I will wait...

viskin commented 7 years ago

Here's the demo. It's not ideal, but it provides some foundation for you to rotate a marker. The marker is being cut while rotating, I think this issue can be solved by providing an image with enough empty space around. You can add some animation to rotation if you wish. Anyway, rotation has nothing to do with this library - that's just standard google maps tricks.

ezekel commented 7 years ago

@viskin ,

Thank you so much for the demo, you save me.

More power to you always.

maxchernin commented 5 years ago

@viskin adding scaledSize: new maps.Size(50, 50) helped me with the icon size being cut - in my case my icon is 45X45 so ive just added 5 px each