-
Notifications
You must be signed in to change notification settings - Fork 142
Offline-editor-js is an open source family of libraries for building offline capabilities into mobile, web mapping applications. It's specifically designed to work with the ArcGIS API for JavaScript and ArcGIS Online. It enables you to store features, attachments, map tiles and TPKs (Tile Packages). It can be used for intermittent offline and fully offline use cases. With fully offline use cases you can restart the browser offline and still preserve your edits, attachments, map tiles and TPK-related tiles.
The ArcGIS Runtime SDKs offer robust, fully supported offline capabilities that includes related tables, sub-types, domains and much, much more. They can also store significantly more data.
Furthermore, offline-editor-js is not part of the core ArcGIS API for JavaScript library and it is not supported by Esri Tech Support.
First search the closed issues, and then open a new issue if you can't find an answer.
Here are recommended steps for submitting a pull request to this repo. If you aren't comfortable with the completing the entire workflow just mention this in the comments when you submit your pull request and we'll work thru it.
Yes, under very limited circumstances you can simply allow the browser cache to temporarily store map tiles. This doesn't require any coding on your part.
This approach will work if you wish to maintain the exact same extent and don't need to pan around or zoom in and out. There also may be limitations on how long those tiles will remain in the browser cache: this time factor is dependent on the header cache settings for each map tile service. Chances are that these automatically cached tiles will disappear if you restart the browser. Typically this approach is only used for testing purposes and not for production use.
By using the offline-editor-js library you can insure that tiles are available within a specific extent and zoom levels of your choosing, and you can configure the mapping app to continue working after offline browser restarts.
Yes. It's important to note that developing a web application for full offline will involve using the Application Cache and requires different programming patterns than intermittent offline.
For checking whether the browser is online, offline or if the internet connection has gone up or down we use Offline.js.
If you are a building an application for full offline, then there may be certain circumstance where you want to do additional validation your own connection to the internet via a simple XHR request. You can see an example of this in the appcache-tiles.html sample.
If you have a PhoneGap or Cordova application then you can hook into the devices advanced ability to determine whether or not it's connected to the internet via cordova-plugin-network-information.
Here's a blog post that explains the difference: Going Offline with HTML5 and JavaScript, Part 1.
With this library, you can use ArcGIS Online webmaps for intermittent offline only. If you have a requirement to go fully offline then you'll need to use a tiled basemap service plus feature layers and either use the ArcGIS API for JavaScript's widgets or build your own custom widgets.
The library uses IndexedDB for almost all of it's storage needs. IndexedDB is built into modern browsers and is available via a JavaScript API. You can also use the library with IndexedDBShim when working with browsers that don't support IndexedDB.
The maximum amount of IndexedDB storage varies from device to device. Generally speaking, you can store up to a total of 50MB - 100MB (or greater).
It depends on numerous factors related to the browser including how many browser-based databases are being used and how much data is in each database, how much data is stored in the Application Cache, how much total memory the browser has consumed, how large the browser cache has grown, how many other tabs may be open, and how much memory other applications are already consuming.
Remember, your web app runs inside a browser. The browser is a native application that consumes memory on the device. As you store offline data in your web app, the browser's memory footprint will also grow by an additional factor that is much greater than 1:1. Native operating systems will kill off individual applications that consume too much memory.
If someone manually clears the browser cache they may also end up clearing any browser database data stored in IndexedDB.
This project is designed and tested to work with the latest versions of Chrome, Firefox and Safari. For the most up-to-date information on specific browser support check the Supported Browsers section of the demos page.
Here's a table of exactly what's supported for HTTPS:
Operation | Partial Offline | Full Offline |
---|---|---|
editing | yes | partial** |
attachments | yes | yes*** |
tiles | n/a | yes**** |
** The library currently does not support full offline, secure workflows when working with feature layers created with a feature collection. The edits will be stored but the library will not be able to reconnect correctly to sync.
*** For the latest information on attachments support and limitations refer to the Attachments Support.
**** Secure tile map services are supported by the OfflineTilesEnablerLayer
library. In theory, you shouldn't need to use OfflineTilesEnablerLayer
library in a partial offline scenario because you won't need to restart the browser. If you do have a need to handle offline browser restarts then you should configure your app for work in full offline mode.
Yes. The caveat is that these platforms aren't officially supported. It's recommended that you at least run the project's unit tests on any desired devices to validate basic browser functionality. Android, in particular, can be tricky because it's not always clear what version of Chrome or WebView may be installed on devices from different manufacturers. Feel free to open an issue if you get stuck.
There are samples in the /samples/
directory. There is also detailed API and How-to documents [here]( and include How-to documents).