Hello, I am making an app with dash to display maps, the idea is that the client (frontend) can create a polygon with edit_control, and from the backend it can capture those polygons created by the client, I have the following code, but it paints the polygon on the map and what I want is to store them in a dl.GeoJSON to work them just and need, I hope you can help me, thank you very much.
Creamos el control del mapa para creacion manual de los poligonos
pol_man = dl.FeatureGroup([dl.EditControl(id="edit_control")])
# Como renderizamos el geojson.
point_to_layer = assign("""function(feature, latlng, context){
const p = feature.properties;
if(p.type === 'circlemarker'){return L.circleMarker(latlng, radius=p._radius)}
if(p.type === 'circle'){return L.circle(latlng, radius=p._mRadius)}
return L.marker(latlng);
}""")
poly_data = html.Div(dl.GeoJSON(id="info_geo"))
# Codigo que realiza la captura el poligono marcado
@app.callback(Output("info_geo", "data"), Input("edit_control", "geojson"))
def mirror(x):
if not x:
raise PreventUpdate
return x