mirror of
https://github.com/Esri/offline-editor-js.git
synced 2025-12-15 15:20:05 +00:00
Closes #256 - add getMinZoom getMaxZoom
This commit is contained in:
parent
03cfea6305
commit
153abce68b
@ -30,6 +30,9 @@ Methods | Returns | Description
|
||||
`loadFromFile(filename, callback)` | `callback( boolean, error)` | Reads a csv file into local tile cache.
|
||||
`estimateTileSize(callback)` | `callback(number)` | Retrieves one tile from a layer and then returns its size.
|
||||
`prepareForOffline(` `minLevel, maxLevel, extent, ` `reportProgress)` | `callback(number)` | Retrieves tiles and stores them in the local cache. See the "How To Use" section below to learn more about customizing the use of this method.
|
||||
`getMinZoom(callback)` | `callback(number)` | Returns the minimum zoom level of the layer. This is the zoom level farther away from the earth.
|
||||
`getMaxZoom(callback)` | `callback(number)` | Returns the maximum zoom level of the layer. This is the zoom level closest to the earth.
|
||||
|
||||
|
||||
###Properties
|
||||
Property | Description
|
||||
|
||||
@ -190,17 +190,7 @@ define([
|
||||
getMaxZoom: function(callback){
|
||||
|
||||
if(this._maxZoom == null){
|
||||
var lods = this.tileInfo.lods;
|
||||
var length = this.tileInfo.lods.length;
|
||||
var tempArr = [];
|
||||
for(var i=0; i < length; i++){
|
||||
tempArr.push(lods[i].level);
|
||||
if(i == length -1){
|
||||
tempArr.sortNumber();
|
||||
this._maxZoom = tempArr[i];
|
||||
callback(tempArr[i]);
|
||||
}
|
||||
}
|
||||
this._maxZoom = this.tileInfo.lods[0].level;
|
||||
}
|
||||
else{
|
||||
callback(this._maxZoom);
|
||||
@ -215,17 +205,7 @@ define([
|
||||
getMinZoom: function(callback){
|
||||
|
||||
if(this._minZoom == null){
|
||||
var lods = this.tileInfo.lods;
|
||||
var length = this.tileInfo.lods.length;
|
||||
var tempArr = [];
|
||||
for(var i=0; i < length; i++){
|
||||
tempArr.push(lods[i].level);
|
||||
if(i == length -1){
|
||||
tempArr.sortNumber();
|
||||
this._minZoom = tempArr[0];
|
||||
callback(tempArr[0]);
|
||||
}
|
||||
}
|
||||
this._minZoom = this.tileInfo.lods[basemapLayer.tileInfo.lods.length-1].level;
|
||||
}
|
||||
else{
|
||||
callback(this._minZoom);
|
||||
|
||||
@ -239,6 +239,35 @@ define([
|
||||
layer._tilesCore._loadFromFile(file,this.offline.store,callback);
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the maximum zoom level for this layer
|
||||
* @param callback number
|
||||
*/
|
||||
layer.getMaxZoom = function(callback){
|
||||
|
||||
if(this._maxZoom == null){
|
||||
this._maxZoom = layer.tileInfo.lods[0].level;
|
||||
}
|
||||
else{
|
||||
callback(this._maxZoom);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the minimum zoom level for this layer
|
||||
* @param callback number
|
||||
*/
|
||||
layer.getMinZoom = function(callback){
|
||||
|
||||
if(this._minZoom == null){
|
||||
this._minZoom = layer.tileInfo.lods[basemapLayer.tileInfo.lods.length-1].level;
|
||||
}
|
||||
else{
|
||||
callback(this._minZoom);
|
||||
}
|
||||
},
|
||||
|
||||
/* internal methods */
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user