I have a similar problem as this question from almost 7 years ago: Rewrite Leaflet event
Except I want to extend the boxZoom
handler in react-leaflet.
Specifically I want to modify the boxZoom._onMouseUp
method to use a different key and to not zoom in.
I tried modifying the MapContainer's ref, I tried using useMap()
and useMapEvents()
hooks.
As far as I know the MapContainer component is immutable and it uses the default Map object from 'leaflet' package, so I don't know how to replace it.