(handlers: LeafletEventHandlerFnMap)
| 29 | } |
| 30 | |
| 31 | export function useMapEvents(handlers: LeafletEventHandlerFnMap): LeafletMap { |
| 32 | const map = useMap() |
| 33 | |
| 34 | useEffect( |
| 35 | function addMapEventHandlers() { |
| 36 | map.on(handlers) |
| 37 | |
| 38 | return function removeMapEventHandlers() { |
| 39 | map.off(handlers) |
| 40 | } |
| 41 | }, |
| 42 | [map, handlers], |
| 43 | ) |
| 44 | |
| 45 | return map |
| 46 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…