MCPcopy
hub / github.com/PaulLeCam/react-leaflet / useMapEvents

Function useMapEvents

packages/react-leaflet/src/hooks.ts:31–46  ·  view source on GitHub ↗
(handlers: LeafletEventHandlerFnMap)

Source from the content-addressed store, hash-verified

29}
30
31export 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}

Callers

nothing calls this directly

Calls 1

useMapFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…