Skip to content

Commit

Permalink
Merge pull request Esri#1212 from Esri/fix-1207
Browse files Browse the repository at this point in the history
do not clear _currentSnapshot when hiding the layer
  • Loading branch information
gavinr authored Jul 17, 2020
2 parents ef24f95 + c91c320 commit 1232abc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/Layers/FeatureLayer/FeatureGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,9 @@ export var FeatureGrid = Layer.extend({
}

for (i = 0; i < queue.length; i++) {
if (this._activeCells[this._cellCoordsToKey(queue[i])]) {
var _key = this._cellCoordsToKey(queue[i]);
var _coords = this._keyToCellCoords(_key);
if (this._activeCells[_coords]) {
this._reuseCell(queue[i]);
} else {
this._createCell(queue[i]);
Expand Down
7 changes: 3 additions & 4 deletions src/Layers/FeatureLayer/FeatureManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ export var FeatureManager = FeatureGrid.extend({
pendingRequests++;
var coords = this._keyToCellCoords(key);
var bounds = this._cellCoordsToBounds(coords);
this._requestFeatures(bounds, key, requestCallback);
this._requestFeatures(bounds, coords, requestCallback);
}

return this;
Expand Down Expand Up @@ -353,7 +353,7 @@ export var FeatureManager = FeatureGrid.extend({
pendingRequests++;
var coords = this._keyToCellCoords(key);
var bounds = this._cellCoordsToBounds(coords);
this._requestFeatures(bounds, key, requestCallback);
this._requestFeatures(bounds, coords, requestCallback);
}
}

Expand All @@ -364,7 +364,7 @@ export var FeatureManager = FeatureGrid.extend({
for (var key in this._cells) {
var coords = this._keyToCellCoords(key);
var bounds = this._cellCoordsToBounds(coords);
this._requestFeatures(bounds, key);
this._requestFeatures(bounds, coords);
}

if (this.redraw) {
Expand Down Expand Up @@ -502,7 +502,6 @@ export var FeatureManager = FeatureGrid.extend({
_handleZoomChange: function () {
if (!this._visibleZoom()) {
this.removeLayers(this._currentSnapshot);
this._currentSnapshot = [];
} else {
/*
for every cell in this._cells
Expand Down

0 comments on commit 1232abc

Please sign in to comment.