mirror of
https://github.com/Esri/offline-editor-js.git
synced 2025-12-15 15:20:05 +00:00
v2.9.4
This commit is contained in:
parent
96ea123585
commit
8cfc83a4b8
2
dist/offline-edit-min.js
vendored
2
dist/offline-edit-min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/offline-edit-src.js
vendored
2
dist/offline-edit-src.js
vendored
@ -1,4 +1,4 @@
|
|||||||
/*! offline-editor-js - v2.9.3 - 2015-07-01
|
/*! offline-editor-js - v2.9.4 - 2015-07-10
|
||||||
* Copyright (c) 2015 Environmental Systems Research Institute, Inc.
|
* Copyright (c) 2015 Environmental Systems Research Institute, Inc.
|
||||||
* Apache License*/
|
* Apache License*/
|
||||||
/*jshint -W030 */
|
/*jshint -W030 */
|
||||||
|
|||||||
6
dist/offline-tiles-advanced-min.js
vendored
6
dist/offline-tiles-advanced-min.js
vendored
File diff suppressed because one or more lines are too long
57
dist/offline-tiles-advanced-src.js
vendored
57
dist/offline-tiles-advanced-src.js
vendored
@ -1,4 +1,4 @@
|
|||||||
/*! offline-editor-js - v2.9.3 - 2015-07-01
|
/*! offline-editor-js - v2.9.4 - 2015-07-10
|
||||||
* Copyright (c) 2015 Environmental Systems Research Institute, Inc.
|
* Copyright (c) 2015 Environmental Systems Research Institute, Inc.
|
||||||
* Apache License*/
|
* Apache License*/
|
||||||
define([
|
define([
|
||||||
@ -34,7 +34,7 @@ define([
|
|||||||
this._tilesCore = new O.esri.Tiles.TilesCore();
|
this._tilesCore = new O.esri.Tiles.TilesCore();
|
||||||
|
|
||||||
//For calculating minZoom and maxZoom
|
//For calculating minZoom and maxZoom
|
||||||
Array.prototype.sortNumber = function(){return this.sort(function(a,b){return a - b})};
|
Array.prototype.sortNumber = function(){return this.sort(function(a,b){return a - b;});};
|
||||||
|
|
||||||
this._self = this;
|
this._self = this;
|
||||||
this._lastTileUrl = "";
|
this._lastTileUrl = "";
|
||||||
@ -48,7 +48,7 @@ define([
|
|||||||
|
|
||||||
var isOnline = true;
|
var isOnline = true;
|
||||||
if(typeof state != "undefined" || state != null){
|
if(typeof state != "undefined" || state != null){
|
||||||
isOnline = state; console.log("STATE IS: " + state)
|
isOnline = state; console.log("STATE IS: " + state);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -71,15 +71,15 @@ define([
|
|||||||
|
|
||||||
// Store the layerInfo locally so we have it when browser restarts or is reloaded.
|
// Store the layerInfo locally so we have it when browser restarts or is reloaded.
|
||||||
// We need this info in order to properly rebuild the layer.
|
// We need this info in order to properly rebuild the layer.
|
||||||
if(localStorage.__offlineTileInfo == undefined && result != false){
|
if(localStorage.__offlineTileInfo === undefined && result !== false){
|
||||||
localStorage.__offlineTileInfo = result;
|
localStorage.__offlineTileInfo = result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If library is offline then attempt to get layerInfo from localStorage.
|
// If library is offline then attempt to get layerInfo from localStorage.
|
||||||
if(this.offline.online == false && result == false && localStorage.__offlineTileInfo != undefined){
|
if(this.offline.online === false && result === false && localStorage.__offlineTileInfo !== undefined){
|
||||||
result = localStorage.__offlineTileInfo;
|
result = localStorage.__offlineTileInfo;
|
||||||
}
|
}
|
||||||
else if(this.offline.online == false && result == false && localStorage.__offlineTileInfo == undefined){
|
else if(this.offline.online === false && result === false && localStorage.__offlineTileInfo === undefined){
|
||||||
alert("There was a problem retrieving tiled map info in OfflineTilesEnablerLayer.");
|
alert("There was a problem retrieving tiled map info in OfflineTilesEnablerLayer.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ define([
|
|||||||
this.onLoad(this);
|
this.onLoad(this);
|
||||||
callback(true);
|
callback(true);
|
||||||
}.bind(this._self));
|
}.bind(this._self));
|
||||||
}.bind(this._self))
|
}.bind(this._self));
|
||||||
}
|
}
|
||||||
}.bind(this._self));
|
}.bind(this._self));
|
||||||
}
|
}
|
||||||
@ -125,7 +125,7 @@ define([
|
|||||||
this._level = level;
|
this._level = level;
|
||||||
|
|
||||||
var url = this.url + "/tile/" + level + "/" + row + "/" + col;
|
var url = this.url + "/tile/" + level + "/" + row + "/" + col;
|
||||||
console.log("LIBRARY ONLINE " + this.offline.online)
|
console.log("LIBRARY ONLINE " + this.offline.online);
|
||||||
if( this.offline.online )
|
if( this.offline.online )
|
||||||
{
|
{
|
||||||
console.log("fetching url online: ", url);
|
console.log("fetching url online: ", url);
|
||||||
@ -418,7 +418,7 @@ define([
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_isLocalStorage: function(){
|
_isLocalStorage: function(){
|
||||||
var test = 'test';
|
var test = "test";
|
||||||
try {
|
try {
|
||||||
localStorage.setItem(test, test);
|
localStorage.setItem(test, test);
|
||||||
localStorage.removeItem(test);
|
localStorage.removeItem(test);
|
||||||
@ -435,8 +435,8 @@ define([
|
|||||||
*/
|
*/
|
||||||
_getTileInfoPrivate: function(url, callback){
|
_getTileInfoPrivate: function(url, callback){
|
||||||
var req = new XMLHttpRequest();
|
var req = new XMLHttpRequest();
|
||||||
var url = this.offline.proxyPath != null? this.offline.proxyPath + "?" + url + "?f=pjson" : url + "?f=pjson";
|
var finalUrl = this.offline.proxyPath != null? this.offline.proxyPath + "?" + url + "?f=pjson" : url + "?f=pjson";
|
||||||
req.open("GET", url, true);
|
req.open("GET", finalUrl, true);
|
||||||
req.onload = function()
|
req.onload = function()
|
||||||
{
|
{
|
||||||
if( req.status === 200 && req.responseText !== "")
|
if( req.status === 200 && req.responseText !== "")
|
||||||
@ -463,16 +463,17 @@ define([
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if(typeof O != "undefined"){
|
if(typeof O != "undefined"){
|
||||||
O.esri.Tiles = {}
|
O.esri.Tiles = {};
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
O = {};
|
O = {}; // jshint ignore:line
|
||||||
O.esri = {
|
O.esri = {
|
||||||
Tiles: {}
|
Tiles: {}
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
"use strict";
|
//"use strict";
|
||||||
|
/*jslint bitwise: true */
|
||||||
|
|
||||||
O.esri.Tiles.Base64Utils={};
|
O.esri.Tiles.Base64Utils={};
|
||||||
O.esri.Tiles.Base64Utils.outputTypes={
|
O.esri.Tiles.Base64Utils.outputTypes={
|
||||||
@ -553,7 +554,7 @@ O.esri.Tiles.Base64Utils.wordToBase64=function(/* word[] */wa){
|
|||||||
return s.join(""); // string
|
return s.join(""); // string
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*jslint bitwise: false */
|
||||||
/* FileSaver.js
|
/* FileSaver.js
|
||||||
* A saveAs() FileSaver implementation.
|
* A saveAs() FileSaver implementation.
|
||||||
* 2013-10-21
|
* 2013-10-21
|
||||||
@ -809,7 +810,7 @@ O.esri.Tiles.TilesCore = function(){
|
|||||||
*/
|
*/
|
||||||
this._getTiles = function(image,imageType,url,tileid,store,query){
|
this._getTiles = function(image,imageType,url,tileid,store,query){
|
||||||
store.retrieve(url, function(success, offlineTile)
|
store.retrieve(url, function(success, offlineTile)
|
||||||
{ console.log("TILE RETURN " + success + ", " + offlineTile.url)
|
{ console.log("TILE RETURN " + success + ", " + offlineTile.url);
|
||||||
/* when the .getTileUrl() callback is triggered we replace the temporary URL originally returned by the data:image url */
|
/* when the .getTileUrl() callback is triggered we replace the temporary URL originally returned by the data:image url */
|
||||||
// search for the img with src="void:"+level+"-"+row+"-"+col and replace with actual url
|
// search for the img with src="void:"+level+"-"+row+"-"+col and replace with actual url
|
||||||
image = query("img[src="+tileid+"]")[0];
|
image = query("img[src="+tileid+"]")[0];
|
||||||
@ -908,7 +909,7 @@ O.esri.Tiles.TilesCore = function(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
callback(cells);
|
callback(cells);
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves locally stored tiles to a csv
|
* Saves locally stored tiles to a csv
|
||||||
@ -1059,7 +1060,7 @@ O.esri.Tiles.TilesCore = function(){
|
|||||||
var tilingScheme = new O.esri.Tiles.TilingScheme(context);
|
var tilingScheme = new O.esri.Tiles.TilingScheme(context);
|
||||||
store.getAllTiles(function(url,img,err)
|
store.getAllTiles(function(url,img,err)
|
||||||
{
|
{
|
||||||
if(url && url.indexOf(layerUrl) == 0)
|
if(url && url.indexOf(layerUrl) === 0)
|
||||||
{
|
{
|
||||||
if(url.indexOf("_alllayers") != -1)
|
if(url.indexOf("_alllayers") != -1)
|
||||||
{
|
{
|
||||||
@ -1112,14 +1113,16 @@ O.esri.Tiles.TilesCore = function(){
|
|||||||
|
|
||||||
var lods = [];
|
var lods = [];
|
||||||
|
|
||||||
var lodsObj = JSON.parse(data,function(key,value){
|
JSON.parse(data,function(key,value){
|
||||||
if(((typeof key == 'number') || (key % 1 == 0)) && (typeof value === "object")){
|
if(((typeof key == "number") || (key % 1 === 0)) && (typeof value === "object")){
|
||||||
var l = new LOD();
|
var l = new LOD();
|
||||||
l.level = value.level;
|
l.level = value.level;
|
||||||
l.resolution = value.resolution;
|
l.resolution = value.resolution;
|
||||||
l.scale = value.scale;
|
l.scale = value.scale;
|
||||||
|
|
||||||
if(value.hasOwnProperty("level")) lods.push(l);
|
if(value.hasOwnProperty("level")) {
|
||||||
|
lods.push(l);
|
||||||
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -1144,13 +1147,13 @@ O.esri.Tiles.TilesCore = function(){
|
|||||||
);
|
);
|
||||||
|
|
||||||
var tileInfo = new TileInfo(resultObj.tileInfo);
|
var tileInfo = new TileInfo(resultObj.tileInfo);
|
||||||
var origin = new Point(tileInfo.origin.x,tileInfo.origin.y,spatialRef)
|
var origin = new Point(tileInfo.origin.x,tileInfo.origin.y,spatialRef);
|
||||||
tileInfo.origin = origin;
|
tileInfo.origin = origin;
|
||||||
tileInfo.lods = lods;
|
tileInfo.lods = lods;
|
||||||
|
|
||||||
callback({initExtent:initialExtent,fullExtent:fullExtent,tileInfo:tileInfo,resultObj:resultObj});
|
callback({initExtent:initialExtent,fullExtent:fullExtent,tileInfo:tileInfo,resultObj:resultObj});
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -1236,7 +1239,7 @@ O.esri.Tiles.TilesStore = function(){
|
|||||||
request.onsuccess = function(event)
|
request.onsuccess = function(event)
|
||||||
{
|
{
|
||||||
var result = event.target.result;
|
var result = event.target.result;
|
||||||
if(result == undefined)
|
if(result === undefined)
|
||||||
{
|
{
|
||||||
callback(false,"not found");
|
callback(false,"not found");
|
||||||
}
|
}
|
||||||
@ -1443,7 +1446,7 @@ O.esri.Tiles.TilingScheme.prototype = {
|
|||||||
|
|
||||||
require(["esri/geometry/Polygon"],function(Polygon){
|
require(["esri/geometry/Polygon"],function(Polygon){
|
||||||
polygon = new Polygon(spatialReference);
|
polygon = new Polygon(spatialReference);
|
||||||
})
|
});
|
||||||
|
|
||||||
polygon.addRing([
|
polygon.addRing([
|
||||||
[x1, y1], // clockwise
|
[x1, y1], // clockwise
|
||||||
|
|||||||
6
dist/offline-tiles-basic-min.js
vendored
6
dist/offline-tiles-basic-min.js
vendored
File diff suppressed because one or more lines are too long
49
dist/offline-tiles-basic-src.js
vendored
49
dist/offline-tiles-basic-src.js
vendored
@ -1,4 +1,4 @@
|
|||||||
/*! offline-editor-js - v2.9.3 - 2015-07-01
|
/*! offline-editor-js - v2.9.4 - 2015-07-10
|
||||||
* Copyright (c) 2015 Environmental Systems Research Institute, Inc.
|
* Copyright (c) 2015 Environmental Systems Research Institute, Inc.
|
||||||
* Apache License*/
|
* Apache License*/
|
||||||
define([
|
define([
|
||||||
@ -48,7 +48,7 @@ define([
|
|||||||
|
|
||||||
var isOnline = true;
|
var isOnline = true;
|
||||||
if(typeof state != "undefined"){
|
if(typeof state != "undefined"){
|
||||||
isOnline = state; console.log("STATE IS: " + state)
|
isOnline = state; console.log("STATE IS: " + state);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -88,10 +88,12 @@ define([
|
|||||||
|
|
||||||
console.log("looking for tile",level,row,col);
|
console.log("looking for tile",level,row,col);
|
||||||
var url = this._getTileUrl(level,row,col);
|
var url = this._getTileUrl(level,row,col);
|
||||||
console.log("LIBRARY ONLINE " + this.offline.online)
|
console.log("LIBRARY ONLINE " + this.offline.online);
|
||||||
if( this.offline.online )
|
if( this.offline.online )
|
||||||
{
|
{
|
||||||
if(layer._imageType == "")layer._imageType = this.tileInfo.format.toLowerCase();
|
if(layer._imageType === "") {
|
||||||
|
layer._imageType = this.tileInfo.format.toLowerCase();
|
||||||
|
}
|
||||||
console.log("fetching url online: ", url);
|
console.log("fetching url online: ", url);
|
||||||
layer._lastTileUrl = url;
|
layer._lastTileUrl = url;
|
||||||
return url;
|
return url;
|
||||||
@ -109,7 +111,7 @@ define([
|
|||||||
return tileid;
|
return tileid;
|
||||||
};
|
};
|
||||||
|
|
||||||
callback && callback(true);
|
callback && callback(true); // jshint ignore:line
|
||||||
}
|
}
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
}
|
}
|
||||||
@ -254,7 +256,7 @@ define([
|
|||||||
this._maxZoom = layer.tileInfo.lods[layer.tileInfo.lods.length-1].level;
|
this._maxZoom = layer.tileInfo.lods[layer.tileInfo.lods.length-1].level;
|
||||||
}
|
}
|
||||||
callback(this._maxZoom);
|
callback(this._maxZoom);
|
||||||
},
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the minimum zoom level for this layer
|
* Returns the minimum zoom level for this layer
|
||||||
@ -377,16 +379,17 @@ define([
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if(typeof O != "undefined"){
|
if(typeof O != "undefined"){
|
||||||
O.esri.Tiles = {}
|
O.esri.Tiles = {};
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
O = {};
|
O = {}; // jshint ignore:line
|
||||||
O.esri = {
|
O.esri = {
|
||||||
Tiles: {}
|
Tiles: {}
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
"use strict";
|
//"use strict";
|
||||||
|
/*jslint bitwise: true */
|
||||||
|
|
||||||
O.esri.Tiles.Base64Utils={};
|
O.esri.Tiles.Base64Utils={};
|
||||||
O.esri.Tiles.Base64Utils.outputTypes={
|
O.esri.Tiles.Base64Utils.outputTypes={
|
||||||
@ -467,7 +470,7 @@ O.esri.Tiles.Base64Utils.wordToBase64=function(/* word[] */wa){
|
|||||||
return s.join(""); // string
|
return s.join(""); // string
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*jslint bitwise: false */
|
||||||
/* FileSaver.js
|
/* FileSaver.js
|
||||||
* A saveAs() FileSaver implementation.
|
* A saveAs() FileSaver implementation.
|
||||||
* 2013-10-21
|
* 2013-10-21
|
||||||
@ -723,7 +726,7 @@ O.esri.Tiles.TilesCore = function(){
|
|||||||
*/
|
*/
|
||||||
this._getTiles = function(image,imageType,url,tileid,store,query){
|
this._getTiles = function(image,imageType,url,tileid,store,query){
|
||||||
store.retrieve(url, function(success, offlineTile)
|
store.retrieve(url, function(success, offlineTile)
|
||||||
{ console.log("TILE RETURN " + success + ", " + offlineTile.url)
|
{ console.log("TILE RETURN " + success + ", " + offlineTile.url);
|
||||||
/* when the .getTileUrl() callback is triggered we replace the temporary URL originally returned by the data:image url */
|
/* when the .getTileUrl() callback is triggered we replace the temporary URL originally returned by the data:image url */
|
||||||
// search for the img with src="void:"+level+"-"+row+"-"+col and replace with actual url
|
// search for the img with src="void:"+level+"-"+row+"-"+col and replace with actual url
|
||||||
image = query("img[src="+tileid+"]")[0];
|
image = query("img[src="+tileid+"]")[0];
|
||||||
@ -822,7 +825,7 @@ O.esri.Tiles.TilesCore = function(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
callback(cells);
|
callback(cells);
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves locally stored tiles to a csv
|
* Saves locally stored tiles to a csv
|
||||||
@ -973,7 +976,7 @@ O.esri.Tiles.TilesCore = function(){
|
|||||||
var tilingScheme = new O.esri.Tiles.TilingScheme(context);
|
var tilingScheme = new O.esri.Tiles.TilingScheme(context);
|
||||||
store.getAllTiles(function(url,img,err)
|
store.getAllTiles(function(url,img,err)
|
||||||
{
|
{
|
||||||
if(url && url.indexOf(layerUrl) == 0)
|
if(url && url.indexOf(layerUrl) === 0)
|
||||||
{
|
{
|
||||||
if(url.indexOf("_alllayers") != -1)
|
if(url.indexOf("_alllayers") != -1)
|
||||||
{
|
{
|
||||||
@ -1026,14 +1029,16 @@ O.esri.Tiles.TilesCore = function(){
|
|||||||
|
|
||||||
var lods = [];
|
var lods = [];
|
||||||
|
|
||||||
var lodsObj = JSON.parse(data,function(key,value){
|
JSON.parse(data,function(key,value){
|
||||||
if(((typeof key == 'number') || (key % 1 == 0)) && (typeof value === "object")){
|
if(((typeof key == "number") || (key % 1 === 0)) && (typeof value === "object")){
|
||||||
var l = new LOD();
|
var l = new LOD();
|
||||||
l.level = value.level;
|
l.level = value.level;
|
||||||
l.resolution = value.resolution;
|
l.resolution = value.resolution;
|
||||||
l.scale = value.scale;
|
l.scale = value.scale;
|
||||||
|
|
||||||
if(value.hasOwnProperty("level")) lods.push(l);
|
if(value.hasOwnProperty("level")) {
|
||||||
|
lods.push(l);
|
||||||
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -1058,13 +1063,13 @@ O.esri.Tiles.TilesCore = function(){
|
|||||||
);
|
);
|
||||||
|
|
||||||
var tileInfo = new TileInfo(resultObj.tileInfo);
|
var tileInfo = new TileInfo(resultObj.tileInfo);
|
||||||
var origin = new Point(tileInfo.origin.x,tileInfo.origin.y,spatialRef)
|
var origin = new Point(tileInfo.origin.x,tileInfo.origin.y,spatialRef);
|
||||||
tileInfo.origin = origin;
|
tileInfo.origin = origin;
|
||||||
tileInfo.lods = lods;
|
tileInfo.lods = lods;
|
||||||
|
|
||||||
callback({initExtent:initialExtent,fullExtent:fullExtent,tileInfo:tileInfo,resultObj:resultObj});
|
callback({initExtent:initialExtent,fullExtent:fullExtent,tileInfo:tileInfo,resultObj:resultObj});
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -1150,7 +1155,7 @@ O.esri.Tiles.TilesStore = function(){
|
|||||||
request.onsuccess = function(event)
|
request.onsuccess = function(event)
|
||||||
{
|
{
|
||||||
var result = event.target.result;
|
var result = event.target.result;
|
||||||
if(result == undefined)
|
if(result === undefined)
|
||||||
{
|
{
|
||||||
callback(false,"not found");
|
callback(false,"not found");
|
||||||
}
|
}
|
||||||
@ -1357,7 +1362,7 @@ O.esri.Tiles.TilingScheme.prototype = {
|
|||||||
|
|
||||||
require(["esri/geometry/Polygon"],function(Polygon){
|
require(["esri/geometry/Polygon"],function(Polygon){
|
||||||
polygon = new Polygon(spatialReference);
|
polygon = new Polygon(spatialReference);
|
||||||
})
|
});
|
||||||
|
|
||||||
polygon.addRing([
|
polygon.addRing([
|
||||||
[x1, y1], // clockwise
|
[x1, y1], // clockwise
|
||||||
|
|||||||
6
dist/offline-tpk-min.js
vendored
6
dist/offline-tpk-min.js
vendored
File diff suppressed because one or more lines are too long
177
dist/offline-tpk-src.js
vendored
177
dist/offline-tpk-src.js
vendored
@ -1,4 +1,4 @@
|
|||||||
/*! offline-editor-js - v2.9.3 - 2015-07-01
|
/*! offline-editor-js - v2.9.4 - 2015-07-10
|
||||||
* Copyright (c) 2015 Environmental Systems Research Institute, Inc.
|
* Copyright (c) 2015 Environmental Systems Research Institute, Inc.
|
||||||
* Apache License*/
|
* Apache License*/
|
||||||
/**
|
/**
|
||||||
@ -27,7 +27,7 @@ define([
|
|||||||
MAX_DB_SIZE: 75, // Recommended maximum size in MBs
|
MAX_DB_SIZE: 75, // Recommended maximum size in MBs
|
||||||
TILE_PATH:"", // The absolute path to the root of bundle/bundleX files e.g. V101/YOSEMITE_MAP/
|
TILE_PATH:"", // The absolute path to the root of bundle/bundleX files e.g. V101/YOSEMITE_MAP/
|
||||||
RECENTER_DELAY: 350, // Millisecond delay before attempting to recent map after an orientation change
|
RECENTER_DELAY: 350, // Millisecond delay before attempting to recent map after an orientation change
|
||||||
PARSING_ERROR: 'parsingError', // An error was encountered while parsing a TPK file.
|
PARSING_ERROR: "parsingError", // An error was encountered while parsing a TPK file.
|
||||||
DB_INIT_ERROR: "dbInitError", // An error occurred while initializing the database.
|
DB_INIT_ERROR: "dbInitError", // An error occurred while initializing the database.
|
||||||
DB_FULL_ERROR: "dbFullError", // No space left in the database.
|
DB_FULL_ERROR: "dbFullError", // No space left in the database.
|
||||||
NO_SUPPORT_ERROR: "libNotSupportedError", // Error indicating this library is not supported in a particular browser.
|
NO_SUPPORT_ERROR: "libNotSupportedError", // Error indicating this library is not supported in a particular browser.
|
||||||
@ -98,7 +98,9 @@ define([
|
|||||||
/* temporary URL returned immediately, as we haven't retrieved the image from the indexeddb yet */
|
/* temporary URL returned immediately, as we haven't retrieved the image from the indexeddb yet */
|
||||||
var tileid = "void:/" + level + "/" + row + "/" + col;
|
var tileid = "void:/" + level + "/" + row + "/" + col;
|
||||||
|
|
||||||
if(this.map == null) this.map = this.getMap();
|
if(this.map == null) {
|
||||||
|
this.map = this.getMap();
|
||||||
|
}
|
||||||
if(this._autoCenter == null) {
|
if(this._autoCenter == null) {
|
||||||
this._autoCenter = new O.esri.TPK.autoCenterMap(this.map,this.RECENTER_DELAY);
|
this._autoCenter = new O.esri.TPK.autoCenterMap(this.map,this.RECENTER_DELAY);
|
||||||
this._autoCenter.init();
|
this._autoCenter.init();
|
||||||
@ -106,7 +108,9 @@ define([
|
|||||||
|
|
||||||
this._getInMemTiles(url,layersDir, level, row, col,tileid,function (result,tileid,url) {
|
this._getInMemTiles(url,layersDir, level, row, col,tileid,function (result,tileid,url) {
|
||||||
var img = query("img[src=" + tileid + "]")[0];
|
var img = query("img[src=" + tileid + "]")[0];
|
||||||
if (typeof img == "undefined")img = new Image(); //create a blank place holder for undefined images
|
if (typeof img == "undefined") {
|
||||||
|
img = new Image();
|
||||||
|
} //create a blank place holder for undefined images
|
||||||
var imgURL;
|
var imgURL;
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
@ -147,7 +151,7 @@ define([
|
|||||||
this.emit(this.PROGRESS_EVENT,this.PROGRESS_END);
|
this.emit(this.PROGRESS_EVENT,this.PROGRESS_END);
|
||||||
return "";
|
return "";
|
||||||
/* this result goes nowhere, seriously */
|
/* this result goes nowhere, seriously */
|
||||||
}.bind(this._self))
|
}.bind(this._self));
|
||||||
|
|
||||||
return tileid;
|
return tileid;
|
||||||
}
|
}
|
||||||
@ -177,7 +181,7 @@ define([
|
|||||||
getDBSize: function(callback){
|
getDBSize: function(callback){
|
||||||
this.store.usedSpace(function(size,err){
|
this.store.usedSpace(function(size,err){
|
||||||
callback(size,err);
|
callback(size,err);
|
||||||
}.bind(this))
|
}.bind(this));
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -245,7 +249,7 @@ define([
|
|||||||
if( /*false &&*/ this.store.isSupported() )
|
if( /*false &&*/ this.store.isSupported() )
|
||||||
{
|
{
|
||||||
this.store.init(function(result){
|
this.store.init(function(result){
|
||||||
if(result == false){
|
if(result === false){
|
||||||
console.log("There was an error initializing the TPKLayer database");
|
console.log("There was an error initializing the TPKLayer database");
|
||||||
this.emit(this.DATABASE_ERROR_EVENT,{msg:this.DB_INIT_ERROR, err: null});
|
this.emit(this.DATABASE_ERROR_EVENT,{msg:this.DB_INIT_ERROR, err: null});
|
||||||
}
|
}
|
||||||
@ -256,10 +260,10 @@ define([
|
|||||||
console.log("Database is full!");
|
console.log("Database is full!");
|
||||||
this.emit(this.DATABASE_ERROR_EVENT,{msg:this.DB_FULL_ERROR,err : err});
|
this.emit(this.DATABASE_ERROR_EVENT,{msg:this.DB_FULL_ERROR,err : err});
|
||||||
}
|
}
|
||||||
this.emit(this.VALIDATION_EVENT,{msg:this.DB_VALIDATED,err : null})
|
this.emit(this.VALIDATION_EVENT,{msg:this.DB_VALIDATED,err : null});
|
||||||
console.log("DB size: " + mb + " MBs, Tile count: " + size.tileCount + ", Error: " + err);
|
console.log("DB size: " + mb + " MBs, Tile count: " + size.tileCount + ", Error: " + err);
|
||||||
this._isDBValid = true;
|
this._isDBValid = true;
|
||||||
}.bind(this))
|
}.bind(this));
|
||||||
}
|
}
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
}
|
}
|
||||||
@ -293,7 +297,9 @@ define([
|
|||||||
this.TILE_PATH = name.slice(0,index);
|
this.TILE_PATH = name.slice(0,index);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(files[i].compressedSize == 0) this._zeroLengthFileCounter++;
|
if(files[i].compressedSize === 0) {
|
||||||
|
this._zeroLengthFileCounter++;
|
||||||
|
}
|
||||||
|
|
||||||
var indexCDI = name.indexOf("CONF.CDI",0);
|
var indexCDI = name.indexOf("CONF.CDI",0);
|
||||||
var indexXML = name.indexOf("CONF.XML",0);
|
var indexXML = name.indexOf("CONF.XML",0);
|
||||||
@ -301,7 +307,7 @@ define([
|
|||||||
var indexBUNDLX = name.indexOf("BUNDLX",0);
|
var indexBUNDLX = name.indexOf("BUNDLX",0);
|
||||||
|
|
||||||
if(indexCDI != -1 || indexXML != -1){
|
if(indexCDI != -1 || indexXML != -1){
|
||||||
this._unzipConfFiles(files,i,deferred,function(/* deferred */ d, /* token */ t){ console.log("CONF FILE")
|
this._unzipConfFiles(files,i,deferred,function(/* deferred */ d, /* token */ t){ console.log("CONF FILE");
|
||||||
d.resolve(t);
|
d.resolve(t);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -318,7 +324,7 @@ define([
|
|||||||
|
|
||||||
all(promises).then( function(results)
|
all(promises).then( function(results)
|
||||||
{
|
{
|
||||||
callback && callback(results);
|
callback && callback(results); // jshint ignore:line
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -333,7 +339,9 @@ define([
|
|||||||
ObjectSize: function(obj) {
|
ObjectSize: function(obj) {
|
||||||
var size = 0, key;
|
var size = 0, key;
|
||||||
for (key in obj) {
|
for (key in obj) {
|
||||||
if (obj.hasOwnProperty(key)) size++;
|
if (obj.hasOwnProperty(key)) {
|
||||||
|
size++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return size;
|
return size;
|
||||||
},
|
},
|
||||||
@ -367,15 +375,15 @@ define([
|
|||||||
_unzipTileFiles: function(files,token,deferred,callback){
|
_unzipTileFiles: function(files,token,deferred,callback){
|
||||||
var that = this;
|
var that = this;
|
||||||
files[token].getData(new O.esri.zip.BlobWriter(token),function(data){
|
files[token].getData(new O.esri.zip.BlobWriter(token),function(data){
|
||||||
if(data.size != 0){
|
if(data.size !== 0){
|
||||||
var reader = new FileReader();
|
var reader = new FileReader();
|
||||||
reader.token = data.token;
|
reader.token = data.token;
|
||||||
reader.onerror = function (event) {
|
reader.onerror = function (event) {
|
||||||
console.error("_unzipTileFiles Error: " + event.target.error.message);
|
console.error("_unzipTileFiles Error: " + event.target.error.message);
|
||||||
that.emit(that.PARSING_ERROR, {msg: "Error parsing file: ", err: event.target.error});
|
that.emit(that.PARSING_ERROR, {msg: "Error parsing file: ", err: event.target.error});
|
||||||
}
|
};
|
||||||
reader.onloadend = function(evt) {
|
reader.onloadend = function(evt) {
|
||||||
if(reader.token != undefined){
|
if(reader.token !== undefined){
|
||||||
that._inMemTilesIndex.push("blank");
|
that._inMemTilesIndex.push("blank");
|
||||||
var name = files[reader.token].filename.toLocaleUpperCase();
|
var name = files[reader.token].filename.toLocaleUpperCase();
|
||||||
that._inMemTilesObject[name]= reader.result;
|
that._inMemTilesObject[name]= reader.result;
|
||||||
@ -436,10 +444,10 @@ define([
|
|||||||
tileInfo.origin = {
|
tileInfo.origin = {
|
||||||
x: parseInt(cacheInfo.TileCacheInfo.TileOrigin.X),
|
x: parseInt(cacheInfo.TileCacheInfo.TileOrigin.X),
|
||||||
y: parseInt(cacheInfo.TileCacheInfo.TileOrigin.Y)
|
y: parseInt(cacheInfo.TileCacheInfo.TileOrigin.Y)
|
||||||
}
|
};
|
||||||
tileInfo.spatialReference = {
|
tileInfo.spatialReference = {
|
||||||
"wkid": parseInt(cacheInfo.TileCacheInfo.SpatialReference.WKID)
|
"wkid": parseInt(cacheInfo.TileCacheInfo.SpatialReference.WKID)
|
||||||
}
|
};
|
||||||
|
|
||||||
var lods = cacheInfo.TileCacheInfo.LODInfos.LODInfo;
|
var lods = cacheInfo.TileCacheInfo.LODInfos.LODInfo;
|
||||||
var finalLods = [];
|
var finalLods = [];
|
||||||
@ -447,7 +455,7 @@ define([
|
|||||||
finalLods.push({
|
finalLods.push({
|
||||||
"level": parseFloat(lods[i].LevelID),
|
"level": parseFloat(lods[i].LevelID),
|
||||||
"resolution": parseFloat(lods[i].Resolution),
|
"resolution": parseFloat(lods[i].Resolution),
|
||||||
"scale": parseFloat(lods[i].Scale)})
|
"scale": parseFloat(lods[i].Scale)});
|
||||||
}
|
}
|
||||||
|
|
||||||
tileInfo.lods = finalLods;
|
tileInfo.lods = finalLods;
|
||||||
@ -475,11 +483,11 @@ define([
|
|||||||
this.store.retrieve(url, function(success, offlineTile){
|
this.store.retrieve(url, function(success, offlineTile){
|
||||||
if( success )
|
if( success )
|
||||||
{
|
{
|
||||||
console.log("Tile found in storage: " + url)
|
console.log("Tile found in storage: " + url);
|
||||||
callback(offlineTile.img,tileId,url);
|
callback(offlineTile.img,tileId,url);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
console.log("Tile is not in storage: " + url)
|
console.log("Tile is not in storage: " + url);
|
||||||
var snappedRow = Math.floor(row / 128) * 128;
|
var snappedRow = Math.floor(row / 128) * 128;
|
||||||
var snappedCol = Math.floor(col / 128) * 128;
|
var snappedCol = Math.floor(col / 128) * 128;
|
||||||
|
|
||||||
@ -490,17 +498,19 @@ define([
|
|||||||
var bufferI = this._inMemTilesObject[bundleIndex];
|
var bufferI = this._inMemTilesObject[bundleIndex];
|
||||||
var bufferX = this._inMemTilesObject[path + ".BUNDLX"];
|
var bufferX = this._inMemTilesObject[path + ".BUNDLX"];
|
||||||
|
|
||||||
if(bufferI != undefined || bufferX != undefined) {
|
if(bufferI !== undefined || bufferX !== undefined) {
|
||||||
offset = this._getOffset(level, row, col, snappedRow, snappedCol);
|
offset = this._getOffset(level, row, col, snappedRow, snappedCol);
|
||||||
var pointer = that._getPointer(bufferX, offset);
|
var pointer = that._getPointer(bufferX, offset);
|
||||||
|
|
||||||
that._buffer2Base64(bufferI,pointer,function(result){
|
that._buffer2Base64(bufferI,pointer,function(result){
|
||||||
if (that._isDBWriteable)that._storeTile(url, result, db,function(success,err){
|
if (that._isDBWriteable) {
|
||||||
if(err){
|
that._storeTile(url, result, db,function(success,err){
|
||||||
console.log("TPKLayer - Error writing to database." + err.message);
|
if(err){
|
||||||
that.emit(that.DATABASE_ERROR_EVENT,{msg:"Error writing to database. ", err : err});
|
console.log("TPKLayer - Error writing to database." + err.message);
|
||||||
}
|
that.emit(that.DATABASE_ERROR_EVENT,{msg:"Error writing to database. ", err : err});
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
callback(result,tileId, url);
|
callback(result,tileId, url);
|
||||||
}.bind(that));
|
}.bind(that));
|
||||||
}
|
}
|
||||||
@ -509,7 +519,7 @@ define([
|
|||||||
callback(null,tileId,url);
|
callback(null,tileId,url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.bind(that))
|
}.bind(that));
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -567,55 +577,59 @@ define([
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_base64ArrayBuffer: function(arrayBuffer) {
|
_base64ArrayBuffer: function(arrayBuffer) {
|
||||||
var base64 = ''
|
var base64 = "";
|
||||||
var encodings = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
|
var encodings = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||||
|
|
||||||
var bytes = new Uint8Array(arrayBuffer)
|
var bytes = new Uint8Array(arrayBuffer);
|
||||||
var byteLength = bytes.byteLength
|
var byteLength = bytes.byteLength;
|
||||||
var byteRemainder = byteLength % 3
|
var byteRemainder = byteLength % 3;
|
||||||
var mainLength = byteLength - byteRemainder
|
var mainLength = byteLength - byteRemainder;
|
||||||
|
|
||||||
var a, b, c, d
|
var a, b, c, d;
|
||||||
var chunk
|
var chunk;
|
||||||
|
|
||||||
|
/*jslint bitwise: true */
|
||||||
|
|
||||||
// Main loop deals with bytes in chunks of 3
|
// Main loop deals with bytes in chunks of 3
|
||||||
for (var i = 0; i < mainLength; i = i + 3) {
|
for (var i = 0; i < mainLength; i = i + 3) {
|
||||||
// Combine the three bytes into a single integer
|
// Combine the three bytes into a single integer
|
||||||
chunk = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2]
|
chunk = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];
|
||||||
|
|
||||||
// Use bitmasks to extract 6-bit segments from the triplet
|
// Use bitmasks to extract 6-bit segments from the triplet
|
||||||
a = (chunk & 16515072) >> 18 // 16515072 = (2^6 - 1) << 18
|
a = (chunk & 16515072) >> 18; // 16515072 = (2^6 - 1) << 18
|
||||||
b = (chunk & 258048) >> 12 // 258048 = (2^6 - 1) << 12
|
b = (chunk & 258048) >> 12; // 258048 = (2^6 - 1) << 12
|
||||||
c = (chunk & 4032) >> 6 // 4032 = (2^6 - 1) << 6
|
c = (chunk & 4032) >> 6; // 4032 = (2^6 - 1) << 6
|
||||||
d = chunk & 63 // 63 = 2^6 - 1
|
d = chunk & 63; // 63 = 2^6 - 1
|
||||||
|
|
||||||
// Convert the raw binary segments to the appropriate ASCII encoding
|
// Convert the raw binary segments to the appropriate ASCII encoding
|
||||||
base64 += encodings[a] + encodings[b] + encodings[c] + encodings[d]
|
base64 += encodings[a] + encodings[b] + encodings[c] + encodings[d];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deal with the remaining bytes and padding
|
// Deal with the remaining bytes and padding
|
||||||
if (byteRemainder == 1) {
|
if (byteRemainder == 1) {
|
||||||
chunk = bytes[mainLength]
|
chunk = bytes[mainLength];
|
||||||
|
|
||||||
a = (chunk & 252) >> 2 // 252 = (2^6 - 1) << 2
|
a = (chunk & 252) >> 2; // 252 = (2^6 - 1) << 2
|
||||||
|
|
||||||
// Set the 4 least significant bits to zero
|
// Set the 4 least significant bits to zero
|
||||||
b = (chunk & 3) << 4 // 3 = 2^2 - 1
|
b = (chunk & 3) << 4; // 3 = 2^2 - 1
|
||||||
|
|
||||||
base64 += encodings[a] + encodings[b] + '=='
|
base64 += encodings[a] + encodings[b] + "==";
|
||||||
} else if (byteRemainder == 2) {
|
} else if (byteRemainder == 2) {
|
||||||
chunk = (bytes[mainLength] << 8) | bytes[mainLength + 1]
|
chunk = (bytes[mainLength] << 8) | bytes[mainLength + 1];
|
||||||
|
|
||||||
a = (chunk & 64512) >> 10 // 64512 = (2^6 - 1) << 10
|
a = (chunk & 64512) >> 10; // 64512 = (2^6 - 1) << 10
|
||||||
b = (chunk & 1008) >> 4 // 1008 = (2^6 - 1) << 4
|
b = (chunk & 1008) >> 4; // 1008 = (2^6 - 1) << 4
|
||||||
|
|
||||||
// Set the 2 least significant bits to zero
|
// Set the 2 least significant bits to zero
|
||||||
c = (chunk & 15) << 2 // 15 = 2^4 - 1
|
c = (chunk & 15) << 2; // 15 = 2^4 - 1
|
||||||
|
|
||||||
base64 += encodings[a] + encodings[b] + encodings[c] + '='
|
base64 += encodings[a] + encodings[b] + encodings[c] + "=";
|
||||||
}
|
}
|
||||||
|
|
||||||
return base64
|
/*jslint bitwise: false */
|
||||||
|
|
||||||
|
return base64;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -702,28 +716,28 @@ define([
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_bytes2MBs: function(bytes){
|
_bytes2MBs: function(bytes){
|
||||||
return (bytes >>> 20 ) + '.' + ( bytes & (2*0x3FF ) )
|
return (bytes >>> 20 ) + '.' + ( bytes & (2*0x3FF ) ); // jshint ignore:line
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
)
|
);
|
||||||
/**
|
/**
|
||||||
* Creates a namespace for the non-AMD libraries in this directory
|
* Creates a namespace for the non-AMD libraries in this directory
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
if(typeof O != "undefined"){
|
if(typeof O != "undefined"){
|
||||||
O.esri.TPK = {}
|
O.esri.TPK = {};
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
O = {};
|
O = {}; // jshint ignore:line
|
||||||
O.esri = {
|
O.esri = {
|
||||||
TPK: {},
|
TPK: {},
|
||||||
Tiles: {}
|
Tiles: {}
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
"use strict";
|
//"use strict";
|
||||||
|
|
||||||
|
|
||||||
/*global indexedDB */
|
/*global indexedDB */
|
||||||
@ -806,7 +820,7 @@ O.esri.Tiles.TilesStore = function(){
|
|||||||
request.onsuccess = function(event)
|
request.onsuccess = function(event)
|
||||||
{
|
{
|
||||||
var result = event.target.result;
|
var result = event.target.result;
|
||||||
if(result == undefined)
|
if(result === undefined)
|
||||||
{
|
{
|
||||||
callback(false,"not found");
|
callback(false,"not found");
|
||||||
}
|
}
|
||||||
@ -1814,7 +1828,7 @@ O.esri.TPK.autoCenterMap = function(/* Map */ map,/* int */ delay){
|
|||||||
|
|
||||||
window.addEventListener(orientationEvent, _debounceMap(function(){
|
window.addEventListener(orientationEvent, _debounceMap(function(){
|
||||||
_centerMap();
|
_centerMap();
|
||||||
},delay))
|
},delay));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1824,17 +1838,20 @@ O.esri.TPK.autoCenterMap = function(/* Map */ map,/* int */ delay){
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
function _centerMap(){
|
function _centerMap(){
|
||||||
var locationStr = _getCenterPt().split(",");
|
|
||||||
var wkid = map.spatialReference.wkid;
|
|
||||||
var mapPt = null;
|
|
||||||
|
|
||||||
if(wkid == 4326){
|
require(["esri/geometry/Point","esri/SpatialReference"], function (Point,SpatialReference) {
|
||||||
mapPt = new esri.geometry.Point(locationStr[1],locationStr[0]);
|
var locationStr = _getCenterPt().split(",");
|
||||||
}
|
var wkid = map.spatialReference.wkid;
|
||||||
else if(wkid = 102100){
|
var mapPt = null;
|
||||||
mapPt = new esri.geometry.Point(locationStr[0],locationStr[1], new esri.SpatialReference({ wkid: wkid }));
|
|
||||||
}
|
if(wkid == 4326){
|
||||||
map.centerAt(mapPt);
|
mapPt = new Point(locationStr[1],locationStr[0]);
|
||||||
|
}
|
||||||
|
else if(wkid == 102100){
|
||||||
|
mapPt = new Point(locationStr[0],locationStr[1], new SpatialReference({ wkid: wkid }));
|
||||||
|
}
|
||||||
|
map.centerAt(mapPt);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1852,9 +1869,13 @@ O.esri.TPK.autoCenterMap = function(/* Map */ map,/* int */ delay){
|
|||||||
clearTimeout(timeout);
|
clearTimeout(timeout);
|
||||||
timeout = setTimeout(function() {
|
timeout = setTimeout(function() {
|
||||||
timeout = null;
|
timeout = null;
|
||||||
if (!immediate) func.apply(context, args);
|
if (!immediate) {
|
||||||
|
func.apply(context, args);
|
||||||
|
}
|
||||||
}, wait);
|
}, wait);
|
||||||
if (immediate && !timeout) func.apply(context, args);
|
if (immediate && !timeout) {
|
||||||
|
func.apply(context, args);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1865,7 +1886,7 @@ O.esri.TPK.autoCenterMap = function(/* Map */ map,/* int */ delay){
|
|||||||
map.on("pan-end",function(){
|
map.on("pan-end",function(){
|
||||||
var center = map.extent.getCenter();
|
var center = map.extent.getCenter();
|
||||||
_setCenterPt(center.x,center.y,map.spatialReference.wkid);
|
_setCenterPt(center.x,center.y,map.spatialReference.wkid);
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1877,7 +1898,7 @@ O.esri.TPK.autoCenterMap = function(/* Map */ map,/* int */ delay){
|
|||||||
var center = map.extent.getCenter();
|
var center = map.extent.getCenter();
|
||||||
_setCenterPt(center.x,center.y,map.spatialReference.wkid);
|
_setCenterPt(center.x,center.y,map.spatialReference.wkid);
|
||||||
map.setZoom(map.getZoom());
|
map.setZoom(map.getZoom());
|
||||||
}.bind(self))
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1918,8 +1939,8 @@ O.esri.TPK.autoCenterMap = function(/* Map */ map,/* int */ delay){
|
|||||||
_setOrientationListener(delay);
|
_setOrientationListener(delay);
|
||||||
var centerPt = map.extent.getCenter();
|
var centerPt = map.extent.getCenter();
|
||||||
_setCenterPt(centerPt.x,centerPt.y,map.spatialReference.wkid);
|
_setCenterPt(centerPt.x,centerPt.y,map.spatialReference.wkid);
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
/*
|
/*
|
||||||
Copyright (c) 2013 Gildas Lormeau. All rights reserved.
|
Copyright (c) 2013 Gildas Lormeau. All rights reserved.
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "offline-editor-js",
|
"name": "offline-editor-js",
|
||||||
"version": "2.9.3",
|
"version": "2.9.4",
|
||||||
"description": "Lightweight set of libraries for working offline with map tiles and ArcGIS feature services",
|
"description": "Lightweight set of libraries for working offline with map tiles and ArcGIS feature services",
|
||||||
"author": "Andy Gup <agup@esri.com> (http://blog.andygup.net)",
|
"author": "Andy Gup <agup@esri.com> (http://blog.andygup.net)",
|
||||||
"license": "Apache 2",
|
"license": "Apache 2",
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
"appHomePage": "appcache-features.html",
|
"appHomePage": "appcache-features.html",
|
||||||
"optimizedApiURL": "../samples/jsolib",
|
"optimizedApiURL": "../samples/jsolib",
|
||||||
"arcGISBaseURL": "http://js.arcgis.com/3.11",
|
"arcGISBaseURL": "http://js.arcgis.com/3.11",
|
||||||
"version": "2.9.3",
|
"version": "2.9.4",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "manifest generator project",
|
"description": "manifest generator project",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user