Leaflet / Leaflet.VectorGrid

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

pull out _getTileURL (for extending) and added _getZoomForURL #23

Open jvrousseau opened 7 years ago

jvrousseau commented 7 years ago

This PR pulls out the L.Util.Template call into its own _getTileURL function as well as implemented the TODO of using the _getZoomForURL.

This would allow a developer to extend the L.VectorGrid.Protobuf class and generate their own tile URL without having to follow the URL skeleton scheme or re-implementing the entire _getVectorTilePromise function.

If there are any changes to the code, or if this doesn't fit into the project, just let me know.

Thanks!

jkuebart commented 7 years ago

This did not work for me with min/maxNativeZoom. The reason is that getTileSize() must be overridden to adjust for the clamped zoom level. Without it, the requested tile coordinates don't match the required zoom level. See #69.