Skip to content

Commit

Permalink
Merge pull request #401 from andygup/v2.14
Browse files Browse the repository at this point in the history
v2.14
  • Loading branch information
andygup committed Aug 14, 2015
2 parents 5235be0 + 5143c63 commit 07bfc54
Show file tree
Hide file tree
Showing 14 changed files with 53 additions and 40 deletions.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@
.DS_Store
Icon

# Filesystem
*.zip

# Node
node_modules

# Grunt
.grunt/
.grunt/

# npm

*.log
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# offline-editor-js - Changelog

## Version 2.14 - Aug. 14, 2015

No breaking changes.

**Enhancements**
* Closes #399 - OfflineFeaturesManager now throws an error if you try to extend a layer before the map or layer has finished initializing.

**Bug Fix**
* Closes #400 - deferred already resolved error when going online.

## Version 2.13.1 - Aug. 12, 2015

No breaking changes.
Expand Down
6 changes: 3 additions & 3 deletions dist/offline-edit-min.js

Large diffs are not rendered by default.

26 changes: 11 additions & 15 deletions dist/offline-edit-src.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! esri-offline-maps - v2.13.1 - 2015-08-12
/*! esri-offline-maps - v2.14.0 - 2015-08-14
* Copyright (c) 2015 Environmental Systems Research Institute, Inc.
* Apache License*/
/*jshint -W030 */
Expand Down Expand Up @@ -114,6 +114,10 @@ define([
var self = this;
layer.offlineExtended = true; // to identify layer has been extended

if(!layer.loaded || layer._url === null) {
console.error("Make sure to initialize OfflineFeaturesManager after layer loaded and feature layer update-end event.");
}

// NOTE: At v2.6.1 we've discovered that not all feature layers support objectIdField.
// However, to try to be consistent here with how the library is managing Ids
// we force the layer.objectIdField to DB_UID. This should be consistent with
Expand Down Expand Up @@ -1142,7 +1146,7 @@ define([
layer._map.addLayer(layer._phantomLayer);
}
catch (err) {
console.log("Unable to init PhantomLayer");
console.log("Unable to init PhantomLayer: " + err.message);
}
}

Expand Down Expand Up @@ -1905,8 +1909,8 @@ define([
return r.objectId;
});

layer._replaceFeatureIds(tempObjectIds, newObjectIds, function (success) {
console.log("done replacing feature ids");
layer._replaceFeatureIds(tempObjectIds, newObjectIds, function (count) {
console.log("Done replacing feature ids. Total count = " + count);
});
}

Expand Down Expand Up @@ -1979,17 +1983,8 @@ define([
return r.objectId;
});

layer._replaceFeatureIds(tempObjectIds, newObjectIds, function (success) {

dfd.resolve({
id: id,
layer: layer.url,
tempId: tempObjectIds, // let's us internally match an ADD to it's new ObjectId
addResults: addResults,
updateResults: updateResults,
deleteResults: deleteResults,
syncError: null
});
layer._replaceFeatureIds(tempObjectIds, newObjectIds, function (count) {
console.log("Done replacing feature ids. Total count = " + count);
});
}

Expand Down Expand Up @@ -3505,6 +3500,7 @@ O.esri.Edit.AttachmentsStore = function () {
cursor.continue();
}
else {
// If no records match then evt.target.result = null
// allow time for all changes to persist...
setTimeout(function () {
callback(replacedCount);
Expand Down
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 @@
/*! esri-offline-maps - v2.13.1 - 2015-08-12
/*! esri-offline-maps - v2.14.0 - 2015-08-14
* 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 @@
/*! esri-offline-maps - v2.13.1 - 2015-08-12
/*! esri-offline-maps - v2.14.0 - 2015-08-14
* 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 @@
/*! esri-offline-maps - v2.13.1 - 2015-08-12
/*! esri-offline-maps - v2.14.0 - 2015-08-14
* Copyright (c) 2015 Environmental Systems Research Institute, Inc.
* Apache License*/
/**
Expand Down
1 change: 1 addition & 0 deletions lib/edit/attachmentsStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ O.esri.Edit.AttachmentsStore = function () {
cursor.continue();
}
else {
// If no records match then evt.target.result = null
// allow time for all changes to persist...
setTimeout(function () {
callback(replacedCount);
Expand Down
23 changes: 9 additions & 14 deletions lib/edit/offlineFeaturesManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ define([
var self = this;
layer.offlineExtended = true; // to identify layer has been extended

if(!layer.loaded || layer._url === null) {
console.error("Make sure to initialize OfflineFeaturesManager after layer loaded and feature layer update-end event.");
}

// NOTE: At v2.6.1 we've discovered that not all feature layers support objectIdField.
// However, to try to be consistent here with how the library is managing Ids
// we force the layer.objectIdField to DB_UID. This should be consistent with
Expand Down Expand Up @@ -1139,7 +1143,7 @@ define([
layer._map.addLayer(layer._phantomLayer);
}
catch (err) {
console.log("Unable to init PhantomLayer");
console.log("Unable to init PhantomLayer: " + err.message);
}
}

Expand Down Expand Up @@ -1902,8 +1906,8 @@ define([
return r.objectId;
});

layer._replaceFeatureIds(tempObjectIds, newObjectIds, function (success) {
console.log("done replacing feature ids");
layer._replaceFeatureIds(tempObjectIds, newObjectIds, function (count) {
console.log("Done replacing feature ids. Total count = " + count);
});
}

Expand Down Expand Up @@ -1976,17 +1980,8 @@ define([
return r.objectId;
});

layer._replaceFeatureIds(tempObjectIds, newObjectIds, function (success) {

dfd.resolve({
id: id,
layer: layer.url,
tempId: tempObjectIds, // let's us internally match an ADD to it's new ObjectId
addResults: addResults,
updateResults: updateResults,
deleteResults: deleteResults,
syncError: null
});
layer._replaceFeatureIds(tempObjectIds, newObjectIds, function (count) {
console.log("Done replacing feature ids. Total count = " + count);
});
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "esri-offline-maps",
"version": "2.13.1",
"version": "2.14.0",
"description": "Lightweight set of libraries for working offline with map tiles and editing with ArcGIS feature services",
"author": "Andy Gup <[email protected]> (http://blog.andygup.net)",
"license": "Apache 2.0",
Expand Down
5 changes: 5 additions & 0 deletions test/SpecRunner.offlineFeaturesManager.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,12 @@

g_map.addLayers(g_featureLayers);

/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
// To test what happens when you extend library before layers-add-result
// comment this out below and just run test()
g_map.on('layers-add-result', test);
//test()

function test(evt)
{
Expand Down

0 comments on commit 07bfc54

Please sign in to comment.