Leaflet / Leaflet/Leaflet.VectorGrid
Override vectorTileLayerStyles
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 676
- Forks
- 202
- PR merge metrics
- No merged PRs in 30d
Description
First of all thanks for this implementation, I have to ask if it is possible to override the functions in charge of styles of the vector tiles dynamically. I tried checking the code in order to find the place where I could possibly achieve this but I couldn't find where.
What I am trying to achieve is something like this:
var layer = L.vectorGrid.protobuf(url, vectorTileOptions);
....
document.getElementById('swap-styles').addEventListener('click', e => {
layer.updateLayerStyle('the_layer_name', newColorFn);
// the above would trigger a redraw for the viewport tiles
// and the next tiles to be rendered would use the updated function
}
Thanks :)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the L.vectorGrid.protobuf entry point and trace how vectorTileLayerStyles are applied to existing and newly rendered tiles. Define the updateLayerStyle behavior described in the issue, including viewport redraws and styles for future tiles; no file or test location is specified in the report.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, web-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100