Closed joakimkejser closed 7 years ago
At the moment, this behavior should be controllable via CSS. I'll post an example soon. Thanks for the continued feedback/ideas. I think an option to disable the default behavior programmatically is a great idea.
Great - looking forward to the example.
I can give the implementation of the option a shot towards the 1.0dev branch if it is helpful to you?
If you want to add an implementation of that option, that would be awesome! Thanks for helping out. Using CSS, you can do this:
.leaflet-control-legend {
max-height: <value>
}
Just make value
some value that's larger than your content e.g., 500px or 50%. The larger
class just sets max-height
to 50%.
@sfairgrieve I've given it a shot, adding an toggleSize
options that defaults to true, leaving behaviour unchanged compared to now. If set to false, no events will be bound to L.Control.Legend
's toggleSize
method. If you have any inputs on i.e. better option naming, just let me know.
Thanks for the CSS example. I also discovered in the armedconflicts example that this does the job:
.leaflet-control-legend {
max-height: none !important;
}
Cheers!
Hi,
To my knowledge, it is currently not possible to force the
L.Control.Legend
to stay "large", as the 'larger' CSS class is toggled on mousover/out.Is there a specific reason as to why this is not possible? If not, I would like to suggest an option to disable the toggling behavior and keep the legend large at all times, similar to the "collapsed" options of the
L.control.layers
.Implementation wise it looks pretty simple - only binding events to the
toggleSize
function if some option property is true, which could be the default, and adding the CSS class to the container if the option is false.