Rotation of Esri Leaflet Vector

832
2
Jump to solution
09-20-2021 12:31 PM
Labels (1)
ttchipster
New Contributor

Has anyone made the Esri Leaflet Vector map rotate? E.g. using a laptop in a vehicle that "up" on the map would be the direction that the car is facing.

I tried combining demo code from Esri and from the leaflet-rotate-map plug-in (https://www.npmjs.com/package/leaflet-rotate-map) but this has problems. For example a 45 degree rotation on this view:

ttchipster_1-1632166108415.png

does rotate but it loses some of the map area and also the marker is no longer at the same point on the ground.

ttchipster_2-1632166183968.png

Are there any known ways for doing rotation with Esri Leaflet Vector?

0 Kudos
1 Solution

Accepted Solutions
GavinRehkemper
Esri Contributor

Per this issue in the Leaflet repository, Leaflet does not officially support rotation. If you're looking for map rotation, I would suggest looking at the ArcGIS API for JavaScript v4 which fully supports rotation.

View solution in original post

0 Kudos
2 Replies
GavinRehkemper
Esri Contributor

Per this issue in the Leaflet repository, Leaflet does not officially support rotation. If you're looking for map rotation, I would suggest looking at the ArcGIS API for JavaScript v4 which fully supports rotation.

0 Kudos
ttchipster
New Contributor

Thanks, Gavin. Leaflet core does not support rotation, but the recent  leaflet plugin that I mentioned looks promising; it was published 5 months ago (the Leaflet repository entry you linked to ended in 2018), so I'm hopeful that it will work with some of our current formats. We already have long usage with leaflet and users with various data formats, not just Esri formats, so switching or adding renderers is a big investment.

0 Kudos