Leaflet layer control collapse/expand only on click

Viewed 17

using "d3": "^7.6.1", "leaflet": "^1.8.0" in a project. i have added a control layer on the top right of the map. on desktop browsers, i want to disable the control from expanding/collapsing when i move the mouse in or out the control box. However, i want it to respond only on clicks. click to collapse, click to expand. defauly should be collapsed (that can be set in the options object when i create the control element). i have searched online for possible solutions, tried them, but had no luck in the process.

any help would be appreciated.

0 Answers
Related