You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
2.8 KiB
1 lines
2.8 KiB
{"ast":null,"code":"import { useLeafletContext } from '@react-leaflet/core';\nimport { useEffect } from 'react';\nexport function useMap() {\n return useLeafletContext().map;\n}\nexport function useMapEvent(type, handler) {\n const map = useMap();\n useEffect(function addMapEventHandler() {\n // @ts-ignore event type\n map.on(type, handler);\n return function removeMapEventHandler() {\n // @ts-ignore event type\n map.off(type, handler);\n };\n }, [map, type, handler]);\n return map;\n}\nexport function useMapEvents(handlers) {\n const map = useMap();\n useEffect(function addMapEventHandlers() {\n map.on(handlers);\n return function removeMapEventHandlers() {\n map.off(handlers);\n };\n }, [map, handlers]);\n return map;\n}","map":{"version":3,"names":["useLeafletContext","useEffect","useMap","map","useMapEvent","type","handler","addMapEventHandler","on","removeMapEventHandler","off","useMapEvents","handlers","addMapEventHandlers","removeMapEventHandlers"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/node_modules/react-leaflet/lib/hooks.js"],"sourcesContent":["import { useLeafletContext } from '@react-leaflet/core';\nimport { useEffect } from 'react';\nexport function useMap() {\n return useLeafletContext().map;\n}\nexport function useMapEvent(type, handler) {\n const map = useMap();\n useEffect(function addMapEventHandler() {\n // @ts-ignore event type\n map.on(type, handler);\n return function removeMapEventHandler() {\n // @ts-ignore event type\n map.off(type, handler);\n };\n }, [\n map,\n type,\n handler\n ]);\n return map;\n}\nexport function useMapEvents(handlers) {\n const map = useMap();\n useEffect(function addMapEventHandlers() {\n map.on(handlers);\n return function removeMapEventHandlers() {\n map.off(handlers);\n };\n }, [\n map,\n handlers\n ]);\n return map;\n}\n"],"mappings":"AAAA,SAASA,iBAAT,QAAkC,qBAAlC;AACA,SAASC,SAAT,QAA0B,OAA1B;AACA,OAAO,SAASC,MAAT,GAAkB;EACrB,OAAOF,iBAAiB,GAAGG,GAA3B;AACH;AACD,OAAO,SAASC,WAAT,CAAqBC,IAArB,EAA2BC,OAA3B,EAAoC;EACvC,MAAMH,GAAG,GAAGD,MAAM,EAAlB;EACAD,SAAS,CAAC,SAASM,kBAAT,GAA8B;IACpC;IACAJ,GAAG,CAACK,EAAJ,CAAOH,IAAP,EAAaC,OAAb;IACA,OAAO,SAASG,qBAAT,GAAiC;MACpC;MACAN,GAAG,CAACO,GAAJ,CAAQL,IAAR,EAAcC,OAAd;IACH,CAHD;EAIH,CAPQ,EAON,CACCH,GADD,EAECE,IAFD,EAGCC,OAHD,CAPM,CAAT;EAYA,OAAOH,GAAP;AACH;AACD,OAAO,SAASQ,YAAT,CAAsBC,QAAtB,EAAgC;EACnC,MAAMT,GAAG,GAAGD,MAAM,EAAlB;EACAD,SAAS,CAAC,SAASY,mBAAT,GAA+B;IACrCV,GAAG,CAACK,EAAJ,CAAOI,QAAP;IACA,OAAO,SAASE,sBAAT,GAAkC;MACrCX,GAAG,CAACO,GAAJ,CAAQE,QAAR;IACH,CAFD;EAGH,CALQ,EAKN,CACCT,GADD,EAECS,QAFD,CALM,CAAT;EASA,OAAOT,GAAP;AACH"},"metadata":{},"sourceType":"module"} |