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

Maintenance mode details #468

Open andygup opened 8 years ago

andygup commented 8 years ago

Thanks to all who have asked questions about this library going into maintenance mode notice. I wanted to consolidate and share this information for others:

stdavis commented 6 years ago

Hey, @andygup. Sorry to see that this project is not being actively developed anymore. Do you know why ESRI isn't putting resources behind offline web? Is it that the tech isn't ready yet? Or that they just want to gain more traction with the runtime products?

andygup commented 6 years ago

Hey there @stdavis, yep the focus for offline mapping is on Runtimes, Qt (AppStudio) and Xamarin.

Just to mention a few of the technical reasons: those platforms/languages have significantly more robust and better defined mechanisms for gracefully handling the mechanics of being fully offline, they also work in many more use cases, and the native APIs are much better at working with larger local datasets than using Browser-based APIs.

If you wanna chat about it more, feel free to shoot me an email or DM me on Twitter.

davinci0428 commented 6 years ago

@andygup, I've been investigating the possibility of creating browser-based GIS apps that use Google's new Progressive Web App technology to enable offline use. Can you tell me if the PWA technology overcomes some of the robustness issues that otherwise exists in browser-based GIS apps? If you're not acquainted with PWA technology, can you at least give me a better idea of what those limitation are that caused you no longer develop this project?

andygup commented 6 years ago

@davinci0428 thanks for the question! I get asked this question quite a bit, so here are some of my thoughts. There are strong technical reasons for using our Runtime SDKs for offline.

Can you tell me if the PWA technology overcomes some of the robustness issues that otherwise exists in browser-based GIS apps?

A PWA can overcome 'some' of the robustness issues found in this library, but still can't come close to handling all the use cases that our Runtime SDKs handle with ease. A few of the challenges include cross-browser support, data storage limitations and offline/online detection.

Cross-browser support is challenging with PWAs for example service workers are currently not supported on IE 11, Edge, Safari or iOS Safari -- reference.

Browsers are not designed to handle large amounts (500MB+) of data storage I/O consistently as well as iOS and Android native SDKs, and are significantly more memory constrained. I mention large amounts of data because most offline mapping applications require basemaps, and offline basemap tile packages can get quite large and often larger than 500MB especially if you want to be able to zoom in to ground level using imagery (e.g. Zoom Level 23). Here's a good article - Offline Storage for Progressive Web Apps

And, offline/online detection is still challenging, for example Google suggests using the Network Information API in the PWA checklist, but it is experimental -- native online/offline detection is significantly better.

davinci0428 commented 6 years ago

@andygup, thanks for the quick reply! You provided just the information I needed to better weigh the pros and cons of using your offline editor in the field. I think what you've created is a great tool that can be used in the field under limited conditions, but I've decided that, as you've said, it's probably not robust enough for my needs.

andygup commented 5 years ago

Many thanks for all the on-going questions about browser data storage limitations for JavaScript. Here is a summary of best practices and considerations.

For web mapping applications, I still recommend a maximum of 100MB (Megabytes) of storage even for PWAs (Progressive Web Apps). There are blog posts and articles stating that you can use more storage. That may be true for many use cases, however for mapping application there a variety of mitigating factors that can severely limit this amount:

In summary, 100MB maximum browser storage is a best practice. It's very challenging to manage browser storage well. The greater amount of storage that you use, expect slowdowns, lockups and crashes especially in memory constrained devices such as smartphones and tablets.

khanguslee commented 5 years ago

If anyone is looking to get some sort of offline map caching support using arcGIS 4.x with your PWA, have a look at https://github.com/Esri/nearby-javascript. Idea is to use workbox to setup your service worker to cache the arcGIS map tiles.

JonForest commented 3 years ago

PWAs continue to push offline storage limits - from https://web.dev/storage-for-the-web/#how-much it seems that 1Gb is a reasonably safe bet. However, I wonder if with service workers this becomes a relatively easy problem?

If we use a service worker to cache map tiles locally then presumably we pay the API cost associated with that tile layer fetch? How does the new pricing structure work if users are then consuming the map tiles from the cache? I couldn't find anything specifically in the terms of use (https://www.esri.com/content/dam/esrisites/en-us/media/legal/product-specific-terms-of-use/e300.pdf) about this.

andygup commented 3 years ago

it seems that 1Gb is a reasonably safe bet.

Based on experience, it's the heavy I/O requirements of a browser-based mapping app that caused browser crashes and lockups in the past. Heavy I/O can cause CPU/GPU bottlenecking, memory thrashing and memory leaks.

This is why we only recommend using ArcGIS Runtime or ArcGIS Pro for full offline use cases. They are designed for full offline and aren't dependent on the browser.

How does the new pricing structure work if users are then consuming the map tiles from the cache?

You'd need to talk to your account representative about pricing and licensing. Make sure you are in compliance with the ArcGIS Master Agreement 3.2(c) Permitted Uses:

Customer may take ArcGIS Online basemaps offline through Esri Content Packages and subsequently deliver (transfer) them to any device for use with licensed ArcGIS Runtime applications and ArcGIS Desktop. Customer may not otherwise scrape, download, or store Data.

glenndejaeger commented 2 years ago

Hi all,

We are creating mobile apps based on Ionic and Capacitor. The single JS based code base uses the Arcgis JS API. Currently we build a web app and an Android app from the source code. In the future we will also build an iOS app and a desktop app (via Electron).

Our web app and Android app support offline:

Currently we don't have a service worker which means that our static assets (JS, CSS, HTML, images, fonts, esri map tiles, ...) are not cached for offline use. That's not an issue because our main use case is the mobile app. Offline is supported in the mobile app because all static assets are 'baked' into the app itself.

We're now looking for a solution to have esri map functionality offline:

We have servers that expose .vtpk and .mmpk files, including custom layers. Can these be consumed via the JS api? Can we fetch specific tiles (eg tiles showing part of a map at a specific geolocation)?

andygup commented 2 years ago

Hi @glenndejaeger the JS API does not support tile packages or offline workflows, but the native Runtime SDKs offer full support, for example: https://developers.arcgis.com/android/api-reference/reference/com/esri/arcgisruntime/mapping/MobileMapPackage.html.