Open relaxweb opened 6 years ago
It looks like normal behavior until the new, zoomed in tiles have loaded. If they just stay like that forever, something else is going on. I would check for errors in the console.
They do stay like that forever and this error is displayed in the console: TypeError: json.layers[layerName].feature is not a function Leaflet.VectorGrid.Protobuf.js:140:16
This is where the error occurs on lines: for (var i=0; i<json.layers[layerName].length; i++) { var feat = json.layers[layerName].feature(i); feat.geometry = feat.loadGeometry(); feats.push(feat); }
I think it needs to be changed to
for (var i=0; i<json.layers[layerName].length; i++) { if(json.layers[layerName].feature(i)){ var feat = json.layers[layerName].feature(i); feat.geometry = feat.loadGeometry(); feats.push(feat); } }
I am declaring vector grid like that:
It seems like https://unpkg.com/leaflet.vectorgrid@latest/dist/Leaflet.VectorGrid.bundled.js and all the related files are not updated with the latest changes.
Hi, I have 2 issues with VectorGrid:
1) Errors are popping up in console: TypeError: json.layers[layerName].feature is not a function when tiles are fetched, so when tiles are not found this error comes up. I am using VectorGrid to fetch tilesets from Mapbox Studio. Despite the error the vector tiles display correctly.
Here is a sample of my code:
2) When I zoom in, the vector tile markers or circlemarkers do not change size smoothly, but still remain on the map creating a messy display. Below are two screenshots.
Any idea how to fix these issues?