Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to rotate leaflet.js map

I'm trying to rotate the map (or tileLayer) by x degrees. My research didn't produced any results that are not really dirty hacks and in my case doesn't work.

Is there a native leaflet.js way of rotating the map ?

(css rotate doesn't affect the mouse movement)

like image 418
amitdar Avatar asked Jan 28 '16 11:01

amitdar


2 Answers

Sorry to say, there is no way of natively rotating a Leaflet map. You'll need one of those ugly hacks or switch away from Leaflet and take a look at Mapbox GL JS or Open Layers 3:

  • http://www.mapbox.com/mapbox-gl-js/example/navigation/
  • http://openlayers.org/en/latest/examples/rotation.html
like image 83
iH8 Avatar answered Nov 05 '22 02:11

iH8


Leaflet does not support rotation, per this GitHub issue.

like image 1
Bob Avatar answered Nov 05 '22 02:11

Bob