-
Notifications
You must be signed in to change notification settings - Fork 362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve vector tile layer #1206
Improve vector tile layer #1206
Conversation
Thanks for your PR! Concerning the CI build failure, you should be able to fix it by running |
@martinRenou thanks, that worked for the "run" tests. What about the UI / Visual regression test? is there something I can do? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I believe the CI failures are unrelated
Co-authored-by: martinRenou <martin.renou@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This PR aims to add the ability to use dynamic styling to
VectorTileLayer
. That is, styling may be defined as a function ofproperties
andzoom
. This is possible with Leaflet.VectorGrid, but is not yet implemented in ipyleaflet, because there is currently no way to define python callbacks that can be used by the leaflet map.One compromise is to allow the user to define the javascript code for the dynamic style as a string.
Following the example from the documentation, here's a simple dynamic style that the user could define for use with
ipyleaflet.VectorTileLayer
:it should only show
landuse
in purple for zoom levels less than 10, and otherwise show features as gray, except if they are "forest".Here's an animation of the behavior achieved by this PR:
Here's another example using my own vector tile layer:
Related issue: #744