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
5.1 KiB

{"ast":null,"code":"import { createElementObject, createOverlayComponent } from '@react-leaflet/core';\nimport { Popup as LeafletPopup } from 'leaflet';\nimport { useEffect } from 'react';\nexport const Popup = createOverlayComponent(function createPopup(props, context) {\n const popup = new LeafletPopup(props, context.overlayContainer);\n return createElementObject(popup, context);\n}, function usePopupLifecycle(element, context, _ref, setOpen) {\n let {\n position\n } = _ref;\n useEffect(function addPopup() {\n const {\n instance\n } = element;\n\n function onPopupOpen(event) {\n if (event.popup === instance) {\n instance.update();\n setOpen(true);\n }\n }\n\n function onPopupClose(event) {\n if (event.popup === instance) {\n setOpen(false);\n }\n }\n\n context.map.on({\n popupopen: onPopupOpen,\n popupclose: onPopupClose\n });\n\n if (context.overlayContainer == null) {\n // Attach to a Map\n if (position != null) {\n instance.setLatLng(position);\n }\n\n instance.openOn(context.map);\n } else {\n // Attach to container component\n context.overlayContainer.bindPopup(instance);\n }\n\n return function removePopup() {\n context.map.off({\n popupopen: onPopupOpen,\n popupclose: onPopupClose\n });\n context.overlayContainer?.unbindPopup();\n context.map.removeLayer(instance);\n };\n }, [element, context, setOpen, position]);\n});","map":{"version":3,"names":["createElementObject","createOverlayComponent","Popup","LeafletPopup","useEffect","createPopup","props","context","popup","overlayContainer","usePopupLifecycle","element","setOpen","position","addPopup","instance","onPopupOpen","event","update","onPopupClose","map","on","popupopen","popupclose","setLatLng","openOn","bindPopup","removePopup","off","unbindPopup","removeLayer"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/node_modules/react-leaflet/lib/Popup.js"],"sourcesContent":["import { createElementObject, createOverlayComponent } from '@react-leaflet/core';\nimport { Popup as LeafletPopup } from 'leaflet';\nimport { useEffect } from 'react';\nexport const Popup = createOverlayComponent(function createPopup(props, context) {\n const popup = new LeafletPopup(props, context.overlayContainer);\n return createElementObject(popup, context);\n}, function usePopupLifecycle(element, context, { position }, setOpen) {\n useEffect(function addPopup() {\n const { instance } = element;\n function onPopupOpen(event) {\n if (event.popup === instance) {\n instance.update();\n setOpen(true);\n }\n }\n function onPopupClose(event) {\n if (event.popup === instance) {\n setOpen(false);\n }\n }\n context.map.on({\n popupopen: onPopupOpen,\n popupclose: onPopupClose\n });\n if (context.overlayContainer == null) {\n // Attach to a Map\n if (position != null) {\n instance.setLatLng(position);\n }\n instance.openOn(context.map);\n } else {\n // Attach to container component\n context.overlayContainer.bindPopup(instance);\n }\n return function removePopup() {\n context.map.off({\n popupopen: onPopupOpen,\n popupclose: onPopupClose\n });\n context.overlayContainer?.unbindPopup();\n context.map.removeLayer(instance);\n };\n }, [\n element,\n context,\n setOpen,\n position\n ]);\n});\n"],"mappings":"AAAA,SAASA,mBAAT,EAA8BC,sBAA9B,QAA4D,qBAA5D;AACA,SAASC,KAAK,IAAIC,YAAlB,QAAsC,SAAtC;AACA,SAASC,SAAT,QAA0B,OAA1B;AACA,OAAO,MAAMF,KAAK,GAAGD,sBAAsB,CAAC,SAASI,WAAT,CAAqBC,KAArB,EAA4BC,OAA5B,EAAqC;EAC7E,MAAMC,KAAK,GAAG,IAAIL,YAAJ,CAAiBG,KAAjB,EAAwBC,OAAO,CAACE,gBAAhC,CAAd;EACA,OAAOT,mBAAmB,CAACQ,KAAD,EAAQD,OAAR,CAA1B;AACH,CAH0C,EAGxC,SAASG,iBAAT,CAA2BC,OAA3B,EAAoCJ,OAApC,QAA4DK,OAA5D,EAAqE;EAAA,IAAxB;IAAEC;EAAF,CAAwB;EACpET,SAAS,CAAC,SAASU,QAAT,GAAoB;IAC1B,MAAM;MAAEC;IAAF,IAAgBJ,OAAtB;;IACA,SAASK,WAAT,CAAqBC,KAArB,EAA4B;MACxB,IAAIA,KAAK,CAACT,KAAN,KAAgBO,QAApB,EAA8B;QAC1BA,QAAQ,CAACG,MAAT;QACAN,OAAO,CAAC,IAAD,CAAP;MACH;IACJ;;IACD,SAASO,YAAT,CAAsBF,KAAtB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