includes fixes provided by Max Ogden

This commit is contained in:
Mithgol the Webmaster 2012-04-08 05:10:32 +04:00
parent cc0fc0e5b7
commit a8fa869a41

View File

@ -29,14 +29,13 @@ L.TileLayer = L.Class.extend({
L.Util.setOptions(this, options);
// detecting retina displays, adjusting tileSize and zoom levels
if (this.options.detectRetina
&& window.devicePixelRatio > 1
&& options.maxZoom > 0
){
this.options.tileSize >>= 1;
options.zoomOffset++;
if (options.minZoom > 0) options.minZoom--;
options.maxZoom--;
if (this.options.detectRetina && window.devicePixelRatio > 1 && this.options.maxZoom > 0) {
this.options.tileSize = Math.floor(this.options.tileSize / 2);
this.options.zoomOffset++;
if (this.options.minZoom > 0) {
this.options.minZoom--;
}
this.options.maxZoom--;
}
this._url = url;