Rotation of Markers
See original GitHub issueFeature request. Allow the markers to be rotated.
The markers that I am displaying on the map have an orientation and it’d be nice to have a simple way of rotating the marker to this orientation. Currently, I’m grabbing the img tag and applying a CSS3 transform with jquery whenever the orientation changes. It works but it’s hacky and there are other webkit transforms already applied the tag.
$(marker._icon).css('-webit-transform','rotate(90deg)')
It’d be nice to have this built into the framework.
Issue Analytics
- State:
- Created 12 years ago
- Reactions:6
- Comments:26 (5 by maintainers)
Top Results From Across the Web
Rotate marker symbol layers—ArcGIS Pro | Documentation
You rotate markers by setting an angle in 2D or by rotating around three axes in 3D and specifying additional rotation behavior.
Read more >Showing directions using marker rotation in a scatter plot
The rotation of the markers can be made clockwise or counter-clockwise. A full rotation is 360 degrees, and a value of 361 is...
Read more >Use rotation of marker - Siemens PLM
When you enter a rotation angle, for example 90°, it looks like this: You can set the rotation angle in the dialog Edit...
Read more >Rotate Markers in functions like plot, scatter, etcetera #19195
The way I have found to rotate markers, is using a private attribute from the markers called '_transform', this attribute has methods to...
Read more >Solved: Point Marker Rotation - Civil 3D - Autodesk Forums
Point Marker Rotation · World Coordinate System: Indicates that the marker rotation angle is relative to the world coordinate system · Object: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @Deilan,
Thank you for your message.
It looks to me that @bbecquet’s Leaflet Rotated Marker plugin does the job (demo). You might also be interested in other plugins, e.g. leaflet.orientedMarker.
IMHO Leaflet project’s philosophy is to provide the most common functionality in core, and delegate more specific features to plugins. As such, having this feature in a plugin sounds an appropriate situation.
I will add Rotated Marker to the plugins list and will mark this Feature Request as closed.
For the sake of completeness, I will mention PR #2362 as an attempt to merge this feature a while back. Unfortunately, it looks like there was some incompatibilities with old browsers and other customizations (transparency…). It has been closed for inactivity, but feel free to revive it if you can update the code for Leaflet current version!
See comment https://github.com/bbecquet/Leaflet.RotatedMarker/issues/28#issuecomment-889636894