From 17dad8342b5b831a5490d15d54b5d5a793457494 Mon Sep 17 00:00:00 2001 From: Jordan Date: Wed, 7 Jun 2017 10:14:31 -0600 Subject: [PATCH 1/5] added zoom level to reloading images My layers were reappearing when we set definition queries on invisible layers --- src/Layers/FeatureLayer/FeatureManager.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Layers/FeatureLayer/FeatureManager.js b/src/Layers/FeatureLayer/FeatureManager.js index 43ad35387..e9040d215 100644 --- a/src/Layers/FeatureLayer/FeatureManager.js +++ b/src/Layers/FeatureLayer/FeatureManager.js @@ -240,7 +240,9 @@ export var FeatureManager = VirtualGrid.extend({ // schedule adding features for the next animation frame Util.requestAnimFrame(Util.bind(function () { this.removeLayers(oldSnapshot); - this.addLayers(newSnapshot); + if (zoom < this.options.maxZoom && zoom > this.options.minZoom) { + this.addLayers(newSnapshot); + } if (callback) { callback.call(context, requestError); } From 91737962201e4ceda42b60d8d2ad3bd71830808d Mon Sep 17 00:00:00 2001 From: Jordan Parfitt Date: Thu, 8 Jun 2017 14:59:45 -0600 Subject: [PATCH 2/5] Create FeatureManager.js --- src/Layers/FeatureLayer/FeatureManager.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Layers/FeatureLayer/FeatureManager.js b/src/Layers/FeatureLayer/FeatureManager.js index e9040d215..58f3d556b 100644 --- a/src/Layers/FeatureLayer/FeatureManager.js +++ b/src/Layers/FeatureLayer/FeatureManager.js @@ -240,6 +240,7 @@ export var FeatureManager = VirtualGrid.extend({ // schedule adding features for the next animation frame Util.requestAnimFrame(Util.bind(function () { this.removeLayers(oldSnapshot); + var zoom = this._map.getZoom(); if (zoom < this.options.maxZoom && zoom > this.options.minZoom) { this.addLayers(newSnapshot); } From 25e877b99441018db9a08e168b217e1915d0bf02 Mon Sep 17 00:00:00 2001 From: Jordan Parfitt Date: Thu, 8 Jun 2017 15:01:42 -0600 Subject: [PATCH 3/5] Create FeatureManager.js --- src/Layers/FeatureLayer/FeatureManager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Layers/FeatureLayer/FeatureManager.js b/src/Layers/FeatureLayer/FeatureManager.js index 58f3d556b..581c0a588 100644 --- a/src/Layers/FeatureLayer/FeatureManager.js +++ b/src/Layers/FeatureLayer/FeatureManager.js @@ -240,7 +240,7 @@ export var FeatureManager = VirtualGrid.extend({ // schedule adding features for the next animation frame Util.requestAnimFrame(Util.bind(function () { this.removeLayers(oldSnapshot); - var zoom = this._map.getZoom(); + var zoom = this._map.getZoom(); if (zoom < this.options.maxZoom && zoom > this.options.minZoom) { this.addLayers(newSnapshot); } From b414c54869c9f66eae800abae53ae41d0df9d954 Mon Sep 17 00:00:00 2001 From: Jordan Parfitt Date: Thu, 15 Jun 2017 15:10:25 -0600 Subject: [PATCH 4/5] Create FeatureManager.js used built in method _visibleZoom() instead of cheacking map --- src/Layers/FeatureLayer/FeatureManager.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Layers/FeatureLayer/FeatureManager.js b/src/Layers/FeatureLayer/FeatureManager.js index 581c0a588..61fe1a7c1 100644 --- a/src/Layers/FeatureLayer/FeatureManager.js +++ b/src/Layers/FeatureLayer/FeatureManager.js @@ -235,15 +235,12 @@ export var FeatureManager = VirtualGrid.extend({ pendingRequests--; - if (pendingRequests <= 0) { + if (pendingRequests <= 0 && _visibleZoom()) { this._currentSnapshot = newSnapshot; // schedule adding features for the next animation frame Util.requestAnimFrame(Util.bind(function () { this.removeLayers(oldSnapshot); - var zoom = this._map.getZoom(); - if (zoom < this.options.maxZoom && zoom > this.options.minZoom) { this.addLayers(newSnapshot); - } if (callback) { callback.call(context, requestError); } From 4e8d5206be279c3e340599129793120d8670ea84 Mon Sep 17 00:00:00 2001 From: Jordan Parfitt Date: Thu, 15 Jun 2017 15:28:28 -0600 Subject: [PATCH 5/5] Create FeatureManager.js Fixed indentation, added this. to be consistent with other calls to _visibleZoom() --- src/Layers/FeatureLayer/FeatureManager.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Layers/FeatureLayer/FeatureManager.js b/src/Layers/FeatureLayer/FeatureManager.js index 61fe1a7c1..6680c909b 100644 --- a/src/Layers/FeatureLayer/FeatureManager.js +++ b/src/Layers/FeatureLayer/FeatureManager.js @@ -235,12 +235,12 @@ export var FeatureManager = VirtualGrid.extend({ pendingRequests--; - if (pendingRequests <= 0 && _visibleZoom()) { + if (pendingRequests <= 0 && this._visibleZoom()) { this._currentSnapshot = newSnapshot; // schedule adding features for the next animation frame Util.requestAnimFrame(Util.bind(function () { this.removeLayers(oldSnapshot); - this.addLayers(newSnapshot); + this.addLayers(newSnapshot); if (callback) { callback.call(context, requestError); }