How to include compass on the specified location on map using leaflet

1k Views Asked by At

How to put compass on specified location and point a certain bearing on location using angular and leaflet

Example below eg. example image here

1

There are 1 best solutions below

1
Joosep Parts On

Based on the documentation at https://www.npmjs.com/package/leaflet-compass

I am not sure what you mean by location. Like attach the compass on the the map and sticky it to the map? Or on location in the viewport. For the latter you could use prop position and for the angle/bearing angleOffset.

Live example: https://opengeo.tech/maps/leaflet-compass/examples/simple.html