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.0 KiB
1 line
5.0 KiB
2 years ago
|
{"ast":null,"code":"import { createElementObject, createOverlayComponent } from '@react-leaflet/core';\nimport { Tooltip as LeafletTooltip } from 'leaflet';\nimport { useEffect } from 'react';\nexport const Tooltip = createOverlayComponent(function createTooltip(props, context) {\n const tooltip = new LeafletTooltip(props, context.overlayContainer);\n return createElementObject(tooltip, context);\n}, function useTooltipLifecycle(element, context, _ref, setOpen) {\n let {\n position\n } = _ref;\n useEffect(function addTooltip() {\n const container = context.overlayContainer;\n\n if (container == null) {\n return;\n }\n\n const {\n instance\n } = element;\n\n const onTooltipOpen = event => {\n if (event.tooltip === instance) {\n if (position != null) {\n instance.setLatLng(position);\n }\n\n instance.update();\n setOpen(true);\n }\n };\n\n const onTooltipClose = event => {\n if (event.tooltip === instance) {\n setOpen(false);\n }\n };\n\n container.on({\n tooltipopen: onTooltipOpen,\n tooltipclose: onTooltipClose\n });\n container.bindTooltip(instance);\n return function removeTooltip() {\n container.off({\n tooltipopen: onTooltipOpen,\n tooltipclose: onTooltipClose\n }); // @ts-ignore protected property\n\n if (container._map != null) {\n container.unbindTooltip();\n }\n };\n }, [element, context, setOpen, position]);\n});","map":{"version":3,"names":["createElementObject","createOverlayComponent","Tooltip","LeafletTooltip","useEffect","createTooltip","props","context","tooltip","overlayContainer","useTooltipLifecycle","element","setOpen","position","addTooltip","container","instance","onTooltipOpen","event","setLatLng","update","onTooltipClose","on","tooltipopen","tooltipclose","bindTooltip","removeTooltip","off","_map","unbindTooltip"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/node_modules/react-leaflet/lib/Tooltip.js"],"sourcesContent":["import { createElementObject, createOverlayComponent } from '@react-leaflet/core';\nimport { Tooltip as LeafletTooltip } from 'leaflet';\nimport { useEffect } from 'react';\nexport const Tooltip = createOverlayComponent(function createTooltip(props, context) {\n const tooltip = new LeafletTooltip(props, context.overlayContainer);\n return createElementObject(tooltip, context);\n}, function useTooltipLifecycle(element, context, { position }, setOpen) {\n useEffect(function addTooltip() {\n const container = context.overlayContainer;\n if (container == null) {\n return;\n }\n const { instance } = element;\n const onTooltipOpen = (event)=>{\n if (event.tooltip === instance) {\n if (position != null) {\n instance.setLatLng(position);\n }\n instance.update();\n setOpen(true);\n }\n };\n const onTooltipClose = (event)=>{\n if (event.tooltip === instance) {\n setOpen(false);\n }\n };\n container.on({\n tooltipopen: onTooltipOpen,\n tooltipclose: onTooltipClose\n });\n container.bindTooltip(instance);\n return function removeTooltip() {\n container.off({\n tooltipopen: onTooltipOpen,\n tooltipclose: onTooltipClose\n });\n // @ts-ignore protected property\n if (container._map != null) {\n container.unbindTooltip();\n }\n };\n }, [\n element,\n context,\n setOpen,\n position\n ]);\n});\n"],"mappings":"AAAA,SAASA,mBAAT,EAA8BC,sBAA9B,QAA4D,qBAA5D;AACA,SAASC,OAAO,IAAIC,cAApB,QAA0C,SAA1C;AACA,SAASC,SAAT,QAA0B,OAA1B;AACA,OAAO,MAAMF,OAAO,GAAGD,sBAAsB,CAAC,SAASI,aAAT,CAAuBC,KAAvB,EAA8BC,OAA9B,EAAuC;EACjF,MAAMC,OAAO,GAAG,IAAIL,cAAJ,CAAmBG,KAAnB,EAA0BC,OAAO,CAACE,gBAAlC,CAAhB;EACA,OAAOT,mBAAmB,C
|