Skip to content

Commit

Permalink
Implement min/maxNativeZoom (and related) options.
Browse files Browse the repository at this point in the history
  • Loading branch information
jkuebart committed Feb 8, 2017
1 parent ff9b994 commit d8fa93e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Leaflet.VectorGrid.Protobuf.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ import {VectorTile} from 'vector-tile';
L.VectorGrid.Protobuf = L.VectorGrid.extend({

options: {
minZoom: 0, // Like L.TileLayer
maxZoom: 18, // Like L.TileLayer
maxNativeZoom: null, // Like L.TileLayer
minNativeZoom: null, // Like L.TileLayer
subdomains: 'abc', // Like L.TileLayer
zoomOffset: 0, // Like L.TileLayer
zoomReverse: false, // Like L.TileLayer
},


Expand All @@ -21,14 +27,16 @@ L.VectorGrid.Protobuf = L.VectorGrid.extend({

_getSubdomain: L.TileLayer.prototype._getSubdomain,

getTileSize: L.TileLayer.prototype.getTileSize,

_getZoomForUrl: L.TileLayer.prototype._getZoomForUrl,

_getVectorTilePromise: function(coords) {
var data = {
s: this._getSubdomain(coords),
x: coords.x,
y: coords.y,
z: coords.z
// z: this._getZoomForUrl() /// TODO: Maybe replicate TileLayer's maxNativeZoom
z: this._getZoomForUrl(),
};
if (this._map && !this._map.options.crs.infinite) {
var invertedY = this._globalTileRange.max.y - coords.y;
Expand Down

0 comments on commit d8fa93e

Please sign in to comment.