adjust zoom levels as well (otherwise markers seem mispositioned)
This commit is contained in:
parent
443181af07
commit
cc0fc0e5b7
@ -28,9 +28,15 @@ L.TileLayer = L.Class.extend({
|
||||
initialize: function (url, options) {
|
||||
L.Util.setOptions(this, options);
|
||||
|
||||
// detecting retina displays, adjusting tileSize
|
||||
if (this.options.detectRetina && window.devicePixelRatio > 1) {
|
||||
// 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--;
|
||||
}
|
||||
|
||||
this._url = url;
|
||||
|
Loading…
Reference in New Issue
Block a user