-
Notifications
You must be signed in to change notification settings - Fork 799
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
Conversation
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) { |
There was a problem hiding this comment.
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()
)?
My fault... copy and paste error.... I think i fixed it
…On Thu, Jun 8, 2017 at 2:56 PM, Nick Peihl ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/Layers/FeatureLayer/FeatureManager.js
<#964 (comment)>:
> @@ -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) {
The zoom variable here is undefined. Is this supposed to be the current
zoom level of the map (i.e. map.getZoom()
<http://leafletjs.com/reference-1.0.3.html#map-getzoom>)?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#964 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABLNpr2krpIhH-roBOTbqDEuvc2DdWG9ks5sCGANgaJpZM4N0E_O>
.
--
|
thx @jordanparfitt! i'm traveling at the moment, but i'll be able to review this soon. |
There was a problem hiding this 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
There was a problem hiding this 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()) { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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()
Why'd it fail?
…On Thu, Jun 15, 2017 at 3:17 PM, john gravois ***@***.***> wrote:
***@***.**** requested changes on this pull request.
let me know after you're able to test my own changes locally and confirm
that they have the appropriate affect (and don't cause any other problems).
------------------------------
In src/Layers/FeatureLayer/FeatureManager.js
<#964 (comment)>:
> @@ -235,12 +235,12 @@ export var FeatureManager = VirtualGrid.extend({
pendingRequests--;
- if (pendingRequests <= 0) {
+ if (pendingRequests <= 0 && _visibleZoom()) {
as you can see in the failing test
<https://travis-ci.org/Esri/esri-leaflet/builds/243430000>, _visibleZoom
isn't defined.
that was a typo on my part. you need to use this._visibleZoom.
------------------------------
In src/Layers/FeatureLayer/FeatureManager.js
<#964 (comment)>:
> 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);
just a tad too much indentation here.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#964 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABLNpusIRYGC6D5jVRFLiE50FYwoADasks5sEZ9hgaJpZM4N0E_O>
.
|
I double checked this morning and it fixed my issue with the new changes. Thanks! |
added conditional check to avoid reloading features outside a constrained zoom level when new SQL filters are applied.
My layers were reappearing when we set definition queries on invisible layers