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

Correctly update layer control widget when visible layers change #702

Closed
wants to merge 32 commits into from

Conversation

duckblaster
Copy link
Contributor

Correctly update layer control widget when calling setVisibleLayers() on a dynamic layer, fixes #700

Correctly update layer control widget when calling `setVisibleLayers()` on a dynamic layer, fixes cmv#700
if (!setLayers.length) {
setLayers.push(-1);
}
return setLayers
Copy link
Member

Choose a reason for hiding this comment

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

Missing semicolon here

@tmcgee
Copy link
Member

tmcgee commented Mar 21, 2017

So based on the response from @roemhildtg on issue #700, there's nothing to do here, correct?

@duckblaster
Copy link
Contributor Author

duckblaster commented Mar 21, 2017 via email

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]);
Copy link
Member

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) {
Copy link
Member

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) {

Copy link
Member

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)

@tmcgee
Copy link
Member

tmcgee commented Feb 6, 2018

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?

@duckblaster
Copy link
Contributor Author

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.

@tmcgee
Copy link
Member

tmcgee commented Feb 6, 2018

@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.

@tmcgee tmcgee closed this Feb 6, 2018
@duckblaster duckblaster deleted the fix-layer-control-widget branch November 14, 2018 22:44
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.

Calling setVisibleLayers() on a dynamic layer does not correctly update layer control widget
4 participants