Coder Social home page Coder Social logo

esri / offline-editor-js Goto Github PK

View Code? Open in Web Editor NEW
158.0 60.0 144.0 24.31 MB

ArcGIS JavaScript library for handling offline editing and tiling.

Home Page: http://esri.github.io/offline-editor-js/demo/

License: Apache License 2.0

HTML 9.61% JavaScript 89.93% Shell 0.46%

offline-editor-js's Introduction

offline-editor-js

Maintenance Mode As of May 1, 2016 no new functionality will be added to this project. For additional details refer to this issue.

If you need a fully integrated, robust offline solution that's officially supported, then please refer to our native ArcGIS Runtime SDKs for iOS, Android, .NET, Xamarin, Java, OSx and Qt.

Getting Started

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

This project is also available on npm: https://www.npmjs.com/package/esri-offline-maps

Libraries

This repo contains the following libraries in the /dist directory. The use of basic in the name indicates intermittent offline-only, and advanced indicates the library can be used for both intermittent and full offline.

Reference URLs are provided for developement only. It's recommended to use a CDN or host your own.

Use_Case Name, Description and gh-pages URL
Basic editing offline-edit-basic-min.js Simple, lightweight (15k minimized) offline editing library that automatically caches adds, updates and deletes when the internet is temporarily interrupted.

http://esri.github.io/offline-editor-js/dist/offline-edit-basic-min.js
Advanced editing offline-edit-advanced-min.js Used for intermittent and full offline editing workflows. Also includes limited support for attachments.

http://esri.github.io/offline-editor-js/dist/offline-edit-advanced-min.js
Basic map tiles offline-tiles-basic-min.js Caches map tiles for simple, intermittent-only offline workflows. Use this library with ArcGIS Online Web maps as well as with tiled map services.

http://esri.github.io/offline-editor-js/dist/offline-tiles-basic-min.js
Advanced map tiles offline-tiles-advanced-min.js Used for intermittent and full offline tile caching. Extends any ArcGIS Tiled Map Service. This library should be used in conjunction with an HTML5 Application Cache Manifest coding pattern.

http://esri.github.io/offline-editor-js/dist/offline-tiles-advanced-min.js
TPK files offline-tpk-min.js Reads TPK files and displays and caches them as a tiled map layer. Works for both intermittent and full offline.

http://esri.github.io/offline-editor-js/dist/offline-tpk-min.js

src files are for software development-only. Themin versions are minified and should be used in production.

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.
  • There are browser limitations and technical dependencies. The offline capabilities in this toolkit depend on certain JavaScript capabilities being present in the browser. Go here for a detailed breakdown.
  • 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.
  • The ArcGIS Editor Widget (ArcGIS API for JavaScript v3.x) may not work with OfflineEditAdvanced after a full offline restart. It's recommended that you build your own custom editing functionality that is fully mobile and offline compliant.

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.14+)

  • Offline.js - it allows detection of the online/offline condition and provides events to hook callbacks on when this condition changes

  • Node.js required for building the source

  • IndexedDBShim - polyfill to simulate indexedDB functionality in browsers/platforms where it is not supported notably older versions desktop Safari and iOS Safari.

  • Sub-modules (see /vendor directory)

  • Non sub-module based libraries that are used internally by this project

    • 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 2017 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 bryant1410 avatar driskull avatar jabadia avatar nixta avatar robkspeer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

offline-editor-js's Issues

PhoneGap support

Create a sample that demonstrates this library working with PhoneGap/Cordova.

Problem in tile samples with accessing the webmap id

XMLHttpRequest cannot load http://www.arcgis.com/sharing/rest/content/items/f58996878ac24702afef792e52a07e55/data?f=json. The 'Access-Control-Allow-Origin' whitelists only 'http://esri.github.io'. Origin 'http://localhost' is not in the list, and is therefore not allowed access.

GET http://www.arcgis.com/sharing/rest/content/items/f58996878ac24702afef792e52a07e55/data?f=json
304 Not Modified
94ms
3.7compact (line 157)
RequestError: Unable to load http://www.arcgis.com/sharing/rest/content/items/f58996878ac24702afef792e52a07e55/data?f=json status: 0
The resource from this URL is not text: http://js.arcgis.com/3.7compact

