Closed lopezvoliver closed 3 weeks ago
Thanks for your PR!
Concerning the CI build failure, you should be able to fix it by running yarn run lint
from the python/jupyter_leaflet
directory
@martinRenou thanks, that worked for the "run" tests. What about the UI / Visual regression test? is there something I can do?
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