Skip to content

Commit

Permalink
Merge pull request #345 from andygup/v2.9
Browse files Browse the repository at this point in the history
v2.9
  • Loading branch information
andygup committed May 28, 2015
2 parents 2ba919e + dc91144 commit 1c39790
Show file tree
Hide file tree
Showing 20 changed files with 543 additions and 268 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# offline-editor-js - Changelog

## Version 2.9 - May 27, 2015

No breaking changes.

**Enhancements**
* Closes #341 - Improved use of keys and indexes in editsStore.js. Minor tweaks at this time.
* Closes #342 - Automates featureCollection management. New method `offlineFeaturesManager.getFeatureCollections()`.


## Version 2.8.2 - May 19, 2015

No breaking changes. Recommended update.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Offline-editor-js is an open source family of libraries for building offline cap

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

*IMPORTANT:* This is an R&D project. If you need a fully integrated, robust offline solution then you should be using our ArcGIS Runtime SDKs for .NET, WPF, Java, iOS, Android and Qt.
*IMPORTANT:* If you need a fully integrated, robust offline solution then you should be using our ArcGIS Runtime SDKs for .NET, WPF, Java, iOS, Android and Qt.

This repo contains the following libraries:

Expand Down
7 changes: 3 additions & 4 deletions dist/offline-edit-min.js

Large diffs are not rendered by default.

284 changes: 177 additions & 107 deletions dist/offline-edit-src.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/offline-tiles-advanced-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/offline-tiles-advanced-src.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! offline-editor-js - v2.8.2 - 2015-05-19
/*! offline-editor-js - v2.9.0 - 2015-05-27
* Copyright (c) 2015 Environmental Systems Research Institute, Inc.
* Apache License*/
define([
Expand Down
2 changes: 1 addition & 1 deletion dist/offline-tiles-basic-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/offline-tiles-basic-src.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! offline-editor-js - v2.8.2 - 2015-05-19
/*! offline-editor-js - v2.9.0 - 2015-05-27
* Copyright (c) 2015 Environmental Systems Research Institute, Inc.
* Apache License*/
define([
Expand Down
2 changes: 1 addition & 1 deletion dist/offline-tpk-min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/offline-tpk-src.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! offline-editor-js - v2.8.2 - 2015-05-19
/*! offline-editor-js - v2.9.0 - 2015-05-27
* Copyright (c) 2015 Environmental Systems Research Institute, Inc.
* Apache License*/
/**
Expand Down
41 changes: 40 additions & 1 deletion doc/howtouseeditlibrary.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,24 @@ NOTE: You can also monitor standard ArcGIS API for JavaScript layer events using
```
**Step 4** After the `layers-add-result` event fires extend the feature layer using the `extend()` method. Optionally, if you are building a fully offline app then you will also need to set the `dataStore` property in the constructor.
**Step 4** After the `layers-add-result` event fires extend the feature layer using the `extend()` method.
Optionally, if you are building a fully offline app then you will also need to set the `dataStore` property in the constructor if you want full control of what is stored. You can also access an automatically created data store via the `getFeatureCollections()` method. If you use the `getFeatureCollections()` pattern you can simply ignore the `dataStore` property in the constructor. Here is an example of the Object returned in the `getFeatureCollections()` callback:
```js
{
id: "feature-collection-object-1001",
featureLayerCollections: [
{
featureLayerUrl: "http://...",
featureLayerCollection: { . . . }
}
]
}
```
The `featureLayerCollection` is equivalent to `featureLayer.toJson()`.
Note: the `layer.extend()` callback only indicates that the edits database has been successfully initialized.
Expand Down Expand Up @@ -160,6 +177,28 @@ You can then retrieve this data after an offline restart by using the following
```
If you don't want to deal with creating and managing your own data store when working with offline browser restarts, then here's the pattern for using the built-in `featureLayerCollections`. This pattern is ideal if you are using Esri's pre-built widgets such as `AttributeInspector` and you don't have access to the necessary events for creating and updating the `dataStore`.
```js
offlinefeaturesManager.getFeatureCollections(function(success, collection) {
if(success) {
myFeatureLayer = new
FeatureLayer(collection.featureCollections[0].featureLayerCollection),{
mode: FeatureLayer.MODE_SNAPSHOT,
outFields: ["GlobalID","BSID","ROUTES","STOPNAME"]
});
offlineFeaturesManager.extend(myFeatureLayer,function(result, error) {
if(result) {
console.log("Layer has been successfully rebuilt while offline!");
}
}
}
});
```
**Step 5** Once a layer has been extended the offline library will enable it with new methods. Here are a few examples that include code snippets of how to take advantage of some of the library's methods. You can also use a combination of methods from `editsStore` and `offlineFeaturesManager`.
####offlineFeaturesManager.proxyPath
Expand Down
Loading

0 comments on commit 1c39790

Please sign in to comment.