Git Product home page Git Product logo

offline-editor-js's Introduction

offline-editor-js

Offline-editor-js is a family of libraries for building offline capabilities into web mapping applications. It's specifically designed to work with the ArcGIS API for JavaScript and ArcGIS Online. It enables you to store feature edits, attachments, map tiles and TPKs (Tile Packages).

Online samples and getting started tutorials are available here: http://esri.github.io/offline-editor-js/demo/

IMPORTANT: If you need a fully integrated, robust offline solution then you should be using our native ArcGIS Runtime SDKs for .NET, WPF, Java, iOS, Android and Qt.

This repo contains the following libraries:

  • /dist - contains src and min versions of each library:
    • offline-edit-min.js - stores adds, updates and deletes of features as well as limited attachment support while offline. Resync's edits with server once connection is reestablished.
    • offline-tiles-basic-min.js - caches map tiles for partial offline use cases. Use this library with ArcGIS Online Web maps as well as with tiled map services. This repo will not work with browser restarts or reloads while offline.
    • offline-tiles-advanced-min.js - Extends any ArcGIS Tiled Map Service that has a requirement for offline browser reload and/or restart. This library should be used in conjunction with an HTML5 application cache coding pattern.
    • offline-tpk-min.js - parses a TPK file and displays it as a tiled map layer.
  • /utils: contains various helper library modules. These modules are all AMD compliant.
  • /samples: samples that show how to use the different offline libraries capabilities.

#Workflows Supported The following workflow is currently supported for both both features and tiles:

  1. Load web application while online.

  2. Once all tiles, features and attachments are loaded then programmatically take application offline.

  3. Make edits while offline.

  4. Return online when you want to resync edits.

This workflow is supported for intermittent offline and full offline. There are samples in the /samples directory for both use cases. For more information on the differences between intermittent and full offline check out this blog post.

Full offline requires the use of an application manifest to allow for browser reloads and restarts while offline. The application manifest lets you store .html, .js, .css and image files locally. There is also a wiki doc to help you learn more about using the cache with this library.

Attachment Support: Attachments are supported with some limitations. See documentation here

#API and How To Use Docs

Go here to get links to the API docs and How to use docs.

FAQ

Go here for answers to frequently asked questions.

Architecture

Architecture

##Setup Instructions

  1. Fork and clone the repo.
  2. After cloning from github, cd into the offline-editor-js folder
  3. Run git submodule init and git submodule update
  4. Try out the apps in the /samples folder. If they run, then everything is set up correctly.

##Build Instructions

  1. From the root directory run npm install
  2. Run Grunt build. If there are no errors, the minimized (min) and source (src) versions of the libraries will be output to /dist
  3. For production automation see the npm scripts listed in package.json.

##Limitations

  • Currently does not support related tables, domains or subtypes. The ArcGIS Runtime SDKs fully support these and more.
  • Attachments are supported with some limitations listed here.
  • Browser storage space on mobile devices is a known limitation. This applies to stand-alone web applications and hybrid applications.

Supported browsers

  • Only the latest versions of Chrome, Firefox and Safari are supported.
  • The most up to date information on this library's browser support can be found here.

##Dependencies

  • ArcGIS API for JavaScript (v3.12+)

  • Node.js required for building the source

  • NOTE: browser limitations and technical dependencies. The offline capabilities in this toolkit depend on certain HTML5 capabilities being present in the browser. Go here for a detailed breakdown of the information.

  • Sub-modules (see /vendor directory)

    • offline.js - it allows detection of the online/offline condition and provides events to hook callbacks on when this condition changes
    • IndexedDBShim - polyfill to simulate indexedDB functionality in browsers/platforms where it is not supported (notably desktop Safari and iOS Safari)
      • IMPORTANT: There are known issues with IndexedDBShim on Safari. For Safari, the storage error workaround is to switch from using /dist/IndexedDBShim.min.js to just using IndexedDBShim.js and then search for and modify the line that defines the value for DEFAULT_DB_SIZE. Set this to more appropriate size that will meet all your storage needs, for example: var DEFAULT_DB_SIZE = 24 * 1024 * 1024
    • jasmine.async - library to help implementing tests of async functionality (used in tests)
  • Non sub-module based libraries

    • FileSaver.js - library to assist with uploading and downloading of files containing tile information.
    • grunt-manifest node.js library to assist with the creation of manifest files.
    • zip A library for zipping and unzipping files.
    • xml2json A library for converting XML to JSON. Handles complex XML.

Resources

Issues

Find a bug or want to request a new feature? Please let us know by submitting an issue.

Contributing

Anyone and everyone is welcome to contribute. Please see our guidelines for contributing.

Licensing

Copyright 2015 Esri

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

A copy of the license is available in the repository's license.txt file.

[](Esri Tags: ArcGIS Web Mapping Editing FeatureServices Tiles Offline) [](Esri Language: JavaScript)

offline-editor-js's People

Contributors

andygup avatar jabadia avatar robkspeer avatar driskull avatar nixta avatar

Watchers

Matt Sheehan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.