-
Notifications
You must be signed in to change notification settings - Fork 39
-
What are the options / best practices for altering the styling of layers based on the zoom level?
One option could be to observe map widget event changes (similar to the following example), but is there a better approach?
m = lonboard.Map(layers) def on_map_change(change): if change['name'] == '_property_lock': try: zoom = change['new']['view_state']['zoom'] # code to manipulate layers layers[1].visible = (zoom < 1) except KeyError: pass m.observe(on_map_change)
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
The easiest way is when the upstream deck.gl properties automatically support zoom-based styling. That is, for radius, there's radiusUnits that you can set to meters, which will automatically scale the radius at different zooms for roughly the same physical on-earth size.
Otherwise, I don't have great advice for the general case. I think what you have there is a good start!
Beta Was this translation helpful? Give feedback.
All reactions
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment