-
-
Notifications
You must be signed in to change notification settings - Fork 278
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
Correctly update layer control widget when visible layers change #702
Conversation
Correctly update layer control widget when calling `setVisibleLayers()` on a dynamic layer, fixes cmv#700
if (!setLayers.length) { | ||
setLayers.push(-1); | ||
} | ||
return setLayers |
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.
Missing semicolon here
So based on the response from @roemhildtg on issue #700, there's nothing to do here, correct? |
No, it's still broken, try 1,2,3 in the array instead
On Wed, 22 Mar 2017 at 6:35 AM, Tim McGee <[email protected]> wrote:
So based on the response from @roemhildtg <https://github.com/roemhildtg>
on issue #700 <#700>, there's nothing
to do here, correct?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#702 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAibYwjZcmZyi-M41pFl41wnpw0-MsOWks5roAppgaJpZM4MjPFz>
.
|
this._visLayersHandler = aspect.around(this.layer, 'setVisibleLayers', lang.hitch(this, function (originalSetVisibleLayers) { | ||
return function (visibleLayers) { | ||
var setLayers = lang.hitch(self, self._visibleLayersToSetLayers)(visibleLayers); | ||
originalSetVisibleLayers.apply(this, [setLayers]); |
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.
This line shouldn't pass the modified setLayers, it should pass the visibleLayers that the api expects to receive.
_aspectSetVisibleLayers: function () { | ||
var self = this; | ||
this._visLayersHandler = aspect.around(this.layer, 'setVisibleLayers', lang.hitch(this, function (originalSetVisibleLayers) { | ||
return function (visibleLayers) { |
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.
this should probably be return lang.hitch(this, function(visibleLayers) {
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.
And eliminate the use of self
(for consistency)
Now that PR #747 was finally merged into the develop branch, it is time to revisit this PR and issue #700 . I'm trying to remember if it was addressed in #747. I am thinking it was (though done slightly different) but may be mistaken. @duckblaster @roemhildtg thoughts? |
I think this PR can be scrapped, but we need a way to get and set the layer settings as shown to the user for the AppSettings widget, which is what this PR attempted to do. |
@duckblaster thanks. I'll let you and @roemhildtg work through the next steps on improvements related to the AppSettings widget whether that is here in CMV core and/or an update to the widget. |
Correctly update layer control widget when calling
setVisibleLayers()
on a dynamic layer, fixes #700