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

2 years ago
{"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,OA