-
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.
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.
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.
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.
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** |
** 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.
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. And, there are also step-by-step tutorials that cover the basics. There is also detailed API and How-to documents [here]( and include How-to documents).