1

How rotate map using the leaflet? I was trying here, but nothing worked. I followed this tutorial, even though it was from the mapbox, I assumed it was useful:

https://www.mapbox.com/mapbox-gl-js/example/navigation/

The error is:

Uncaught TypeError: t.addTo is not a function
    at e.addControl (leaflet.js:5)
    at HTMLDocument.<anonymous> (index.html:85)

And in my code, I just add

<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.42.2/mapbox-gl.js'></script>

And

map.addControl(new mapboxgl.NavigationControl());

I trying too http://labs.easyblog.it/maps/leaflet-compass, but it cant be use for rotate map. How do I rotate the map?

1

So, I was facing the same problem and, after some investigation, I found this comment on the leaflet's Github issue board. Seems like the functionality doesn't exist.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.