sepal_ui.mapping.draw_control.DrawControl#

class sepal_ui.mapping.draw_control.DrawControl(**kwargs)[source]#

A custom DrawingControl object to handle edition of features.

Parameters:
  • m (Map | None) – the map on which he drawControl is displayed

  • kwargs – any available arguments from a ipyleaflet.DrawingControl

Attributes

m

the map on which he drawControl is displayed.

Methods

__init__

A custom DrawingControl object to handle edition of features.

hide

Hide the drawing control from the map, and clear it's content.

polygonize

Transform a ipyleaflet circle (a point with a radius) into a GeoJson polygon.

show

Show the drawing control on the map.

to_json

Return the content of the DrawControl data.

DrawControl.__init__(m, **kwargs)[source]#

A custom DrawingControl object to handle edition of features.

Parameters:
  • m (Map) – the map on which he drawControl is displayed

  • kwargs – any available arguments from a ipyleaflet.DrawingControl

Return type:

None

DrawControl.hide()[source]#

Hide the drawing control from the map, and clear it’s content.

Return type:

None

static DrawControl.polygonize(geo_json)[source]#

Transform a ipyleaflet circle (a point with a radius) into a GeoJson polygon.

The methods preserves all the geo_json other attributes. If the geometry is not a circle (don’t require polygonisation), do nothing.

Params:

geo_json: the circle geojson

Returns:

the polygonised feature

Parameters:

geo_json (dict)

Return type:

dict

DrawControl.show()[source]#

Show the drawing control on the map. and clear it’s content.

Return type:

None

DrawControl.to_json()[source]#

Return the content of the DrawControl data.

Returned without the styling properties and using a polygonized representation of circles. The output is fully compatible with __geo_interface__.

Returns:

the json representation of all the geometries draw on the map

Return type:

dict