From 131371c1a6ba2a7321a0688446c06898a9c067b6 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 21a750aa8c67fb5f385b3d064609478d5a23a316 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 1388c7ac91e643e2c536144522d0ce481d8fe832 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 e78482ef8f8f5f24d4fcf944e31d0c5a078e0659 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 12cf18bfa121938a43fd0aaf37a8e418e2710f67 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); }