pysepal.mapping.draw_control.GeomanDrawControl#
- class pysepal.mapping.draw_control.GeomanDrawControl(*args, **kwargs)[source]#
Drawing control based on Leaflet-Geoman.
Provides the same API as DrawControl (show/hide/to_json/clear) but uses the Geoman library which offers additional tools (drag, cut, rotate, text).
- Usage:
Replace
DrawControlwithGeomanDrawControlin SepalMap or use directly:from pysepal.mapping import GeomanDrawControl dc = GeomanDrawControl(my_map) my_map.add(dc)
A custom DrawingControl based on Leaflet-Geoman.
- Parameters:
m (Map | None) – the map on which the drawControl is displayed
kwargs – any available arguments from ipyleaflet.GeomanDrawControl
Attributes
mthe map on which the drawControl is displayed
Methods
A custom DrawingControl based on Leaflet-Geoman.
Hide the drawing control from the map and clear its content.
Transform a circle (a point with a radius) into a GeoJson polygon.
Show the drawing control on the map and clear its content.
Return the content of the DrawControl data.
- GeomanDrawControl.__init__(m, **kwargs)[source]#
A custom DrawingControl based on Leaflet-Geoman.
- Parameters:
m (Map) – the map on which the drawControl is displayed
kwargs – any available arguments from ipyleaflet.GeomanDrawControl
- Return type:
None
- GeomanDrawControl.hide()[source]#
Hide the drawing control from the map and clear its content.
- Return type:
None
- static GeomanDrawControl.polygonize(geo_json)[source]#
Transform a circle (a point with a radius) into a GeoJson polygon.
Handles both Geoman format (radius in properties) and legacy format (radius in properties.style.radius).
- Params:
geo_json: the circle geojson
- Returns:
the polygonised feature
- Parameters:
geo_json (dict)
- Return type:
dict