-
Notifications
You must be signed in to change notification settings - Fork 456
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
controlbar.js: toggleOne does not work for sub-control-bars #7
Comments
Hi, var subBar = new ol.control.Bar ({ toggleOne: true });
parentBar.addControl (myControl, subBar);
subBar.addControl (control1);
subBar.addControl (control2); This will make I'll try to take the issue on next commit. |
OK, I dug a little more and figured it out. The order of calls has to be to add the sub-control-bar to the main control bar BEFORE adding any controls to the sub-control-bar. That is, the order has to be:
None of the examples of a sub-control-bar in map.control.bar.html illustrate the use of toggleOne in this context. And since I was patterning my code after your 'sbar' example, toggleOne did not work for me. You may want to consider adding an example that shows the use of toggleOne with a sub-control-bar. Otherwise, great tool! Thanks so much! |
Oops! Sorry Viglino. I did not see your reply before writing my post. Thanks very much for the confirmation. Best, |
The last commit solve this issue. An example has been added in http://viglino.github.io/ol3-ext/examples/map.control.bar.html. |
Hi,
I am making good use of your controlbar.js utility, and when I create a sub-control-bar (following your exmaple - see attached file), I define it as having "toggleOne: true" (the same as for the main control bar). However, while toggleOne works correctly for the main control bar, when I click on the various sub-control-bar items (e.g., polygon, circle, square), none of them fire ol.control.Bar.prototype.onActivateControl. As a result, the newly activated control is simply added to the previously activated control, which is not what I intended.
Before digging into it much deeper, I thought I'd ask if this is how it is supposed to work (i.e., that toggleOne is only supported for the main control bar), or whether this is a bug.
I'm happy to do more digging, but thought I should check with you first.
Thanks,
Dennis
The text was updated successfully, but these errors were encountered: