1
0
Эх сурвалжийг харах

leaflet demo showing generic_layer usage

Rodja Trappe 1 жил өмнө
parent
commit
4da5322af5

+ 11 - 0
website/documentation/content/leaflet_documentation.py

@@ -42,4 +42,15 @@ def markers() -> None:
     m.on('click', lambda e: m.marker(location=e.args['latlng']))
     m.on('click', lambda e: m.marker(location=e.args['latlng']))
 
 
 
 
+@doc.demo('Add Vector Layers', '''
+    Leaflet supports a set of [vector layers](https://leafletjs.com/reference.html#:~:text=VideoOverlay-,Vector%20Layers,-Path) like circle, polygon etc.
+    These can be added with the `generic_layer` method.
+    We are happy to review any pull requests to add more specific layers to simplify usage.
+''')
+def markers() -> None:
+    m = ui.leaflet(location=(51.505, -0.09)).classes('h-32')
+    m.generic_layer(name='circle',
+                    args=[[51.505, -0.09], {'color': 'red', 'radius': 300}])
+
+
 doc.reference(ui.leaflet)
 doc.reference(ui.leaflet)