Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added zoom level to reloading images #964

Merged
merged 5 commits into from
Jun 15, 2017
Merged

added zoom level to reloading images #964

merged 5 commits into from
Jun 15, 2017

Conversation

jordanparfitt
Copy link
Contributor

My layers were reappearing when we set definition queries on invisible layers

My layers were reappearing when we set definition queries on invisible layers
@@ -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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The zoom variable here is undefined. Is this supposed to be the current zoom level of the map (i.e. map.getZoom())?

@jordanparfitt
Copy link
Contributor Author

jordanparfitt commented Jun 8, 2017 via email

@jgravois
Copy link
Contributor

thx @jordanparfitt! i'm traveling at the moment, but i'll be able to review this soon.

Copy link
Contributor

@jgravois jgravois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for catching this.

the fix would be more DRY if you reused FeatureManager._visibleZoom()

it'd also be a bit tidier to append the condition to the exterior conditional block thats already present.

if (pendingRequests <= 0 && _visibleZoom()) {

used built in method _visibleZoom() instead of cheacking map
Copy link
Contributor

@jgravois jgravois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me know after you're able to test my own suggestions locally and confirm that they have the appropriate affect (and don't cause any other problems).

@@ -235,12 +235,12 @@ export var FeatureManager = VirtualGrid.extend({

pendingRequests--;

if (pendingRequests <= 0) {
if (pendingRequests <= 0 && _visibleZoom()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as you can see in the failing test, _visibleZoom isn't defined.

that was a typo on my part. you need to use 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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a tad too much indentation here.

Fixed indentation, added this. to be consistent with other calls to _visibleZoom()
@jordanparfitt
Copy link
Contributor Author

jordanparfitt commented Jun 15, 2017 via email

@jgravois
Copy link
Contributor

Why'd it fail?

gremlins

@jgravois jgravois merged commit 0da3cf7 into Esri:master Jun 15, 2017
@jordanparfitt
Copy link
Contributor Author

I double checked this morning and it fixed my issue with the new changes. Thanks!

jgravois added a commit to jgravois/esri-leaflet that referenced this pull request Apr 23, 2022
added conditional check to avoid reloading features outside a constrained zoom level when new SQL filters are applied.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants