Skip to content

Commit

Permalink
Support deck tooltips for multiple layers
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Kuethe committed May 30, 2024
1 parent 9b0c9e0 commit e246816
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
5 changes: 4 additions & 1 deletion docs/examples/deckgl_layer/airports_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@

m.add_deck_layers(
[deck_geojson_layer, deck_arc_layer],
tooltip_template="{{ &properties.name }}",
tooltip_template={
"airports": "{{ &properties.name }}",
"arcs": "gps_code: {{ properties.gps_code }}",
},
)

# Shiny Express
Expand Down
4 changes: 3 additions & 1 deletion maplibre/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,5 +274,7 @@ def to_html(self, title: str = "My Awesome Map", **kwargs) -> str:
)
return output

def add_deck_layers(self, layers: list[dict], tooltip_template: str = None) -> None:
def add_deck_layers(
self, layers: list[dict], tooltip_template: str | dict = None
) -> None:
self.add_call("addDeckOverlay", layers, tooltip_template)
8 changes: 4 additions & 4 deletions maplibre/srcjs/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e246816

Please sign in to comment.