Skip to content

Commit

Permalink
Workaround for use with Leaflet 0.7.7
Browse files Browse the repository at this point in the history
  • Loading branch information
2SC1815J committed Jul 16, 2019
1 parent e9c5d23 commit feca6d0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions leaflet-iiif.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ L.TileLayer.Iiif = L.TileLayer.extend({
// Set maxZoom for map
map._layersMaxZoom = _this.maxZoom;

// Call add TileLayer
L.TileLayer.prototype.onAdd.call(_this, map);

// Set minZoom and minNativeZoom based on how the imageSizes match up
var smallestImage = _this._imageSizes[0];
var mapSize = _this._map.getSize();
Expand All @@ -91,9 +94,6 @@ L.TileLayer.Iiif = L.TileLayer.extend({
_this._prev_map_layersMinZoom = _this._map._layersMinZoom;
_this._map._layersMinZoom = newMinZoom;

// Call add TileLayer
L.TileLayer.prototype.onAdd.call(_this, map);

if (_this.options.fitBounds) {
_this._fitBounds();
}
Expand Down Expand Up @@ -266,7 +266,6 @@ L.TileLayer.Iiif = L.TileLayer.extend({
return this._infoToBaseUrl() + '{region}/{size}/{rotation}/{quality}.{format}';
},
_isValidTile: function(coords) {
var tileBounds = this._tileCoordsToBounds(coords);
var _this = this;
var zoom = _this._getZoomForUrl();
var sizes = _this._tierSizes[zoom];
Expand All @@ -283,6 +282,9 @@ L.TileLayer.Iiif = L.TileLayer.extend({
return true;
}
},
_tileShouldBeLoaded: function(coords) {
return this._isValidTile(coords);
},
_getInitialZoom: function (mapSize) {
var _this = this;
var tolerance = 0.8;
Expand Down

0 comments on commit feca6d0

Please sign in to comment.