Leaflet / Leaflet.VectorGrid

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

allow to accept layer bbox as an option #10

Closed haoliangyu closed 8 years ago

haoliangyu commented 8 years ago

This PR will allow L.VectorGrid.Protobuf to accept bbox as an option. It's a L.latLngBounds object that defines the boundary box of the layer. If it's specified, the _getVectorTilePromise() function will first check if the requested area is outside the layer boundary bbox and not send the request if so. This is useful for people, especially who use dynamically generated vector tile, to reduce the unnecessary calculation.