Esri / offline-editor-js

ArcGIS JavaScript library for handling offline editing and tiling.
http://esri.github.io/offline-editor-js/demo/
Apache License 2.0
159 stars 142 forks source link

Loading the application from offline device #499

Closed Henrikrb closed 7 years ago

Henrikrb commented 7 years ago

The ArcGis map doesnt initiate when loading the application from an offline device, if I start the device offline and then shut off the internet it works just fine.

I am using Offline Tiles advances

              tileLayer = new O.esri.Tiles.OfflineTilesAdvanced("******",function(evt){
                  console.log("Offline tile lib is enabled. Application state is: " + areWeOnline);
              },areWeOnline, responser.data);
              tileLayer.showBlankTiles = true; // if you don't want to see blank tile indicator images
              tileLayer.offline.proxyPath = null;

              tilelayer2 = new O.esri.Tiles.OfflineTilesAdvanced("*******",function(evt){
                  console.log("Offline tile lib is enabled. Application state is: " + areWeOnline);
              },areWeOnline, responser.data);
              tilelayer2.showBlankTiles = true; // if you don't want to see blank tile indicator images
              tilelayer2.offline.proxyPath = null;

              map.addLayer(tileLayer);
              map.addLayer(tilelayer2);

areWeOnline if(window.navigator.connection.type == "none") { areWeOnline = false; startMap(); } else { startMap(); }

Above the startmap which is:

             function startMap(){
              //Make sure map shows up after a browser refresh
              areWeOnline === true ? zoom = 18 : zoom = 17;

              map =  new Map("map", {
                center: [59.911491, 10.757933]
              });`

Plus the layers above of course. The response.data are just two variables ive added to the functions, it does not interfere with anything but the url out and works just fine with the cache. My problem is that arcgis doesnt start at all while starting it from offline. The area of the map is just blank.

Log:

init.js:51 DEPRECATED: dojo/io/iframe Use dojo/request/iframe. -- will be removed in version: 2.0 k.deprecated @ init.js:51 STATE IS: false database opened successfully **** Failed to load resource: net::ERR_INTERNET_DISCONNECTED _getTileInfoPrivate failed: {"isTrusted":true} Offline tile lib is enabled. Application state is: false **** Failed to load resource: net::ERR_INTERNET_DISCONNECTED _getTileInfoPrivate failed: {"isTrusted":true} Offline tile lib is enabled. Application state is: false

I've cencored the servers to keep them private

andygup commented 7 years ago

Please confirm your browser and version?

andygup commented 7 years ago

Hi, any luck on this?

andygup commented 7 years ago

@tumenor I'm going to go ahead and close this. If you have additional issues please feel free to reopen or create a new issue.