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

Support importing TPK file with ArcGis SDK API > 4.10 #506

Closed yevhenii-username closed 5 years ago

yevhenii-username commented 5 years ago

Expected behavior

Actual behavior

When I started example I recieve

dojo.js:293 Uncaught TypeError: Cannot read property 'properties' of undefined
    at new b (dojo.js:293)
    at Object.constructor (dojo.js:277)
    at new <anonymous> (dojo.js:288)
    at initMap (tpk-layer.html?_ijt=dlpq9thpqks62a6svho0go016i:202)
    at tpk-layer.html?_ijt=dlpq9thpqks62a6svho0go016i:172
    at offline-tpk-src.js:2425
    at FileReader.reader.onload (offline-tpk-src.js:1972)

I tryed debug solve this error, but I think that is's meaningless, becouse this lib version use 3.. And current lib not compatible with 4.

Did you have some work in this direction with 4.* versions arcgis-js-api?

andygup commented 5 years ago

@LukashenkoEvgeniy this repo is only for v3.15+ and I don't have any plans to migrate it to 4.x. A number of folks have said there were going to give it a try but I never heard back.

Reference: https://github.com/Esri/offline-editor-js#offline-editor-js

I'll go ahead and close this, if you have updates definitely post the info here.

yevhenii-username commented 5 years ago

@andygup, thank you for response. Maybe you know some alternatives JavaScript staff for 4.x versions, which can import .tpk file for ability work offline?

andygup commented 5 years ago

I don't, sorry. It's very difficult to create offline JavaScript mapping libraries that are scalable, stable and don't crash or lock up the browser all the time. This is where our native Runtime SDKs really shine.

In theory you could could convert the TPKLayer library to use 4.x. I don't know of anyone that's done that: https://github.com/Esri/offline-editor-js/tree/master/lib/tpk.

There are also some major caveats to keep in mind related to how much TPK data you can consume in a browser: I still recommend a 100MB (Megabyte) maximum. There are articles and blog posts that claim you can do more, but mapping-related use cases rarely work in production beyond that capacity (100MB) when there is heavy IndexedDB and memory read/write activity like a mapping application demands. More info here in the FAQ: https://github.com/Esri/offline-editor-js/wiki/FAQ#how-much-data-can-you-store-with-the-library

I hope that helps.

yevhenii-username commented 5 years ago

@andygup, thank you for response!