π§ Compass (or North Arrow)ο
A compass can be added to the map via Maps.add_compass()
:
To add a North-Arrow, use
m.add_compass(style="north arrow")
Interacting with the compass
The compass is a pickable object!
Click on it with the LEFT mouse button to drag it around!
While a compass is picked (and the LEFT mouse button is pressed), the following additional interactions are available:
press
delte
on the keyboard: remove the compass from the plotrotate the
mouse wheel
: scale the size of the compass
Add a "compass" or "north-arrow" to the map. |
from eomaps import Maps
m = Maps(Maps.CRS.Stereographic())
m.add_feature.preset.ocean()
m.add_compass()
|
![]()
|
The compass object is dynamically updated if you pan/zoom the map, and it can be dragged around on the map with the mouse.
The returned compass
object has the following useful methods assigned:
Remove the compass from the map. |
|
Set the style of the background patch. |
|
Set the size scale-factor of the compass. |
|
Set if the compass can be picked with the mouse or not. |
|
Set how to deal with invalid rotation-angles. |
|
Return the current position of the compass. |
|
Return the current size scale-factor of the compass. |