-
Notifications
You must be signed in to change notification settings - Fork 195
Update event: setLegendElemsState accepts object #114
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
Update event: setLegendElemsState accepts object #114
Conversation
}); | ||
if (typeof opt != "undefined" && typeof opt.setLegendElemsState === "object") { | ||
// setLegendElemsState is an object listing the legend we want to hide/show | ||
var $container = $(this); // save this before each for use in callback |
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.
I think you could use the already defined variable $self instead of $container here
Right! This would be better :-) What do you think now? |
It's ok for me :) However, I think that you should provide a new example in the 'advanced' directory for the demo because the 'basic' directory should stand for basic examples that only involve configuration without extra JS code. |
Right :-) done! |
Thank you, I merge your PR ! |
…State-object Update event: setLegendElemsState accepts object
Before, it was only possible to show/hide all legends at once.
But there can be multiple legends on a map (example: http://jsfiddle.net/neveldo/VqwUZ/ or http://jsfiddle.net/neveldo/xd2azoxL). Maybe the user want to show/hide all elements of one of these legends?
Hence the
setLegendElemsState
is extended to allow the following:The user pass the CSS class name of the legend it want to show/hide.
Implements #110 First point.