Leaflet / Leaflet.VectorGrid

Display gridded vector data (sliced GeoJSON or protobuf vector tiles) in Leaflet 1.0.0
598 stars 194 forks source link

VectorGrid tries to read the non-existent tile and generates error. #135

Closed ekut closed 6 years ago

ekut commented 6 years ago

I have prepared vector tiles (prepared by mapbox/tippecanoe). These tiles cover shapes in some city (about 500 thousands of features) and VectorGrid.protobuf() render them fast and correctly on my map.

But, when I move the viewport to the border of the city:

  1. At some moment VectorGrid tries to load a non-existent tile (for example, to the right of the border of the city).
  2. readFields() get empty object as result argument.
  3. Then we call this$1.skip(val); In this case val equal to 60.
  4. skip(60) => throw new Error('Unimplemented type: ' + type); } Type is equal 4 in the case.

But why we need any thrown error in this case? It's normal situation: tile don't exists, just do nothing. What am I doing wrong, how can I avoid this situation? Thank you.

ekut commented 6 years ago

Not a VectorGrid problem, sorry