Skip to content

Commit

Permalink
Merge pull request #904 from jgravois/patch743
Browse files Browse the repository at this point in the history
honor leaflet maxNativeZoom
  • Loading branch information
jgravois authored Dec 29, 2016
2 parents 81a00e8 + cb8fc5f commit a18b692
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Layers/TiledMapLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,14 @@ export var TiledMapLayer = L.TileLayer.extend({
},

getTileUrl: function (tilePoint) {
var zoom = this._getZoomForUrl();

return L.Util.template(this.tileUrl, L.extend({
s: this._getSubdomain(tilePoint),
z: (this._lodMap && this._lodMap[tilePoint.z]) ? this._lodMap[tilePoint.z] : tilePoint.z, // try lod map first, then just defualt to zoom level
x: tilePoint.x,
y: tilePoint.y
y: tilePoint.y,
// try lod map first, then just default to zoom level
z: (this._lodMap && this._lodMap[zoom]) ? this._lodMap[zoom] : zoom
}, this.options));
},

Expand All @@ -87,7 +90,7 @@ export var TiledMapLayer = L.TileLayer.extend({

// if there is no lod map or an lod map with a proper zoom load the tile
// otherwise wait for the lod map to become available
if (!this._lodMap || (this._lodMap && this._lodMap[coords.z])) {
if (!this._lodMap || (this._lodMap && this._lodMap[this._getZoomForUrl()])) {
tile.src = this.getTileUrl(coords);
} else {
this.once('lodmap', function () {
Expand Down

0 comments on commit a18b692

Please sign in to comment.