Skip to content

Commit

Permalink
Merge pull request #74 from 2SC1815J/release-0.2.x
Browse files Browse the repository at this point in the history
Fix negative value of _this.maxNativeZoom
  • Loading branch information
mejackreed authored Apr 30, 2019
2 parents a6128f6 + b7388bf commit fa09a0d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions leaflet-iiif.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,11 @@ L.TileLayer.Iiif = L.TileLayer.extend({
};

// Calculates maximum native zoom for the layer
_this.maxNativeZoom = Math.max(ceilLog2(_this.x / _this.options.tileSize),
ceilLog2(_this.y / _this.options.tileSize));
_this.maxNativeZoom = Math.max(
ceilLog2(_this.x / _this.options.tileSize),
ceilLog2(_this.y / _this.options.tileSize),
0
);

// Enable zooming further than native if maxZoom option supplied
if (_this._customMaxZoom && _this.options.maxZoom > _this.maxNativeZoom) {
Expand Down

0 comments on commit fa09a0d

Please sign in to comment.