Closed c-martinez closed 7 years ago
Can you publish a fiddle/codepen/playground that displays this behaviour?
Fiddle: https://jsfiddle.net/cmartinez/qw0bdd9a/1/
Basically I would like to:
If I understand correctly, you want to create support for another data format than VectorGrid already supports (GeoJSON, MVT). However, I'm not sure I understand how this relates to hooking up to zoomend
or other events - VectorGrid will automatically update its tiles whenever the map is zoomed, so this is not something you would have to implement. The same goes for moving around (panning): already handled by VectorGrid (or rather by L.GridLayer
, which VectorGrid uses).
So, for me, it's a bit unclear what the actual question here is?
Indeed what I am aiming is for another data format. The reason why I want (or at least I think I want) to hook up to an event is because I want to know when the data from my custom format has finished loading so I can start processing. For example, I could trigger drawing of a pie chart with the data from my custom format.
Does this make sense? Or am I approaching the problem the wrong way?
Aha! I think that is just what I needed. Thanks!
I am trying to load a custom JSON for each vector tile. So whenever I zoom in/out / move around, I want to load a different chunk of JSON data. I am doing some data plotting using the JSON data from the different layers.
When zooming in and out, I am hooking up to the
zoomend
event to refresh the plots. However this does not work when the map is loaded for the first time. Is there any other event which I could hook up to? Or (even better) are is there a function / event whichVectorGrid
calls / notifies when it starts and finishes loading data?