Create an app to demonstrate offline editing

The existing index.html app isn't very pretty although it does demonstrate add and delete for points, lines and polygons.

Maybe with some cleanup and removal off all the testing functionality it could become the demonstration app.

Index not updating correctly

Sometimes it writes duplicate information, sometimes is doesn't represent an add, update or delete that has definitely occured.

capability to reload the app while offline

need to:

  • cache the application files (html, css, js...) (using HTML5 manifest)
  • store the original feature layers offline (on user's request)
  • when loading the app, detect whether we are offline and load the feature layers from local storage

Remove or highlight graphic that has been deleted while offline

There needs to be a way to indicate that a graphic (point, line or polygon) has be created or deleted while offline. This will allow someone, at a glance, to determine was has been done. This could be as simple as changing the color, or adding some sort of icon to the graphic.

And/or there needs to be a table of edits that is updated as adds, updates, deletes occur.

add submodule for jasmine

Javier, I changed my mind. I agree with you that we should add this as a submodule. After thinking about it for a bit, I actually like the web interface better than the node "pure text" terminal view.

indexedDBShim not allowing proper debugging in Firefox 27

Firefox debugger console doesn't seem like the shim. We need to be able to debug in Firefox. I haven't looked at this in detail, however app fails because of numerous errors such as:

setting a property that has only a getter Line 2
'onreadystatechange' getter called on an object that does not implement interface XMLHttpRequest. Line 2
'readyState' getter called on an object that does not implement interface XMLHttpRequest. Line 2
'timeout' getter called on an object that does not implement interface XMLHttpRequest. Line 2

Offline Edit tests that connect to ArcGIS Server are throwing 400 errors

The graphics created in edit-basic.html are 'not' well formed and are causing sync failures with their respective feature services. Furthermore, the tests are showing these requests as completing successfully.

Here's example of a correctly working "adds":

[{"geometry":{"rings":[[[-9266233.729308194,5247884.508472704],[-9265798.993709812,5247454.550188589],[-9266458.263078788,5247444.995560053],[-9266458.263078788,5247444.995560053],[-9266233.729308194,5247884.508472704]]],"spatialReference":{"wkid":102100}},"attributes":{"ruleid":2,"name":null,"__hydrate_id":"0"}}]

Here's an adds that is obviously being messed up by the serializer:

[{"geometry":{"rings":[[[-115.312,37.96875],[-111.4453125,37.96875],[-99.84375,36.2109375],[-99.84375,23.90625],[-116.015625,24.609375],[-115.3125,37.96875]]],"spatialReference":{"wkid":102100}},"attributes":{"0":"","1":"","2":"h","3":"y","4":"d","5":"r","6":"a","7":"t","8":"e","9":"","10":"r","11":"e","12":"f","13":"","14":"0"}}]

OfflineStore needs to work with attribute inspector

Need to dynamically determine which fields are available and configure the attribute inspector to use them. We'll probably need some sort of configuration file or preconfigured object that specifies which fields we want to not display. Default will be to display all fields in the attribute inspector.

Caveat: library won't be able to create new attributes that don't already exist on the server.

Ability to write csv containing tile info to indexedDB

The tile library has ability to allow user to download a csv file containing the cut tiles. This issue is for building the functionality to allow the reverse, which is programmatically reading the CSV-based tiles and allowing them to be read back into indexedDB.

This provides a mechanism to make the tiles portable amongst different machines and devices.

enhance phantom layer

  • need to use better looking symbols
  • need to make the phantom layer transparent to mouse events (this is proving to be difficult)

Randomly not detecting offline conditions correctly in Firefox - UX fails silently

I've been able to reproduce this condition.

  • Browser is taken offline
  • Library does not properly detect condition
  • Offline indicator in military-offline.html app continues to show an online condition
  • Edits fail silently

An error is properly returned in line 54 of offlineFeaturesManager.js. However, I'm not sure where we can properly capture this error in the TemplatePicker?

image
image

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.