Skip to content

Commit

Permalink
v 2.0 for Leaflet 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
alfarisi committed Aug 24, 2017
1 parent 827dc79 commit 9b80364
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -2,5 +2,5 @@ Leaflet-DeepZoom
================
Display DeepZoom tiles with Leaflet, based on Leaflet.Zoomify

Leaflet-DeepZoom 2.0 for Leaflet 1.2
Leaflet-DeepZoom 2.0 for Leaflet 1.2 and
Leaflet-DeepZoom 1.0 for Leaflet 0.7
20 changes: 10 additions & 10 deletions leaflet-deepzoom.js
Expand Up @@ -21,23 +21,23 @@ L.TileLayer.DeepZoom = L.TileLayer.extend({
if (options.width < 0 || options.height < 0) {
throw new Error("The user must set the Width and Height of the image");
}

var imageSize = L.point(options.width, options.height),
tileSize = options.tileSize;

var imageSize = L.point(options.width, options.height),
tileSize = options.tileSize;

this._imageSize = [imageSize];
this._gridSize = [this._getGridSize(imageSize)];
this._imageSize = [imageSize];
this._gridSize = [this._getGridSize(imageSize)];

while (imageSize.x > 0 || imageSize.y > 0) {
imageSize = imageSize.divideBy(2).floor();
this._imageSize.push(imageSize);
this._gridSize.push(this._getGridSize(imageSize));
}
this._imageSize.push(imageSize);
this._gridSize.push(this._getGridSize(imageSize));
}

this._imageSize.reverse();
this._gridSize.reverse();

options.maxNativeZoom = this._gridSize.length - 1;
options.maxNativeZoom = this._gridSize.length - 1;

if (typeof options.maxZoom == 'undefined') {
options.maxZoom = options.maxNativeZoom;
Expand All @@ -56,7 +56,7 @@ L.TileLayer.DeepZoom = L.TileLayer.extend({

_addTile: function (coords, container) {
var tilePos = this._getTilePos(coords),
key = this._tileCoordsToKey(coords);
key = this._tileCoordsToKey(coords);

var tile = this.createTile(this._wrapCoords(coords), L.bind(this._tileReady, this, coords));

Expand Down

0 comments on commit 9b80364

Please sign in to comment.