Skip to content

Commit

Permalink
leaflet demo showing generic_layer usage
Browse files Browse the repository at this point in the history
  • Loading branch information
rodja committed Dec 15, 2023
1 parent ab942d0 commit 4da5322
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions website/documentation/content/leaflet_documentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,15 @@ def markers() -> None:
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)

0 comments on commit 4da5322

Please sign in to comment.