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
6.8 KiB
1 lines
6.8 KiB
{"ast":null,"code":"function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nimport { LeafletProvider, createLeafletContext } from '@react-leaflet/core';\nimport { Map as LeafletMap } from 'leaflet';\nimport React, { forwardRef, useCallback, useEffect, useImperativeHandle, useState } from 'react';\n\nfunction MapContainerComponent(_ref, forwardedRef) {\n let {\n bounds,\n boundsOptions,\n center,\n children,\n className,\n id,\n placeholder,\n style,\n whenReady,\n zoom,\n ...options\n } = _ref;\n const [props] = useState({\n className,\n id,\n style\n });\n const [context, setContext] = useState(null);\n useImperativeHandle(forwardedRef, () => context?.map ?? null, [context]);\n const mapRef = useCallback(node => {\n if (node !== null && context === null) {\n const map = new LeafletMap(node, options);\n\n if (center != null && zoom != null) {\n map.setView(center, zoom);\n } else if (bounds != null) {\n map.fitBounds(bounds, boundsOptions);\n }\n\n if (whenReady != null) {\n map.whenReady(whenReady);\n }\n\n setContext(createLeafletContext(map));\n }\n }, []);\n useEffect(() => {\n return () => {\n context?.map.remove();\n };\n }, [context]);\n const contents = context ? /*#__PURE__*/React.createElement(LeafletProvider, {\n value: context\n }, children) : placeholder ?? null;\n return /*#__PURE__*/React.createElement(\"div\", _extends({}, props, {\n ref: mapRef\n }), contents);\n}\n\nexport const MapContainer = /*#__PURE__*/forwardRef(MapContainerComponent);","map":{"version":3,"names":["_extends","Object","assign","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","LeafletProvider","createLeafletContext","Map","LeafletMap","React","forwardRef","useCallback","useEffect","useImperativeHandle","useState","MapContainerComponent","forwardedRef","bounds","boundsOptions","center","children","className","id","placeholder","style","whenReady","zoom","options","props","context","setContext","map","mapRef","node","setView","fitBounds","remove","contents","createElement","value","ref","MapContainer"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/node_modules/react-leaflet/lib/MapContainer.js"],"sourcesContent":["function _extends() {\n _extends = Object.assign || function(target) {\n for(var i = 1; i < arguments.length; i++){\n var source = arguments[i];\n for(var key in source){\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\nimport { LeafletProvider, createLeafletContext } from '@react-leaflet/core';\nimport { Map as LeafletMap } from 'leaflet';\nimport React, { forwardRef, useCallback, useEffect, useImperativeHandle, useState } from 'react';\nfunction MapContainerComponent({ bounds , boundsOptions , center , children , className , id , placeholder , style , whenReady , zoom , ...options }, forwardedRef) {\n const [props] = useState({\n className,\n id,\n style\n });\n const [context, setContext] = useState(null);\n useImperativeHandle(forwardedRef, ()=>context?.map ?? null, [\n context\n ]);\n const mapRef = useCallback((node)=>{\n if (node !== null && context === null) {\n const map = new LeafletMap(node, options);\n if (center != null && zoom != null) {\n map.setView(center, zoom);\n } else if (bounds != null) {\n map.fitBounds(bounds, boundsOptions);\n }\n if (whenReady != null) {\n map.whenReady(whenReady);\n }\n setContext(createLeafletContext(map));\n }\n }, []);\n useEffect(()=>{\n return ()=>{\n context?.map.remove();\n };\n }, [\n context\n ]);\n const contents = context ? /*#__PURE__*/ React.createElement(LeafletProvider, {\n value: context\n }, children) : placeholder ?? null;\n return /*#__PURE__*/ React.createElement(\"div\", _extends({}, props, {\n ref: mapRef\n }), contents);\n}\nexport const MapContainer = /*#__PURE__*/ forwardRef(MapContainerComponent);\n"],"mappings":"AAAA,SAASA,QAAT,GAAoB;EAChBA,QAAQ,GAAGC,MAAM,CAACC,MAAP,IAAiB,UAASC,MAAT,EAAiB;IACzC,KAAI,IAAIC,CAAC,GAAG,CAAZ,EAAeA,CAAC,GAAGC,SAAS,CAACC,MAA7B,EAAqCF,CAAC,EAAtC,EA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