ipyleaflet
ipyleaflet copied to clipboard
VectorTileLayer styling
Hello there. I'd like to know if it is possible to dynamically style the features in VectorTileLayer, much like
https://leaflet.github.io/Leaflet.VectorGrid/vectorgrid-api-docs.html
I tried to put a function instead of a dictionary inside the vector_tile_layer_styles dict but it did not work.
`def pov(properties, zoom): v = properties['PovertyHea']
poverty = dict(
fill="true",
weight=1,
fillColor="red",
color='black',
fillOpacity=1,
opacity=1,
)
return poverty
style = {
'zambia.poverty':pov
}
`
Also, is it possible to re-render the layer or features whose style has changed, much like with the GeoJSON layer?
where I can dynamically replac ethe style attribute and the layer re-renders itself.
If none of this works what is theer any other solution to dynamically change these types of layers (opacity, styling) and interact with them??? (show attributes)
Any guidelines/example notebooks are highly appreciated.