@performant-software/geospatial 2.2.20-beta.6 → 2.2.21-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/dist/index.cjs14.js +1 -1
  2. package/dist/index.cjs15.js +1 -1
  3. package/dist/index.cjs16.js +1 -1
  4. package/dist/index.cjs17.js +1 -1
  5. package/dist/index.cjs19.js +1 -1
  6. package/dist/index.cjs20.js +1 -1
  7. package/dist/index.cjs207.js +1 -1
  8. package/dist/index.cjs208.js +1 -1
  9. package/dist/index.cjs209.js +1 -1
  10. package/dist/index.cjs21.js +1 -1
  11. package/dist/index.cjs227.js +1 -1
  12. package/dist/index.cjs235.js +1 -1
  13. package/dist/index.cjs235.js.map +1 -1
  14. package/dist/index.cjs236.js +1 -1
  15. package/dist/index.cjs236.js.map +1 -1
  16. package/dist/index.cjs244.js +1 -1
  17. package/dist/index.cjs249.js +1 -1
  18. package/dist/index.cjs252.js +1 -1
  19. package/dist/index.cjs256.js +1 -1
  20. package/dist/index.cjs256.js.map +1 -1
  21. package/dist/index.cjs257.js +1 -1
  22. package/dist/index.cjs257.js.map +1 -1
  23. package/dist/index.cjs51.js +1 -1
  24. package/dist/index.cjs58.js +1 -1
  25. package/dist/index.cjs59.js +1 -9
  26. package/dist/index.cjs59.js.map +1 -1
  27. package/dist/index.cjs60.js +1 -19
  28. package/dist/index.cjs60.js.map +1 -1
  29. package/dist/index.cjs61.js +9 -1
  30. package/dist/index.cjs61.js.map +1 -1
  31. package/dist/index.cjs62.js +19 -1
  32. package/dist/index.cjs62.js.map +1 -1
  33. package/dist/index.cjs63.js +1 -1
  34. package/dist/index.cjs63.js.map +1 -1
  35. package/dist/index.cjs64.js +1 -1
  36. package/dist/index.cjs64.js.map +1 -1
  37. package/dist/index.cjs66.js +1 -1
  38. package/dist/index.cjs66.js.map +1 -1
  39. package/dist/index.cjs67.js +1 -1
  40. package/dist/index.cjs67.js.map +1 -1
  41. package/dist/index.cjs68.js +1 -1
  42. package/dist/index.cjs68.js.map +1 -1
  43. package/dist/index.cjs69.js +1 -1
  44. package/dist/index.cjs69.js.map +1 -1
  45. package/dist/index.cjs70.js +1 -1
  46. package/dist/index.cjs70.js.map +1 -1
  47. package/dist/index.cjs71.js +1 -1
  48. package/dist/index.cjs71.js.map +1 -1
  49. package/dist/index.cjs72.js +1 -1
  50. package/dist/index.cjs72.js.map +1 -1
  51. package/dist/index.cjs73.js +1 -1
  52. package/dist/index.cjs73.js.map +1 -1
  53. package/dist/index.cjs74.js +1 -1
  54. package/dist/index.cjs74.js.map +1 -1
  55. package/dist/index.cjs75.js +1 -1
  56. package/dist/index.cjs75.js.map +1 -1
  57. package/dist/index.cjs76.js +1 -1
  58. package/dist/index.cjs76.js.map +1 -1
  59. package/dist/index.cjs78.js +1 -1
  60. package/dist/index.cjs79.js +1 -1
  61. package/dist/index.es14.js +2 -2
  62. package/dist/index.es15.js +5 -5
  63. package/dist/index.es16.js +1 -1
  64. package/dist/index.es17.js +3 -3
  65. package/dist/index.es19.js +2 -2
  66. package/dist/index.es20.js +2 -2
  67. package/dist/index.es207.js +1 -1
  68. package/dist/index.es208.js +1 -1
  69. package/dist/index.es209.js +1 -1
  70. package/dist/index.es21.js +2 -2
  71. package/dist/index.es227.js +1 -1
  72. package/dist/index.es235.js +6 -4
  73. package/dist/index.es235.js.map +1 -1
  74. package/dist/index.es236.js +4 -6
  75. package/dist/index.es236.js.map +1 -1
  76. package/dist/index.es244.js +1 -1
  77. package/dist/index.es249.js +1 -1
  78. package/dist/index.es252.js +1 -1
  79. package/dist/index.es256.js +15 -4
  80. package/dist/index.es256.js.map +1 -1
  81. package/dist/index.es257.js +4 -15
  82. package/dist/index.es257.js.map +1 -1
  83. package/dist/index.es51.js +5 -5
  84. package/dist/index.es58.js +6 -2
  85. package/dist/index.es58.js.map +1 -1
  86. package/dist/index.es59.js +2 -30
  87. package/dist/index.es59.js.map +1 -1
  88. package/dist/index.es60.js +2 -602
  89. package/dist/index.es60.js.map +1 -1
  90. package/dist/index.es61.js +28 -105
  91. package/dist/index.es61.js.map +1 -1
  92. package/dist/index.es62.js +602 -10
  93. package/dist/index.es62.js.map +1 -1
  94. package/dist/index.es63.js +106 -5
  95. package/dist/index.es63.js.map +1 -1
  96. package/dist/index.es64.js +10 -2
  97. package/dist/index.es64.js.map +1 -1
  98. package/dist/index.es65.js +2 -2
  99. package/dist/index.es66.js +2 -55
  100. package/dist/index.es66.js.map +1 -1
  101. package/dist/index.es67.js +4 -48
  102. package/dist/index.es67.js.map +1 -1
  103. package/dist/index.es68.js +55 -37
  104. package/dist/index.es68.js.map +1 -1
  105. package/dist/index.es69.js +47 -11
  106. package/dist/index.es69.js.map +1 -1
  107. package/dist/index.es70.js +38 -14
  108. package/dist/index.es70.js.map +1 -1
  109. package/dist/index.es71.js +11 -29
  110. package/dist/index.es71.js.map +1 -1
  111. package/dist/index.es72.js +10 -10
  112. package/dist/index.es72.js.map +1 -1
  113. package/dist/index.es73.js +29 -13
  114. package/dist/index.es73.js.map +1 -1
  115. package/dist/index.es74.js +12 -10
  116. package/dist/index.es74.js.map +1 -1
  117. package/dist/index.es75.js +14 -4
  118. package/dist/index.es75.js.map +1 -1
  119. package/dist/index.es76.js +11 -2
  120. package/dist/index.es76.js.map +1 -1
  121. package/dist/index.es78.js +1 -1
  122. package/dist/index.es79.js +1 -1
  123. package/package.json +1 -1
  124. package/build/index.js +0 -2
  125. package/build/index.js.map +0 -1
  126. package/build/main.css +0 -127
  127. package/types/components/LocationMarker.js.flow +0 -82
@@ -1 +1 @@
1
- {"version":3,"file":"index.es68.js","sources":["../../../node_modules/react-map-gl/dist/esm/components/popup.js"],"sourcesContent":["import { createPortal } from 'react-dom';\nimport { useImperativeHandle, useEffect, useMemo, useRef, useContext, forwardRef, memo } from 'react';\nimport { applyReactStyle } from '../utils/apply-react-style';\nimport { MapContext } from './map';\nimport { deepEqual } from '../utils/deep-equal';\n// Adapted from https://github.com/mapbox/mapbox-gl-js/blob/v1.13.0/src/ui/popup.js\nfunction getClassList(className) {\n return new Set(className ? className.trim().split(/\\s+/) : []);\n}\n/* eslint-disable complexity,max-statements */\nfunction Popup(props, ref) {\n const { map, mapLib } = useContext(MapContext);\n const container = useMemo(() => {\n return document.createElement('div');\n }, []);\n const thisRef = useRef({ props });\n thisRef.current.props = props;\n const popup = useMemo(() => {\n const options = { ...props };\n const pp = new mapLib.Popup(options);\n pp.setLngLat([props.longitude, props.latitude]);\n pp.once('open', e => {\n var _a, _b;\n (_b = (_a = thisRef.current.props).onOpen) === null || _b === void 0 ? void 0 : _b.call(_a, e);\n });\n return pp;\n }, []);\n useEffect(() => {\n const onClose = e => {\n var _a, _b;\n (_b = (_a = thisRef.current.props).onClose) === null || _b === void 0 ? void 0 : _b.call(_a, e);\n };\n popup.on('close', onClose);\n popup.setDOMContent(container).addTo(map.getMap());\n return () => {\n // https://github.com/visgl/react-map-gl/issues/1825\n // onClose should not be fired if the popup is removed by unmounting\n // When using React strict mode, the component is mounted twice.\n // Firing the onClose callback here would be a false signal to remove the component.\n popup.off('close', onClose);\n if (popup.isOpen()) {\n popup.remove();\n }\n };\n }, []);\n useEffect(() => {\n applyReactStyle(popup.getElement(), props.style);\n }, [props.style]);\n useImperativeHandle(ref, () => popup, []);\n if (popup.isOpen()) {\n if (popup.getLngLat().lng !== props.longitude || popup.getLngLat().lat !== props.latitude) {\n popup.setLngLat([props.longitude, props.latitude]);\n }\n if (props.offset && !deepEqual(popup.options.offset, props.offset)) {\n popup.setOffset(props.offset);\n }\n if (popup.options.anchor !== props.anchor || popup.options.maxWidth !== props.maxWidth) {\n popup.options.anchor = props.anchor;\n popup.setMaxWidth(props.maxWidth);\n }\n if (popup.options.className !== props.className) {\n const prevClassList = getClassList(popup.options.className);\n const nextClassList = getClassList(props.className);\n for (const c of prevClassList) {\n if (!nextClassList.has(c)) {\n popup.removeClassName(c);\n }\n }\n for (const c of nextClassList) {\n if (!prevClassList.has(c)) {\n popup.addClassName(c);\n }\n }\n popup.options.className = props.className;\n }\n }\n return createPortal(props.children, container);\n}\nexport default memo(forwardRef(Popup));\n//# sourceMappingURL=popup.js.map"],"names":["getClassList","className","Popup","props","ref","map","mapLib","useContext","MapContext","container","useMemo","thisRef","useRef","popup","options","pp","e","_a","_b","useEffect","onClose","applyReactStyle","useImperativeHandle","deepEqual","prevClassList","nextClassList","c","createPortal","memo","forwardRef"],"mappings":";;;;;AAMA,SAASA,EAAaC,GAAW;AACtB,SAAA,IAAI,IAAIA,IAAYA,EAAU,OAAO,MAAM,KAAK,IAAI,CAAA,CAAE;AACjE;AAEA,SAASC,EAAMC,GAAOC,GAAK;AACvB,QAAM,EAAE,KAAAC,GAAK,QAAAC,EAAO,IAAIC,EAAWC,CAAU,GACvCC,IAAYC,EAAQ,MACf,SAAS,cAAc,KAAK,GACpC,CAAE,CAAA,GACCC,IAAUC,EAAO,EAAE,OAAAT,EAAO,CAAA;AAChC,EAAAQ,EAAQ,QAAQ,QAAQR;AAClB,QAAAU,IAAQH,EAAQ,MAAM;AAClB,UAAAI,IAAU,EAAE,GAAGX,KACfY,IAAK,IAAIT,EAAO,MAAMQ,CAAO;AACnC,WAAAC,EAAG,UAAU,CAACZ,EAAM,WAAWA,EAAM,QAAQ,CAAC,GAC3CY,EAAA,KAAK,QAAQ,CAAKC,MAAA;AACjB,UAAIC,GAAIC;AACR,OAACA,KAAMD,IAAKN,EAAQ,QAAQ,OAAO,YAAY,QAAQO,MAAO,UAAkBA,EAAG,KAAKD,GAAID,CAAC;AAAA,IAAA,CAChG,GACMD;AAAA,EACX,GAAG,CAAE,CAAA;AAuBD,MAtBJI,EAAU,MAAM;AACZ,UAAMC,IAAU,CAAKJ,MAAA;AACjB,UAAIC,GAAIC;AACR,OAACA,KAAMD,IAAKN,EAAQ,QAAQ,OAAO,aAAa,QAAQO,MAAO,UAAkBA,EAAG,KAAKD,GAAID,CAAC;AAAA,IAAA;AAE5F,WAAAH,EAAA,GAAG,SAASO,CAAO,GACzBP,EAAM,cAAcJ,CAAS,EAAE,MAAMJ,EAAI,QAAQ,GAC1C,MAAM;AAKH,MAAAQ,EAAA,IAAI,SAASO,CAAO,GACtBP,EAAM,YACNA,EAAM,OAAO;AAAA,IACjB;AAAA,EAER,GAAG,CAAE,CAAA,GACLM,EAAU,MAAM;AACZ,IAAAE,EAAgBR,EAAM,WAAc,GAAAV,EAAM,KAAK;AAAA,EAAA,GAChD,CAACA,EAAM,KAAK,CAAC,GAChBmB,EAAoBlB,GAAK,MAAMS,GAAO,CAAE,CAAA,GACpCA,EAAM,cACFA,EAAM,YAAY,QAAQV,EAAM,aAAaU,EAAM,UAAU,EAAE,QAAQV,EAAM,aAC7EU,EAAM,UAAU,CAACV,EAAM,WAAWA,EAAM,QAAQ,CAAC,GAEjDA,EAAM,UAAU,CAACoB,EAAUV,EAAM,QAAQ,QAAQV,EAAM,MAAM,KACvDU,EAAA,UAAUV,EAAM,MAAM,IAE5BU,EAAM,QAAQ,WAAWV,EAAM,UAAUU,EAAM,QAAQ,aAAaV,EAAM,cACpEU,EAAA,QAAQ,SAASV,EAAM,QACvBU,EAAA,YAAYV,EAAM,QAAQ,IAEhCU,EAAM,QAAQ,cAAcV,EAAM,YAAW;AAC7C,UAAMqB,IAAgBxB,EAAaa,EAAM,QAAQ,SAAS,GACpDY,IAAgBzB,EAAaG,EAAM,SAAS;AAClD,eAAWuB,KAAKF;AACZ,MAAKC,EAAc,IAAIC,CAAC,KACpBb,EAAM,gBAAgBa,CAAC;AAG/B,eAAWA,KAAKD;AACZ,MAAKD,EAAc,IAAIE,CAAC,KACpBb,EAAM,aAAaa,CAAC;AAGtB,IAAAb,EAAA,QAAQ,YAAYV,EAAM;AAAA,EACpC;AAEG,SAAAwB,EAAaxB,EAAM,UAAUM,CAAS;AACjD;AACemB,EAAKC,EAAW3B,CAAK,CAAC;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es68.js","sources":["../../../node_modules/react-map-gl/dist/esm/components/map.js"],"sourcesContent":["import * as React from 'react';\nimport { useState, useRef, useEffect, useContext, useMemo, useImperativeHandle } from 'react';\nimport { MountedMapsContext } from './use-map';\nimport Mapbox from '../mapbox/mapbox';\nimport createRef from '../mapbox/create-ref';\nimport useIsomorphicLayoutEffect from '../utils/use-isomorphic-layout-effect';\nimport setGlobals from '../utils/set-globals';\nexport const MapContext = React.createContext(null);\nexport default function Map(props, ref, defaultLib) {\n const mountedMapsContext = useContext(MountedMapsContext);\n const [mapInstance, setMapInstance] = useState(null);\n const containerRef = useRef();\n const { current: contextValue } = useRef({ mapLib: null, map: null });\n useEffect(() => {\n const mapLib = props.mapLib;\n let isMounted = true;\n let mapbox;\n Promise.resolve(mapLib || defaultLib)\n .then((module) => {\n if (!isMounted) {\n return;\n }\n if (!module) {\n throw new Error('Invalid mapLib');\n }\n const mapboxgl = 'Map' in module ? module : module.default;\n if (!mapboxgl.Map) {\n throw new Error('Invalid mapLib');\n }\n // workerUrl & workerClass may change the result of supported()\n // https://github.com/visgl/react-map-gl/discussions/2027\n setGlobals(mapboxgl, props);\n if (!mapboxgl.supported || mapboxgl.supported(props)) {\n if (props.reuseMaps) {\n mapbox = Mapbox.reuse(props, containerRef.current);\n }\n if (!mapbox) {\n mapbox = new Mapbox(mapboxgl.Map, props, containerRef.current);\n }\n contextValue.map = createRef(mapbox);\n contextValue.mapLib = mapboxgl;\n setMapInstance(mapbox);\n mountedMapsContext === null || mountedMapsContext === void 0 ? void 0 : mountedMapsContext.onMapMount(contextValue.map, props.id);\n }\n else {\n throw new Error('Map is not supported by this browser');\n }\n })\n .catch(error => {\n const { onError } = props;\n if (onError) {\n onError({\n type: 'error',\n target: null,\n originalEvent: null,\n error\n });\n }\n else {\n console.error(error); // eslint-disable-line\n }\n });\n return () => {\n isMounted = false;\n if (mapbox) {\n mountedMapsContext === null || mountedMapsContext === void 0 ? void 0 : mountedMapsContext.onMapUnmount(props.id);\n if (props.reuseMaps) {\n mapbox.recycle();\n }\n else {\n mapbox.destroy();\n }\n }\n };\n }, []);\n useIsomorphicLayoutEffect(() => {\n if (mapInstance) {\n mapInstance.setProps(props);\n }\n });\n useImperativeHandle(ref, () => contextValue.map, [mapInstance]);\n const style = useMemo(() => ({\n position: 'relative',\n width: '100%',\n height: '100%',\n ...props.style\n }), [props.style]);\n const CHILD_CONTAINER_STYLE = {\n height: '100%'\n };\n return (React.createElement(\"div\", { id: props.id, ref: containerRef, style: style }, mapInstance && (React.createElement(MapContext.Provider, { value: contextValue },\n React.createElement(\"div\", { \"mapboxgl-children\": \"\", style: CHILD_CONTAINER_STYLE }, props.children)))));\n}\n//# sourceMappingURL=map.js.map"],"names":["MapContext","React","Map","props","ref","defaultLib","mountedMapsContext","useContext","MountedMapsContext","mapInstance","setMapInstance","useState","containerRef","useRef","contextValue","useEffect","mapLib","isMounted","mapbox","module","mapboxgl","setGlobals","Mapbox","createRef","error","onError","useIsomorphicLayoutEffect","useImperativeHandle","style","useMemo","CHILD_CONTAINER_STYLE"],"mappings":";;;;;;;AAOa,MAAAA,IAAaC,EAAM,cAAc,IAAI;AAC1B,SAAAC,EAAIC,GAAOC,GAAKC,GAAY;AAC1C,QAAAC,IAAqBC,EAAWC,CAAkB,GAClD,CAACC,GAAaC,CAAc,IAAIC,EAAS,IAAI,GAC7CC,IAAeC,KACf,EAAE,SAASC,EAAA,IAAiBD,EAAO,EAAE,QAAQ,MAAM,KAAK,KAAA,CAAM;AACpE,EAAAE,EAAU,MAAM;AACZ,UAAMC,IAASb,EAAM;AACrB,QAAIc,IAAY,IACZC;AACJ,mBAAQ,QAAQF,KAAUX,CAAU,EAC/B,KAAK,CAACc,MAAW;AAClB,UAAI,CAACF;AACD;AAEJ,UAAI,CAACE;AACK,cAAA,IAAI,MAAM,gBAAgB;AAEpC,YAAMC,IAAW,SAASD,IAASA,IAASA,EAAO;AAC/C,UAAA,CAACC,EAAS;AACJ,cAAA,IAAI,MAAM,gBAAgB;AAKpC,UADAC,EAAWD,GAAUjB,CAAK,GACtB,CAACiB,EAAS,aAAaA,EAAS,UAAUjB,CAAK;AAC/C,QAAIA,EAAM,cACNe,IAASI,EAAO,MAAMnB,GAAOS,EAAa,OAAO,IAEhDM,MACDA,IAAS,IAAII,EAAOF,EAAS,KAAKjB,GAAOS,EAAa,OAAO,IAEpDE,EAAA,MAAMS,EAAUL,CAAM,GACnCJ,EAAa,SAASM,GACtBV,EAAeQ,CAAM,GACEZ,KAAA,QAAiDA,EAAmB,WAAWQ,EAAa,KAAKX,EAAM,EAAE;AAAA;AAG1H,cAAA,IAAI,MAAM,sCAAsC;AAAA,IAC1D,CACH,EACI,MAAM,CAASqB,MAAA;AACV,YAAA,EAAE,SAAAC,EAAY,IAAAtB;AACpB,MAAIsB,IACQA,EAAA;AAAA,QACJ,MAAM;AAAA,QACN,QAAQ;AAAA,QACR,eAAe;AAAA,QACf,OAAAD;AAAA,MAAA,CACH,IAGD,QAAQ,MAAMA,CAAK;AAAA,IACvB,CACH,GACM,MAAM;AACG,MAAAP,IAAA,IACRC,MACAZ,KAAuB,QAAiDA,EAAmB,aAAaH,EAAM,EAAE,GAC5GA,EAAM,YACNe,EAAO,QAAQ,IAGfA,EAAO,QAAQ;AAAA,IAEvB;AAAA,EAER,GAAG,CAAE,CAAA,GACLQ,EAA0B,MAAM;AAC5B,IAAIjB,KACAA,EAAY,SAASN,CAAK;AAAA,EAC9B,CACH,GACDwB,EAAoBvB,GAAK,MAAMU,EAAa,KAAK,CAACL,CAAW,CAAC;AACxD,QAAAmB,IAAQC,EAAQ,OAAO;AAAA,IACzB,UAAU;AAAA,IACV,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,GAAG1B,EAAM;AAAA,EACT,IAAA,CAACA,EAAM,KAAK,CAAC,GACX2B,IAAwB;AAAA,IAC1B,QAAQ;AAAA,EAAA;AAEZ,SAAQ7B,EAAM,cAAc,OAAO,EAAE,IAAIE,EAAM,IAAI,KAAKS,GAAc,OAAAgB,EAAgB,GAAAnB,KAAgBR,EAAM;AAAA,IAAcD,EAAW;AAAA,IAAU,EAAE,OAAOc,EAAa;AAAA,IACjKb,EAAM,cAAc,OAAO,EAAE,qBAAqB,IAAI,OAAO6B,EAAA,GAAyB3B,EAAM,QAAQ;AAAA,EAAA,CAAG;AAC/G;","x_google_ignoreList":[0]}
@@ -1,13 +1,49 @@
1
- import { memo as i, useEffect as r } from "react";
2
- import { applyReactStyle as e } from "./index.es186.js";
3
- import l from "./index.es16.js";
4
- function m(t) {
5
- const o = l(({ mapLib: n }) => new n.AttributionControl(t), {
6
- position: t.position
7
- });
8
- return r(() => {
9
- e(o._container, t.style);
10
- }, [t.style]), null;
1
+ import * as k from "react";
2
+ import { memo as A, forwardRef as P, useContext as C, useRef as D, useMemo as M, useEffect as h, useImperativeHandle as y } from "react";
3
+ import { createPortal as w } from "react-dom";
4
+ import { applyReactStyle as x } from "./index.es186.js";
5
+ import { MapContext as O } from "./index.es68.js";
6
+ import { arePointsEqual as S } from "./index.es187.js";
7
+ function q(o, E) {
8
+ const { map: R, mapLib: b } = C(O), i = D({ props: o });
9
+ i.current.props = o;
10
+ const t = M(() => {
11
+ let L = !1;
12
+ k.Children.forEach(o.children, (a) => {
13
+ a && (L = !0);
14
+ });
15
+ const _ = {
16
+ ...o,
17
+ element: L ? document.createElement("div") : null
18
+ }, l = new b.Marker(_);
19
+ return l.setLngLat([o.longitude, o.latitude]), l.getElement().addEventListener("click", (a) => {
20
+ var n, e;
21
+ (e = (n = i.current.props).onClick) === null || e === void 0 || e.call(n, {
22
+ type: "click",
23
+ target: l,
24
+ originalEvent: a
25
+ });
26
+ }), l.on("dragstart", (a) => {
27
+ var n, e;
28
+ const r = a;
29
+ r.lngLat = t.getLngLat(), (e = (n = i.current.props).onDragStart) === null || e === void 0 || e.call(n, r);
30
+ }), l.on("drag", (a) => {
31
+ var n, e;
32
+ const r = a;
33
+ r.lngLat = t.getLngLat(), (e = (n = i.current.props).onDrag) === null || e === void 0 || e.call(n, r);
34
+ }), l.on("dragend", (a) => {
35
+ var n, e;
36
+ const r = a;
37
+ r.lngLat = t.getLngLat(), (e = (n = i.current.props).onDragEnd) === null || e === void 0 || e.call(n, r);
38
+ }), l;
39
+ }, []);
40
+ h(() => (t.addTo(R.getMap()), () => {
41
+ t.remove();
42
+ }), []);
43
+ const { longitude: c, latitude: s, offset: g, style: m, draggable: u = !1, popup: d = null, rotation: f = 0, rotationAlignment: v = "auto", pitchAlignment: p = "auto" } = o;
44
+ return h(() => {
45
+ x(t.getElement(), m);
46
+ }, [m]), y(E, () => t, []), (t.getLngLat().lng !== c || t.getLngLat().lat !== s) && t.setLngLat([c, s]), g && !S(t.getOffset(), g) && t.setOffset(g), t.isDraggable() !== u && t.setDraggable(u), t.getRotation() !== f && t.setRotation(f), t.getRotationAlignment() !== v && t.setRotationAlignment(v), t.getPitchAlignment() !== p && t.setPitchAlignment(p), t.getPopup() !== d && t.setPopup(d), w(o.children, t.getElement());
11
47
  }
12
- i(m);
48
+ A(P(q));
13
49
  //# sourceMappingURL=index.es69.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es69.js","sources":["../../../node_modules/react-map-gl/dist/esm/components/attribution-control.js"],"sourcesContent":["import { useEffect, memo } from 'react';\nimport { applyReactStyle } from '../utils/apply-react-style';\nimport useControl from './use-control';\nfunction AttributionControl(props) {\n const ctrl = useControl(({ mapLib }) => new mapLib.AttributionControl(props), {\n position: props.position\n });\n useEffect(() => {\n applyReactStyle(ctrl._container, props.style);\n }, [props.style]);\n return null;\n}\nexport default memo(AttributionControl);\n//# sourceMappingURL=attribution-control.js.map"],"names":["AttributionControl","props","ctrl","useControl","mapLib","useEffect","applyReactStyle","memo"],"mappings":";;;AAGA,SAASA,EAAmBC,GAAO;AACzB,QAAAC,IAAOC,EAAW,CAAC,EAAE,QAAAC,QAAa,IAAIA,EAAO,mBAAmBH,CAAK,GAAG;AAAA,IAC1E,UAAUA,EAAM;AAAA,EAAA,CACnB;AACD,SAAAI,EAAU,MAAM;AACI,IAAAC,EAAAJ,EAAK,YAAYD,EAAM,KAAK;AAAA,EAAA,GAC7C,CAACA,EAAM,KAAK,CAAC,GACT;AACX;AACeM,EAAKP,CAAkB;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es69.js","sources":["../../../node_modules/react-map-gl/dist/esm/components/marker.js"],"sourcesContent":["/* global document */\nimport * as React from 'react';\nimport { createPortal } from 'react-dom';\nimport { useImperativeHandle, useEffect, useMemo, useRef, useContext, forwardRef, memo } from 'react';\nimport { applyReactStyle } from '../utils/apply-react-style';\nimport { MapContext } from './map';\nimport { arePointsEqual } from '../utils/deep-equal';\n/* eslint-disable complexity,max-statements */\nfunction Marker(props, ref) {\n const { map, mapLib } = useContext(MapContext);\n const thisRef = useRef({ props });\n thisRef.current.props = props;\n const marker = useMemo(() => {\n let hasChildren = false;\n React.Children.forEach(props.children, el => {\n if (el) {\n hasChildren = true;\n }\n });\n const options = {\n ...props,\n element: hasChildren ? document.createElement('div') : null\n };\n const mk = new mapLib.Marker(options);\n mk.setLngLat([props.longitude, props.latitude]);\n mk.getElement().addEventListener('click', (e) => {\n var _a, _b;\n (_b = (_a = thisRef.current.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, {\n type: 'click',\n target: mk,\n originalEvent: e\n });\n });\n mk.on('dragstart', e => {\n var _a, _b;\n const evt = e;\n evt.lngLat = marker.getLngLat();\n (_b = (_a = thisRef.current.props).onDragStart) === null || _b === void 0 ? void 0 : _b.call(_a, evt);\n });\n mk.on('drag', e => {\n var _a, _b;\n const evt = e;\n evt.lngLat = marker.getLngLat();\n (_b = (_a = thisRef.current.props).onDrag) === null || _b === void 0 ? void 0 : _b.call(_a, evt);\n });\n mk.on('dragend', e => {\n var _a, _b;\n const evt = e;\n evt.lngLat = marker.getLngLat();\n (_b = (_a = thisRef.current.props).onDragEnd) === null || _b === void 0 ? void 0 : _b.call(_a, evt);\n });\n return mk;\n }, []);\n useEffect(() => {\n marker.addTo(map.getMap());\n return () => {\n marker.remove();\n };\n }, []);\n const { longitude, latitude, offset, style, draggable = false, popup = null, rotation = 0, rotationAlignment = 'auto', pitchAlignment = 'auto' } = props;\n useEffect(() => {\n applyReactStyle(marker.getElement(), style);\n }, [style]);\n useImperativeHandle(ref, () => marker, []);\n if (marker.getLngLat().lng !== longitude || marker.getLngLat().lat !== latitude) {\n marker.setLngLat([longitude, latitude]);\n }\n if (offset && !arePointsEqual(marker.getOffset(), offset)) {\n marker.setOffset(offset);\n }\n if (marker.isDraggable() !== draggable) {\n marker.setDraggable(draggable);\n }\n if (marker.getRotation() !== rotation) {\n marker.setRotation(rotation);\n }\n if (marker.getRotationAlignment() !== rotationAlignment) {\n marker.setRotationAlignment(rotationAlignment);\n }\n if (marker.getPitchAlignment() !== pitchAlignment) {\n marker.setPitchAlignment(pitchAlignment);\n }\n if (marker.getPopup() !== popup) {\n marker.setPopup(popup);\n }\n return createPortal(props.children, marker.getElement());\n}\nexport default memo(forwardRef(Marker));\n//# sourceMappingURL=marker.js.map"],"names":["Marker","props","ref","map","mapLib","useContext","MapContext","thisRef","useRef","marker","useMemo","hasChildren","React","el","options","mk","e","_a","_b","evt","useEffect","longitude","latitude","offset","style","draggable","popup","rotation","rotationAlignment","pitchAlignment","applyReactStyle","useImperativeHandle","arePointsEqual","createPortal","memo","forwardRef"],"mappings":";;;;;;AAQA,SAASA,EAAOC,GAAOC,GAAK;AACxB,QAAM,EAAE,KAAAC,GAAK,QAAAC,EAAO,IAAIC,EAAWC,CAAU,GACvCC,IAAUC,EAAO,EAAE,OAAAP,EAAO,CAAA;AAChC,EAAAM,EAAQ,QAAQ,QAAQN;AAClB,QAAAQ,IAASC,EAAQ,MAAM;AACzB,QAAIC,IAAc;AAClB,IAAAC,EAAM,SAAS,QAAQX,EAAM,UAAU,CAAMY,MAAA;AACzC,MAAIA,MACcF,IAAA;AAAA,IAClB,CACH;AACD,UAAMG,IAAU;AAAA,MACZ,GAAGb;AAAA,MACH,SAASU,IAAc,SAAS,cAAc,KAAK,IAAI;AAAA,IAAA,GAErDI,IAAK,IAAIX,EAAO,OAAOU,CAAO;AACpC,WAAAC,EAAG,UAAU,CAACd,EAAM,WAAWA,EAAM,QAAQ,CAAC,GAC9Cc,EAAG,WAAW,EAAE,iBAAiB,SAAS,CAACC,MAAM;AAC7C,UAAIC,GAAIC;AACR,OAACA,KAAMD,IAAKV,EAAQ,QAAQ,OAAO,aAAa,QAAQW,MAAO,UAAkBA,EAAG,KAAKD,GAAI;AAAA,QACzF,MAAM;AAAA,QACN,QAAQF;AAAA,QACR,eAAeC;AAAA,MAAA,CAClB;AAAA,IAAA,CACJ,GACED,EAAA,GAAG,aAAa,CAAKC,MAAA;AACpB,UAAIC,GAAIC;AACR,YAAMC,IAAMH;AACR,MAAAG,EAAA,SAASV,EAAO,cACnBS,KAAMD,IAAKV,EAAQ,QAAQ,OAAO,iBAAiB,QAAQW,MAAO,UAAkBA,EAAG,KAAKD,GAAIE,CAAG;AAAA,IAAA,CACvG,GACEJ,EAAA,GAAG,QAAQ,CAAKC,MAAA;AACf,UAAIC,GAAIC;AACR,YAAMC,IAAMH;AACR,MAAAG,EAAA,SAASV,EAAO,cACnBS,KAAMD,IAAKV,EAAQ,QAAQ,OAAO,YAAY,QAAQW,MAAO,UAAkBA,EAAG,KAAKD,GAAIE,CAAG;AAAA,IAAA,CAClG,GACEJ,EAAA,GAAG,WAAW,CAAKC,MAAA;AAClB,UAAIC,GAAIC;AACR,YAAMC,IAAMH;AACR,MAAAG,EAAA,SAASV,EAAO,cACnBS,KAAMD,IAAKV,EAAQ,QAAQ,OAAO,eAAe,QAAQW,MAAO,UAAkBA,EAAG,KAAKD,GAAIE,CAAG;AAAA,IAAA,CACrG,GACMJ;AAAA,EACX,GAAG,CAAE,CAAA;AACL,EAAAK,EAAU,OACCX,EAAA,MAAMN,EAAI,OAAQ,CAAA,GAClB,MAAM;AACT,IAAAM,EAAO,OAAO;AAAA,EAAA,IAEnB,CAAE,CAAA;AACL,QAAM,EAAE,WAAAY,GAAW,UAAAC,GAAU,QAAAC,GAAQ,OAAAC,GAAO,WAAAC,IAAY,IAAO,OAAAC,IAAQ,MAAM,UAAAC,IAAW,GAAG,mBAAAC,IAAoB,QAAQ,gBAAAC,IAAiB,OAAW,IAAA5B;AACnJ,SAAAmB,EAAU,MAAM;AACI,IAAAU,EAAArB,EAAO,WAAW,GAAGe,CAAK;AAAA,EAAA,GAC3C,CAACA,CAAK,CAAC,GACVO,EAAoB7B,GAAK,MAAMO,GAAQ,CAAE,CAAA,IACrCA,EAAO,UAAY,EAAA,QAAQY,KAAaZ,EAAO,UAAA,EAAY,QAAQa,MACnEb,EAAO,UAAU,CAACY,GAAWC,CAAQ,CAAC,GAEtCC,KAAU,CAACS,EAAevB,EAAO,UAAU,GAAGc,CAAM,KACpDd,EAAO,UAAUc,CAAM,GAEvBd,EAAO,YAAY,MAAMgB,KACzBhB,EAAO,aAAagB,CAAS,GAE7BhB,EAAO,YAAY,MAAMkB,KACzBlB,EAAO,YAAYkB,CAAQ,GAE3BlB,EAAO,qBAAqB,MAAMmB,KAClCnB,EAAO,qBAAqBmB,CAAiB,GAE7CnB,EAAO,kBAAkB,MAAMoB,KAC/BpB,EAAO,kBAAkBoB,CAAc,GAEvCpB,EAAO,SAAS,MAAMiB,KACtBjB,EAAO,SAASiB,CAAK,GAElBO,EAAahC,EAAM,UAAUQ,EAAO,WAAY,CAAA;AAC3D;AACeyB,EAAKC,EAAWnC,CAAM,CAAC;","x_google_ignoreList":[0]}
@@ -1,16 +1,40 @@
1
- import { memo as o, useEffect as l } from "react";
2
- import { applyReactStyle as r } from "./index.es186.js";
3
- import c from "./index.es16.js";
4
- function i(t) {
5
- const n = c(({ mapLib: e }) => new e.FullscreenControl({
6
- container: t.containerId && document.getElementById(t.containerId)
7
- }), { position: t.position });
8
- return l(() => {
9
- r(n._controlContainer, t.style);
10
- }, [t.style]), null;
1
+ import { createPortal as h } from "react-dom";
2
+ import { memo as L, forwardRef as v, useContext as C, useMemo as f, useRef as x, useEffect as m, useImperativeHandle as N } from "react";
3
+ import { applyReactStyle as M } from "./index.es186.js";
4
+ import { MapContext as O } from "./index.es68.js";
5
+ import { deepEqual as y } from "./index.es187.js";
6
+ function r(t) {
7
+ return new Set(t ? t.trim().split(/\s+/) : []);
11
8
  }
12
- const s = o(i);
13
- export {
14
- s as default
15
- };
9
+ function E(t, u) {
10
+ const { map: d, mapLib: g } = C(O), c = f(() => document.createElement("div"), []), i = x({ props: t });
11
+ i.current.props = t;
12
+ const e = f(() => {
13
+ const a = { ...t }, o = new g.Popup(a);
14
+ return o.setLngLat([t.longitude, t.latitude]), o.once("open", (n) => {
15
+ var s, l;
16
+ (l = (s = i.current.props).onOpen) === null || l === void 0 || l.call(s, n);
17
+ }), o;
18
+ }, []);
19
+ if (m(() => {
20
+ const a = (o) => {
21
+ var n, s;
22
+ (s = (n = i.current.props).onClose) === null || s === void 0 || s.call(n, o);
23
+ };
24
+ return e.on("close", a), e.setDOMContent(c).addTo(d.getMap()), () => {
25
+ e.off("close", a), e.isOpen() && e.remove();
26
+ };
27
+ }, []), m(() => {
28
+ M(e.getElement(), t.style);
29
+ }, [t.style]), N(u, () => e, []), e.isOpen() && ((e.getLngLat().lng !== t.longitude || e.getLngLat().lat !== t.latitude) && e.setLngLat([t.longitude, t.latitude]), t.offset && !y(e.options.offset, t.offset) && e.setOffset(t.offset), (e.options.anchor !== t.anchor || e.options.maxWidth !== t.maxWidth) && (e.options.anchor = t.anchor, e.setMaxWidth(t.maxWidth)), e.options.className !== t.className)) {
30
+ const a = r(e.options.className), o = r(t.className);
31
+ for (const n of a)
32
+ o.has(n) || e.removeClassName(n);
33
+ for (const n of o)
34
+ a.has(n) || e.addClassName(n);
35
+ e.options.className = t.className;
36
+ }
37
+ return h(t.children, c);
38
+ }
39
+ L(v(E));
16
40
  //# sourceMappingURL=index.es70.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es70.js","sources":["../../../node_modules/react-map-gl/dist/esm/components/fullscreen-control.js"],"sourcesContent":["import { useEffect, memo } from 'react';\nimport { applyReactStyle } from '../utils/apply-react-style';\nimport useControl from './use-control';\nfunction FullscreenControl(props) {\n const ctrl = useControl(({ mapLib }) => new mapLib.FullscreenControl({\n container: props.containerId && document.getElementById(props.containerId)\n }), { position: props.position });\n useEffect(() => {\n applyReactStyle(ctrl._controlContainer, props.style);\n }, [props.style]);\n return null;\n}\nexport default memo(FullscreenControl);\n//# sourceMappingURL=fullscreen-control.js.map"],"names":["FullscreenControl","props","ctrl","useControl","mapLib","useEffect","applyReactStyle","_FullscreenControl","memo"],"mappings":";;;AAGA,SAASA,EAAkBC,GAAO;AACxB,QAAAC,IAAOC,EAAW,CAAC,EAAE,QAAAC,QAAa,IAAIA,EAAO,kBAAkB;AAAA,IACjE,WAAWH,EAAM,eAAe,SAAS,eAAeA,EAAM,WAAW;AAAA,EAC5E,CAAA,GAAG,EAAE,UAAUA,EAAM,SAAU,CAAA;AAChC,SAAAI,EAAU,MAAM;AACI,IAAAC,EAAAJ,EAAK,mBAAmBD,EAAM,KAAK;AAAA,EAAA,GACpD,CAACA,EAAM,KAAK,CAAC,GACT;AACX;AACA,MAAeM,IAAAC,EAAKR,CAAiB;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es70.js","sources":["../../../node_modules/react-map-gl/dist/esm/components/popup.js"],"sourcesContent":["import { createPortal } from 'react-dom';\nimport { useImperativeHandle, useEffect, useMemo, useRef, useContext, forwardRef, memo } from 'react';\nimport { applyReactStyle } from '../utils/apply-react-style';\nimport { MapContext } from './map';\nimport { deepEqual } from '../utils/deep-equal';\n// Adapted from https://github.com/mapbox/mapbox-gl-js/blob/v1.13.0/src/ui/popup.js\nfunction getClassList(className) {\n return new Set(className ? className.trim().split(/\\s+/) : []);\n}\n/* eslint-disable complexity,max-statements */\nfunction Popup(props, ref) {\n const { map, mapLib } = useContext(MapContext);\n const container = useMemo(() => {\n return document.createElement('div');\n }, []);\n const thisRef = useRef({ props });\n thisRef.current.props = props;\n const popup = useMemo(() => {\n const options = { ...props };\n const pp = new mapLib.Popup(options);\n pp.setLngLat([props.longitude, props.latitude]);\n pp.once('open', e => {\n var _a, _b;\n (_b = (_a = thisRef.current.props).onOpen) === null || _b === void 0 ? void 0 : _b.call(_a, e);\n });\n return pp;\n }, []);\n useEffect(() => {\n const onClose = e => {\n var _a, _b;\n (_b = (_a = thisRef.current.props).onClose) === null || _b === void 0 ? void 0 : _b.call(_a, e);\n };\n popup.on('close', onClose);\n popup.setDOMContent(container).addTo(map.getMap());\n return () => {\n // https://github.com/visgl/react-map-gl/issues/1825\n // onClose should not be fired if the popup is removed by unmounting\n // When using React strict mode, the component is mounted twice.\n // Firing the onClose callback here would be a false signal to remove the component.\n popup.off('close', onClose);\n if (popup.isOpen()) {\n popup.remove();\n }\n };\n }, []);\n useEffect(() => {\n applyReactStyle(popup.getElement(), props.style);\n }, [props.style]);\n useImperativeHandle(ref, () => popup, []);\n if (popup.isOpen()) {\n if (popup.getLngLat().lng !== props.longitude || popup.getLngLat().lat !== props.latitude) {\n popup.setLngLat([props.longitude, props.latitude]);\n }\n if (props.offset && !deepEqual(popup.options.offset, props.offset)) {\n popup.setOffset(props.offset);\n }\n if (popup.options.anchor !== props.anchor || popup.options.maxWidth !== props.maxWidth) {\n popup.options.anchor = props.anchor;\n popup.setMaxWidth(props.maxWidth);\n }\n if (popup.options.className !== props.className) {\n const prevClassList = getClassList(popup.options.className);\n const nextClassList = getClassList(props.className);\n for (const c of prevClassList) {\n if (!nextClassList.has(c)) {\n popup.removeClassName(c);\n }\n }\n for (const c of nextClassList) {\n if (!prevClassList.has(c)) {\n popup.addClassName(c);\n }\n }\n popup.options.className = props.className;\n }\n }\n return createPortal(props.children, container);\n}\nexport default memo(forwardRef(Popup));\n//# sourceMappingURL=popup.js.map"],"names":["getClassList","className","Popup","props","ref","map","mapLib","useContext","MapContext","container","useMemo","thisRef","useRef","popup","options","pp","e","_a","_b","useEffect","onClose","applyReactStyle","useImperativeHandle","deepEqual","prevClassList","nextClassList","c","createPortal","memo","forwardRef"],"mappings":";;;;;AAMA,SAASA,EAAaC,GAAW;AACtB,SAAA,IAAI,IAAIA,IAAYA,EAAU,OAAO,MAAM,KAAK,IAAI,CAAA,CAAE;AACjE;AAEA,SAASC,EAAMC,GAAOC,GAAK;AACvB,QAAM,EAAE,KAAAC,GAAK,QAAAC,EAAO,IAAIC,EAAWC,CAAU,GACvCC,IAAYC,EAAQ,MACf,SAAS,cAAc,KAAK,GACpC,CAAE,CAAA,GACCC,IAAUC,EAAO,EAAE,OAAAT,EAAO,CAAA;AAChC,EAAAQ,EAAQ,QAAQ,QAAQR;AAClB,QAAAU,IAAQH,EAAQ,MAAM;AAClB,UAAAI,IAAU,EAAE,GAAGX,KACfY,IAAK,IAAIT,EAAO,MAAMQ,CAAO;AACnC,WAAAC,EAAG,UAAU,CAACZ,EAAM,WAAWA,EAAM,QAAQ,CAAC,GAC3CY,EAAA,KAAK,QAAQ,CAAKC,MAAA;AACjB,UAAIC,GAAIC;AACR,OAACA,KAAMD,IAAKN,EAAQ,QAAQ,OAAO,YAAY,QAAQO,MAAO,UAAkBA,EAAG,KAAKD,GAAID,CAAC;AAAA,IAAA,CAChG,GACMD;AAAA,EACX,GAAG,CAAE,CAAA;AAuBD,MAtBJI,EAAU,MAAM;AACZ,UAAMC,IAAU,CAAKJ,MAAA;AACjB,UAAIC,GAAIC;AACR,OAACA,KAAMD,IAAKN,EAAQ,QAAQ,OAAO,aAAa,QAAQO,MAAO,UAAkBA,EAAG,KAAKD,GAAID,CAAC;AAAA,IAAA;AAE5F,WAAAH,EAAA,GAAG,SAASO,CAAO,GACzBP,EAAM,cAAcJ,CAAS,EAAE,MAAMJ,EAAI,QAAQ,GAC1C,MAAM;AAKH,MAAAQ,EAAA,IAAI,SAASO,CAAO,GACtBP,EAAM,YACNA,EAAM,OAAO;AAAA,IACjB;AAAA,EAER,GAAG,CAAE,CAAA,GACLM,EAAU,MAAM;AACZ,IAAAE,EAAgBR,EAAM,WAAc,GAAAV,EAAM,KAAK;AAAA,EAAA,GAChD,CAACA,EAAM,KAAK,CAAC,GAChBmB,EAAoBlB,GAAK,MAAMS,GAAO,CAAE,CAAA,GACpCA,EAAM,cACFA,EAAM,YAAY,QAAQV,EAAM,aAAaU,EAAM,UAAU,EAAE,QAAQV,EAAM,aAC7EU,EAAM,UAAU,CAACV,EAAM,WAAWA,EAAM,QAAQ,CAAC,GAEjDA,EAAM,UAAU,CAACoB,EAAUV,EAAM,QAAQ,QAAQV,EAAM,MAAM,KACvDU,EAAA,UAAUV,EAAM,MAAM,IAE5BU,EAAM,QAAQ,WAAWV,EAAM,UAAUU,EAAM,QAAQ,aAAaV,EAAM,cACpEU,EAAA,QAAQ,SAASV,EAAM,QACvBU,EAAA,YAAYV,EAAM,QAAQ,IAEhCU,EAAM,QAAQ,cAAcV,EAAM,YAAW;AAC7C,UAAMqB,IAAgBxB,EAAaa,EAAM,QAAQ,SAAS,GACpDY,IAAgBzB,EAAaG,EAAM,SAAS;AAClD,eAAWuB,KAAKF;AACZ,MAAKC,EAAc,IAAIC,CAAC,KACpBb,EAAM,gBAAgBa,CAAC;AAG/B,eAAWA,KAAKD;AACZ,MAAKD,EAAc,IAAIE,CAAC,KACpBb,EAAM,aAAaa,CAAC;AAGtB,IAAAb,EAAA,QAAQ,YAAYV,EAAM;AAAA,EACpC;AAEG,SAAAwB,EAAaxB,EAAM,UAAUM,CAAS;AACjD;AACemB,EAAKC,EAAW3B,CAAK,CAAC;","x_google_ignoreList":[0]}
@@ -1,31 +1,13 @@
1
- import { memo as s, forwardRef as d, useRef as v, useImperativeHandle as _, useEffect as f } from "react";
2
- import { applyReactStyle as p } from "./index.es186.js";
3
- import m from "./index.es16.js";
4
- function b(e, c) {
5
- const a = v({ props: e }), l = m(({ mapLib: i }) => {
6
- const n = new i.GeolocateControl(e), u = n._setupUI;
7
- return n._setupUI = (t) => {
8
- n._container.hasChildNodes() || u(t);
9
- }, n.on("geolocate", (t) => {
10
- var r, o;
11
- (o = (r = a.current.props).onGeolocate) === null || o === void 0 || o.call(r, t);
12
- }), n.on("error", (t) => {
13
- var r, o;
14
- (o = (r = a.current.props).onError) === null || o === void 0 || o.call(r, t);
15
- }), n.on("outofmaxbounds", (t) => {
16
- var r, o;
17
- (o = (r = a.current.props).onOutOfMaxBounds) === null || o === void 0 || o.call(r, t);
18
- }), n.on("trackuserlocationstart", (t) => {
19
- var r, o;
20
- (o = (r = a.current.props).onTrackUserLocationStart) === null || o === void 0 || o.call(r, t);
21
- }), n.on("trackuserlocationend", (t) => {
22
- var r, o;
23
- (o = (r = a.current.props).onTrackUserLocationEnd) === null || o === void 0 || o.call(r, t);
24
- }), n;
25
- }, { position: e.position });
26
- return a.current.props = e, _(c, () => l, []), f(() => {
27
- p(l._container, e.style);
28
- }, [e.style]), null;
1
+ import { memo as i, useEffect as r } from "react";
2
+ import { applyReactStyle as e } from "./index.es186.js";
3
+ import l from "./index.es16.js";
4
+ function m(t) {
5
+ const o = l(({ mapLib: n }) => new n.AttributionControl(t), {
6
+ position: t.position
7
+ });
8
+ return r(() => {
9
+ e(o._container, t.style);
10
+ }, [t.style]), null;
29
11
  }
30
- s(d(b));
12
+ i(m);
31
13
  //# sourceMappingURL=index.es71.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es71.js","sources":["../../../node_modules/react-map-gl/dist/esm/components/geolocate-control.js"],"sourcesContent":["import { useImperativeHandle, useRef, useEffect, forwardRef, memo } from 'react';\nimport { applyReactStyle } from '../utils/apply-react-style';\nimport useControl from './use-control';\nfunction GeolocateControl(props, ref) {\n const thisRef = useRef({ props });\n const ctrl = useControl(({ mapLib }) => {\n const gc = new mapLib.GeolocateControl(props);\n // Hack: fix GeolocateControl reuse\n // When using React strict mode, the component is mounted twice.\n // GeolocateControl's UI creation is asynchronous. Removing and adding it back causes the UI to be initialized twice.\n // @ts-expect-error private method\n const setupUI = gc._setupUI;\n // @ts-expect-error private method\n gc._setupUI = args => {\n if (!gc._container.hasChildNodes()) {\n setupUI(args);\n }\n };\n gc.on('geolocate', e => {\n var _a, _b;\n (_b = (_a = thisRef.current.props).onGeolocate) === null || _b === void 0 ? void 0 : _b.call(_a, e);\n });\n gc.on('error', e => {\n var _a, _b;\n (_b = (_a = thisRef.current.props).onError) === null || _b === void 0 ? void 0 : _b.call(_a, e);\n });\n gc.on('outofmaxbounds', e => {\n var _a, _b;\n (_b = (_a = thisRef.current.props).onOutOfMaxBounds) === null || _b === void 0 ? void 0 : _b.call(_a, e);\n });\n gc.on('trackuserlocationstart', e => {\n var _a, _b;\n (_b = (_a = thisRef.current.props).onTrackUserLocationStart) === null || _b === void 0 ? void 0 : _b.call(_a, e);\n });\n gc.on('trackuserlocationend', e => {\n var _a, _b;\n (_b = (_a = thisRef.current.props).onTrackUserLocationEnd) === null || _b === void 0 ? void 0 : _b.call(_a, e);\n });\n return gc;\n }, { position: props.position });\n thisRef.current.props = props;\n useImperativeHandle(ref, () => ctrl, []);\n useEffect(() => {\n applyReactStyle(ctrl._container, props.style);\n }, [props.style]);\n return null;\n}\nexport default memo(forwardRef(GeolocateControl));\n//# sourceMappingURL=geolocate-control.js.map"],"names":["GeolocateControl","props","ref","thisRef","useRef","ctrl","useControl","mapLib","gc","setupUI","args","e","_a","_b","useImperativeHandle","useEffect","applyReactStyle","memo","forwardRef"],"mappings":";;;AAGA,SAASA,EAAiBC,GAAOC,GAAK;AAClC,QAAMC,IAAUC,EAAO,EAAE,OAAAH,EAAO,CAAA,GAC1BI,IAAOC,EAAW,CAAC,EAAE,QAAAC,QAAa;AACpC,UAAMC,IAAK,IAAID,EAAO,iBAAiBN,CAAK,GAKtCQ,IAAUD,EAAG;AAEnB,WAAAA,EAAG,WAAW,CAAQE,MAAA;AAClB,MAAKF,EAAG,WAAW,mBACfC,EAAQC,CAAI;AAAA,IAChB,GAEDF,EAAA,GAAG,aAAa,CAAKG,MAAA;AACpB,UAAIC,GAAIC;AACR,OAACA,KAAMD,IAAKT,EAAQ,QAAQ,OAAO,iBAAiB,QAAQU,MAAO,UAAkBA,EAAG,KAAKD,GAAID,CAAC;AAAA,IAAA,CACrG,GACEH,EAAA,GAAG,SAAS,CAAKG,MAAA;AAChB,UAAIC,GAAIC;AACR,OAACA,KAAMD,IAAKT,EAAQ,QAAQ,OAAO,aAAa,QAAQU,MAAO,UAAkBA,EAAG,KAAKD,GAAID,CAAC;AAAA,IAAA,CACjG,GACEH,EAAA,GAAG,kBAAkB,CAAKG,MAAA;AACzB,UAAIC,GAAIC;AACR,OAACA,KAAMD,IAAKT,EAAQ,QAAQ,OAAO,sBAAsB,QAAQU,MAAO,UAAkBA,EAAG,KAAKD,GAAID,CAAC;AAAA,IAAA,CAC1G,GACEH,EAAA,GAAG,0BAA0B,CAAKG,MAAA;AACjC,UAAIC,GAAIC;AACR,OAACA,KAAMD,IAAKT,EAAQ,QAAQ,OAAO,8BAA8B,QAAQU,MAAO,UAAkBA,EAAG,KAAKD,GAAID,CAAC;AAAA,IAAA,CAClH,GACEH,EAAA,GAAG,wBAAwB,CAAKG,MAAA;AAC/B,UAAIC,GAAIC;AACR,OAACA,KAAMD,IAAKT,EAAQ,QAAQ,OAAO,4BAA4B,QAAQU,MAAO,UAAkBA,EAAG,KAAKD,GAAID,CAAC;AAAA,IAAA,CAChH,GACMH;AAAA,EACR,GAAA,EAAE,UAAUP,EAAM,SAAU,CAAA;AAC/B,SAAAE,EAAQ,QAAQ,QAAQF,GACxBa,EAAoBZ,GAAK,MAAMG,GAAM,CAAE,CAAA,GACvCU,EAAU,MAAM;AACI,IAAAC,EAAAX,EAAK,YAAYJ,EAAM,KAAK;AAAA,EAAA,GAC7C,CAACA,EAAM,KAAK,CAAC,GACT;AACX;AACegB,EAAKC,EAAWlB,CAAgB,CAAC;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es71.js","sources":["../../../node_modules/react-map-gl/dist/esm/components/attribution-control.js"],"sourcesContent":["import { useEffect, memo } from 'react';\nimport { applyReactStyle } from '../utils/apply-react-style';\nimport useControl from './use-control';\nfunction AttributionControl(props) {\n const ctrl = useControl(({ mapLib }) => new mapLib.AttributionControl(props), {\n position: props.position\n });\n useEffect(() => {\n applyReactStyle(ctrl._container, props.style);\n }, [props.style]);\n return null;\n}\nexport default memo(AttributionControl);\n//# sourceMappingURL=attribution-control.js.map"],"names":["AttributionControl","props","ctrl","useControl","mapLib","useEffect","applyReactStyle","memo"],"mappings":";;;AAGA,SAASA,EAAmBC,GAAO;AACzB,QAAAC,IAAOC,EAAW,CAAC,EAAE,QAAAC,QAAa,IAAIA,EAAO,mBAAmBH,CAAK,GAAG;AAAA,IAC1E,UAAUA,EAAM;AAAA,EAAA,CACnB;AACD,SAAAI,EAAU,MAAM;AACI,IAAAC,EAAAJ,EAAK,YAAYD,EAAM,KAAK;AAAA,EAAA,GAC7C,CAACA,EAAM,KAAK,CAAC,GACT;AACX;AACeM,EAAKP,CAAkB;","x_google_ignoreList":[0]}
@@ -1,15 +1,15 @@
1
- import { memo as i, useEffect as e } from "react";
2
- import { applyReactStyle as l } from "./index.es186.js";
3
- import r from "./index.es16.js";
4
- function a(t) {
5
- const o = r(({ mapLib: n }) => new n.NavigationControl(t), {
6
- position: t.position
7
- });
8
- return e(() => {
9
- l(o._container, t.style);
1
+ import { memo as o, useEffect as l } from "react";
2
+ import { applyReactStyle as r } from "./index.es186.js";
3
+ import c from "./index.es16.js";
4
+ function i(t) {
5
+ const n = c(({ mapLib: e }) => new e.FullscreenControl({
6
+ container: t.containerId && document.getElementById(t.containerId)
7
+ }), { position: t.position });
8
+ return l(() => {
9
+ r(n._controlContainer, t.style);
10
10
  }, [t.style]), null;
11
11
  }
12
- const s = i(a);
12
+ const s = o(i);
13
13
  export {
14
14
  s as default
15
15
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.es72.js","sources":["../../../node_modules/react-map-gl/dist/esm/components/navigation-control.js"],"sourcesContent":["import { useEffect, memo } from 'react';\nimport { applyReactStyle } from '../utils/apply-react-style';\nimport useControl from './use-control';\nfunction NavigationControl(props) {\n const ctrl = useControl(({ mapLib }) => new mapLib.NavigationControl(props), {\n position: props.position\n });\n useEffect(() => {\n applyReactStyle(ctrl._container, props.style);\n }, [props.style]);\n return null;\n}\nexport default memo(NavigationControl);\n//# sourceMappingURL=navigation-control.js.map"],"names":["NavigationControl","props","ctrl","useControl","mapLib","useEffect","applyReactStyle","_NavigationControl","memo"],"mappings":";;;AAGA,SAASA,EAAkBC,GAAO;AACxB,QAAAC,IAAOC,EAAW,CAAC,EAAE,QAAAC,QAAa,IAAIA,EAAO,kBAAkBH,CAAK,GAAG;AAAA,IACzE,UAAUA,EAAM;AAAA,EAAA,CACnB;AACD,SAAAI,EAAU,MAAM;AACI,IAAAC,EAAAJ,EAAK,YAAYD,EAAM,KAAK;AAAA,EAAA,GAC7C,CAACA,EAAM,KAAK,CAAC,GACT;AACX;AACA,MAAeM,IAAAC,EAAKR,CAAiB;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es72.js","sources":["../../../node_modules/react-map-gl/dist/esm/components/fullscreen-control.js"],"sourcesContent":["import { useEffect, memo } from 'react';\nimport { applyReactStyle } from '../utils/apply-react-style';\nimport useControl from './use-control';\nfunction FullscreenControl(props) {\n const ctrl = useControl(({ mapLib }) => new mapLib.FullscreenControl({\n container: props.containerId && document.getElementById(props.containerId)\n }), { position: props.position });\n useEffect(() => {\n applyReactStyle(ctrl._controlContainer, props.style);\n }, [props.style]);\n return null;\n}\nexport default memo(FullscreenControl);\n//# sourceMappingURL=fullscreen-control.js.map"],"names":["FullscreenControl","props","ctrl","useControl","mapLib","useEffect","applyReactStyle","_FullscreenControl","memo"],"mappings":";;;AAGA,SAASA,EAAkBC,GAAO;AACxB,QAAAC,IAAOC,EAAW,CAAC,EAAE,QAAAC,QAAa,IAAIA,EAAO,kBAAkB;AAAA,IACjE,WAAWH,EAAM,eAAe,SAAS,eAAeA,EAAM,WAAW;AAAA,EAC5E,CAAA,GAAG,EAAE,UAAUA,EAAM,SAAU,CAAA;AAChC,SAAAI,EAAU,MAAM;AACI,IAAAC,EAAAJ,EAAK,mBAAmBD,EAAM,KAAK;AAAA,EAAA,GACpD,CAACA,EAAM,KAAK,CAAC,GACT;AACX;AACA,MAAeM,IAAAC,EAAKR,CAAiB;","x_google_ignoreList":[0]}
@@ -1,15 +1,31 @@
1
- import { memo as m, useRef as u, useEffect as l } from "react";
2
- import { applyReactStyle as a } from "./index.es186.js";
3
- import f from "./index.es16.js";
4
- function r(t) {
5
- const i = f(({ mapLib: c }) => new c.ScaleControl(t), {
6
- position: t.position
7
- }), n = u(t), e = n.current;
8
- n.current = t;
9
- const { style: o } = t;
10
- return t.maxWidth !== void 0 && t.maxWidth !== e.maxWidth && (i.options.maxWidth = t.maxWidth), t.unit !== void 0 && t.unit !== e.unit && i.setUnit(t.unit), l(() => {
11
- a(i._container, o);
12
- }, [o]), null;
1
+ import { memo as s, forwardRef as d, useRef as v, useImperativeHandle as _, useEffect as f } from "react";
2
+ import { applyReactStyle as p } from "./index.es186.js";
3
+ import m from "./index.es16.js";
4
+ function b(e, c) {
5
+ const a = v({ props: e }), l = m(({ mapLib: i }) => {
6
+ const n = new i.GeolocateControl(e), u = n._setupUI;
7
+ return n._setupUI = (t) => {
8
+ n._container.hasChildNodes() || u(t);
9
+ }, n.on("geolocate", (t) => {
10
+ var r, o;
11
+ (o = (r = a.current.props).onGeolocate) === null || o === void 0 || o.call(r, t);
12
+ }), n.on("error", (t) => {
13
+ var r, o;
14
+ (o = (r = a.current.props).onError) === null || o === void 0 || o.call(r, t);
15
+ }), n.on("outofmaxbounds", (t) => {
16
+ var r, o;
17
+ (o = (r = a.current.props).onOutOfMaxBounds) === null || o === void 0 || o.call(r, t);
18
+ }), n.on("trackuserlocationstart", (t) => {
19
+ var r, o;
20
+ (o = (r = a.current.props).onTrackUserLocationStart) === null || o === void 0 || o.call(r, t);
21
+ }), n.on("trackuserlocationend", (t) => {
22
+ var r, o;
23
+ (o = (r = a.current.props).onTrackUserLocationEnd) === null || o === void 0 || o.call(r, t);
24
+ }), n;
25
+ }, { position: e.position });
26
+ return a.current.props = e, _(c, () => l, []), f(() => {
27
+ p(l._container, e.style);
28
+ }, [e.style]), null;
13
29
  }
14
- m(r);
30
+ s(d(b));
15
31
  //# sourceMappingURL=index.es73.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es73.js","sources":["../../../node_modules/react-map-gl/dist/esm/components/scale-control.js"],"sourcesContent":["import { useEffect, useRef, memo } from 'react';\nimport { applyReactStyle } from '../utils/apply-react-style';\nimport useControl from './use-control';\nfunction ScaleControl(props) {\n const ctrl = useControl(({ mapLib }) => new mapLib.ScaleControl(props), {\n position: props.position\n });\n const propsRef = useRef(props);\n const prevProps = propsRef.current;\n propsRef.current = props;\n const { style } = props;\n if (props.maxWidth !== undefined && props.maxWidth !== prevProps.maxWidth) {\n ctrl.options.maxWidth = props.maxWidth;\n }\n if (props.unit !== undefined && props.unit !== prevProps.unit) {\n ctrl.setUnit(props.unit);\n }\n useEffect(() => {\n applyReactStyle(ctrl._container, style);\n }, [style]);\n return null;\n}\nexport default memo(ScaleControl);\n//# sourceMappingURL=scale-control.js.map"],"names":["ScaleControl","props","ctrl","useControl","mapLib","propsRef","useRef","prevProps","style","useEffect","applyReactStyle","memo"],"mappings":";;;AAGA,SAASA,EAAaC,GAAO;AACnB,QAAAC,IAAOC,EAAW,CAAC,EAAE,QAAAC,QAAa,IAAIA,EAAO,aAAaH,CAAK,GAAG;AAAA,IACpE,UAAUA,EAAM;AAAA,EAAA,CACnB,GACKI,IAAWC,EAAOL,CAAK,GACvBM,IAAYF,EAAS;AAC3B,EAAAA,EAAS,UAAUJ;AACb,QAAA,EAAE,OAAAO,EAAU,IAAAP;AAClB,SAAIA,EAAM,aAAa,UAAaA,EAAM,aAAaM,EAAU,aACxDL,EAAA,QAAQ,WAAWD,EAAM,WAE9BA,EAAM,SAAS,UAAaA,EAAM,SAASM,EAAU,QAChDL,EAAA,QAAQD,EAAM,IAAI,GAE3BQ,EAAU,MAAM;AACI,IAAAC,EAAAR,EAAK,YAAYM,CAAK;AAAA,EAAA,GACvC,CAACA,CAAK,CAAC,GACH;AACX;AACeG,EAAKX,CAAY;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es73.js","sources":["../../../node_modules/react-map-gl/dist/esm/components/geolocate-control.js"],"sourcesContent":["import { useImperativeHandle, useRef, useEffect, forwardRef, memo } from 'react';\nimport { applyReactStyle } from '../utils/apply-react-style';\nimport useControl from './use-control';\nfunction GeolocateControl(props, ref) {\n const thisRef = useRef({ props });\n const ctrl = useControl(({ mapLib }) => {\n const gc = new mapLib.GeolocateControl(props);\n // Hack: fix GeolocateControl reuse\n // When using React strict mode, the component is mounted twice.\n // GeolocateControl's UI creation is asynchronous. Removing and adding it back causes the UI to be initialized twice.\n // @ts-expect-error private method\n const setupUI = gc._setupUI;\n // @ts-expect-error private method\n gc._setupUI = args => {\n if (!gc._container.hasChildNodes()) {\n setupUI(args);\n }\n };\n gc.on('geolocate', e => {\n var _a, _b;\n (_b = (_a = thisRef.current.props).onGeolocate) === null || _b === void 0 ? void 0 : _b.call(_a, e);\n });\n gc.on('error', e => {\n var _a, _b;\n (_b = (_a = thisRef.current.props).onError) === null || _b === void 0 ? void 0 : _b.call(_a, e);\n });\n gc.on('outofmaxbounds', e => {\n var _a, _b;\n (_b = (_a = thisRef.current.props).onOutOfMaxBounds) === null || _b === void 0 ? void 0 : _b.call(_a, e);\n });\n gc.on('trackuserlocationstart', e => {\n var _a, _b;\n (_b = (_a = thisRef.current.props).onTrackUserLocationStart) === null || _b === void 0 ? void 0 : _b.call(_a, e);\n });\n gc.on('trackuserlocationend', e => {\n var _a, _b;\n (_b = (_a = thisRef.current.props).onTrackUserLocationEnd) === null || _b === void 0 ? void 0 : _b.call(_a, e);\n });\n return gc;\n }, { position: props.position });\n thisRef.current.props = props;\n useImperativeHandle(ref, () => ctrl, []);\n useEffect(() => {\n applyReactStyle(ctrl._container, props.style);\n }, [props.style]);\n return null;\n}\nexport default memo(forwardRef(GeolocateControl));\n//# sourceMappingURL=geolocate-control.js.map"],"names":["GeolocateControl","props","ref","thisRef","useRef","ctrl","useControl","mapLib","gc","setupUI","args","e","_a","_b","useImperativeHandle","useEffect","applyReactStyle","memo","forwardRef"],"mappings":";;;AAGA,SAASA,EAAiBC,GAAOC,GAAK;AAClC,QAAMC,IAAUC,EAAO,EAAE,OAAAH,EAAO,CAAA,GAC1BI,IAAOC,EAAW,CAAC,EAAE,QAAAC,QAAa;AACpC,UAAMC,IAAK,IAAID,EAAO,iBAAiBN,CAAK,GAKtCQ,IAAUD,EAAG;AAEnB,WAAAA,EAAG,WAAW,CAAQE,MAAA;AAClB,MAAKF,EAAG,WAAW,mBACfC,EAAQC,CAAI;AAAA,IAChB,GAEDF,EAAA,GAAG,aAAa,CAAKG,MAAA;AACpB,UAAIC,GAAIC;AACR,OAACA,KAAMD,IAAKT,EAAQ,QAAQ,OAAO,iBAAiB,QAAQU,MAAO,UAAkBA,EAAG,KAAKD,GAAID,CAAC;AAAA,IAAA,CACrG,GACEH,EAAA,GAAG,SAAS,CAAKG,MAAA;AAChB,UAAIC,GAAIC;AACR,OAACA,KAAMD,IAAKT,EAAQ,QAAQ,OAAO,aAAa,QAAQU,MAAO,UAAkBA,EAAG,KAAKD,GAAID,CAAC;AAAA,IAAA,CACjG,GACEH,EAAA,GAAG,kBAAkB,CAAKG,MAAA;AACzB,UAAIC,GAAIC;AACR,OAACA,KAAMD,IAAKT,EAAQ,QAAQ,OAAO,sBAAsB,QAAQU,MAAO,UAAkBA,EAAG,KAAKD,GAAID,CAAC;AAAA,IAAA,CAC1G,GACEH,EAAA,GAAG,0BAA0B,CAAKG,MAAA;AACjC,UAAIC,GAAIC;AACR,OAACA,KAAMD,IAAKT,EAAQ,QAAQ,OAAO,8BAA8B,QAAQU,MAAO,UAAkBA,EAAG,KAAKD,GAAID,CAAC;AAAA,IAAA,CAClH,GACEH,EAAA,GAAG,wBAAwB,CAAKG,MAAA;AAC/B,UAAIC,GAAIC;AACR,OAACA,KAAMD,IAAKT,EAAQ,QAAQ,OAAO,4BAA4B,QAAQU,MAAO,UAAkBA,EAAG,KAAKD,GAAID,CAAC;AAAA,IAAA,CAChH,GACMH;AAAA,EACR,GAAA,EAAE,UAAUP,EAAM,SAAU,CAAA;AAC/B,SAAAE,EAAQ,QAAQ,QAAQF,GACxBa,EAAoBZ,GAAK,MAAMG,GAAM,CAAE,CAAA,GACvCU,EAAU,MAAM;AACI,IAAAC,EAAAX,EAAK,YAAYJ,EAAM,KAAK;AAAA,EAAA,GAC7C,CAACA,EAAM,KAAK,CAAC,GACT;AACX;AACegB,EAAKC,EAAWlB,CAAgB,CAAC;","x_google_ignoreList":[0]}
@@ -1,14 +1,16 @@
1
- import * as e from "react";
2
- import { useContext as n, useMemo as a } from "react";
3
- import { MapContext as u } from "./index.es66.js";
4
- const p = e.createContext(null);
5
- function c() {
6
- var o;
7
- const r = (o = n(p)) === null || o === void 0 ? void 0 : o.maps, t = n(u);
8
- return a(() => ({ ...r, current: t == null ? void 0 : t.map }), [r, t]);
1
+ import { memo as i, useEffect as e } from "react";
2
+ import { applyReactStyle as l } from "./index.es186.js";
3
+ import r from "./index.es16.js";
4
+ function a(t) {
5
+ const o = r(({ mapLib: n }) => new n.NavigationControl(t), {
6
+ position: t.position
7
+ });
8
+ return e(() => {
9
+ l(o._container, t.style);
10
+ }, [t.style]), null;
9
11
  }
12
+ const s = i(a);
10
13
  export {
11
- p as MountedMapsContext,
12
- c as useMap
14
+ s as default
13
15
  };
14
16
  //# sourceMappingURL=index.es74.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es74.js","sources":["../../../node_modules/react-map-gl/dist/esm/components/use-map.js"],"sourcesContent":["import * as React from 'react';\nimport { useState, useCallback, useMemo, useContext } from 'react';\nimport { MapContext } from './map';\nexport const MountedMapsContext = React.createContext(null);\nexport const MapProvider = props => {\n const [maps, setMaps] = useState({});\n const onMapMount = useCallback((map, id = 'default') => {\n setMaps(currMaps => {\n if (id === 'current') {\n throw new Error(\"'current' cannot be used as map id\");\n }\n if (currMaps[id]) {\n throw new Error(`Multiple maps with the same id: ${id}`);\n }\n return { ...currMaps, [id]: map };\n });\n }, []);\n const onMapUnmount = useCallback((id = 'default') => {\n setMaps(currMaps => {\n if (currMaps[id]) {\n const nextMaps = { ...currMaps };\n delete nextMaps[id];\n return nextMaps;\n }\n return currMaps;\n });\n }, []);\n return (React.createElement(MountedMapsContext.Provider, { value: {\n maps,\n onMapMount,\n onMapUnmount\n } }, props.children));\n};\nexport function useMap() {\n var _a;\n const maps = (_a = useContext(MountedMapsContext)) === null || _a === void 0 ? void 0 : _a.maps;\n const currentMap = useContext(MapContext);\n const mapsWithCurrent = useMemo(() => {\n return { ...maps, current: currentMap === null || currentMap === void 0 ? void 0 : currentMap.map };\n }, [maps, currentMap]);\n return mapsWithCurrent;\n}\n//# sourceMappingURL=use-map.js.map"],"names":["MountedMapsContext","React","useMap","_a","maps","useContext","currentMap","MapContext","useMemo"],"mappings":";;;AAGa,MAAAA,IAAqBC,EAAM,cAAc,IAAI;AA8BnD,SAASC,IAAS;AACjB,MAAAC;AACE,QAAAC,KAAQD,IAAKE,EAAWL,CAAkB,OAAO,QAAQG,MAAO,SAAS,SAASA,EAAG,MACrFG,IAAaD,EAAWE,CAAU;AAIjC,SAHiBC,EAAQ,OACrB,EAAE,GAAGJ,GAAM,SAASE,KAAe,OAAgC,SAASA,EAAW,IAAI,IACnG,CAACF,GAAME,CAAU,CAAC;AAEzB;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es74.js","sources":["../../../node_modules/react-map-gl/dist/esm/components/navigation-control.js"],"sourcesContent":["import { useEffect, memo } from 'react';\nimport { applyReactStyle } from '../utils/apply-react-style';\nimport useControl from './use-control';\nfunction NavigationControl(props) {\n const ctrl = useControl(({ mapLib }) => new mapLib.NavigationControl(props), {\n position: props.position\n });\n useEffect(() => {\n applyReactStyle(ctrl._container, props.style);\n }, [props.style]);\n return null;\n}\nexport default memo(NavigationControl);\n//# sourceMappingURL=navigation-control.js.map"],"names":["NavigationControl","props","ctrl","useControl","mapLib","useEffect","applyReactStyle","_NavigationControl","memo"],"mappings":";;;AAGA,SAASA,EAAkBC,GAAO;AACxB,QAAAC,IAAOC,EAAW,CAAC,EAAE,QAAAC,QAAa,IAAIA,EAAO,kBAAkBH,CAAK,GAAG;AAAA,IACzE,UAAUA,EAAM;AAAA,EAAA,CACnB;AACD,SAAAI,EAAU,MAAM;AACI,IAAAC,EAAAJ,EAAK,YAAYD,EAAM,KAAK;AAAA,EAAA,GAC7C,CAACA,EAAM,KAAK,CAAC,GACT;AACX;AACA,MAAeM,IAAAC,EAAKR,CAAiB;","x_google_ignoreList":[0]}
@@ -1,5 +1,15 @@
1
- var r = {};
2
- export {
3
- r as __exports
4
- };
1
+ import { memo as m, useRef as u, useEffect as l } from "react";
2
+ import { applyReactStyle as a } from "./index.es186.js";
3
+ import f from "./index.es16.js";
4
+ function r(t) {
5
+ const i = f(({ mapLib: c }) => new c.ScaleControl(t), {
6
+ position: t.position
7
+ }), n = u(t), e = n.current;
8
+ n.current = t;
9
+ const { style: o } = t;
10
+ return t.maxWidth !== void 0 && t.maxWidth !== e.maxWidth && (i.options.maxWidth = t.maxWidth), t.unit !== void 0 && t.unit !== e.unit && i.setUnit(t.unit), l(() => {
11
+ a(i._container, o);
12
+ }, [o]), null;
13
+ }
14
+ m(r);
5
15
  //# sourceMappingURL=index.es75.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es75.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"index.es75.js","sources":["../../../node_modules/react-map-gl/dist/esm/components/scale-control.js"],"sourcesContent":["import { useEffect, useRef, memo } from 'react';\nimport { applyReactStyle } from '../utils/apply-react-style';\nimport useControl from './use-control';\nfunction ScaleControl(props) {\n const ctrl = useControl(({ mapLib }) => new mapLib.ScaleControl(props), {\n position: props.position\n });\n const propsRef = useRef(props);\n const prevProps = propsRef.current;\n propsRef.current = props;\n const { style } = props;\n if (props.maxWidth !== undefined && props.maxWidth !== prevProps.maxWidth) {\n ctrl.options.maxWidth = props.maxWidth;\n }\n if (props.unit !== undefined && props.unit !== prevProps.unit) {\n ctrl.setUnit(props.unit);\n }\n useEffect(() => {\n applyReactStyle(ctrl._container, style);\n }, [style]);\n return null;\n}\nexport default memo(ScaleControl);\n//# sourceMappingURL=scale-control.js.map"],"names":["ScaleControl","props","ctrl","useControl","mapLib","propsRef","useRef","prevProps","style","useEffect","applyReactStyle","memo"],"mappings":";;;AAGA,SAASA,EAAaC,GAAO;AACnB,QAAAC,IAAOC,EAAW,CAAC,EAAE,QAAAC,QAAa,IAAIA,EAAO,aAAaH,CAAK,GAAG;AAAA,IACpE,UAAUA,EAAM;AAAA,EAAA,CACnB,GACKI,IAAWC,EAAOL,CAAK,GACvBM,IAAYF,EAAS;AAC3B,EAAAA,EAAS,UAAUJ;AACb,QAAA,EAAE,OAAAO,EAAU,IAAAP;AAClB,SAAIA,EAAM,aAAa,UAAaA,EAAM,aAAaM,EAAU,aACxDL,EAAA,QAAQ,WAAWD,EAAM,WAE9BA,EAAM,SAAS,UAAaA,EAAM,SAASM,EAAU,QAChDL,EAAA,QAAQD,EAAM,IAAI,GAE3BQ,EAAU,MAAM;AACI,IAAAC,EAAAR,EAAK,YAAYM,CAAK;AAAA,EAAA,GACvC,CAACA,CAAK,CAAC,GACH;AACX;AACeG,EAAKX,CAAY;","x_google_ignoreList":[0]}
@@ -1,5 +1,14 @@
1
- var e = {};
1
+ import * as e from "react";
2
+ import { useContext as n, useMemo as a } from "react";
3
+ import { MapContext as u } from "./index.es68.js";
4
+ const p = e.createContext(null);
5
+ function c() {
6
+ var o;
7
+ const r = (o = n(p)) === null || o === void 0 ? void 0 : o.maps, t = n(u);
8
+ return a(() => ({ ...r, current: t == null ? void 0 : t.map }), [r, t]);
9
+ }
2
10
  export {
3
- e as __exports
11
+ p as MountedMapsContext,
12
+ c as useMap
4
13
  };
5
14
  //# sourceMappingURL=index.es76.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es76.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"index.es76.js","sources":["../../../node_modules/react-map-gl/dist/esm/components/use-map.js"],"sourcesContent":["import * as React from 'react';\nimport { useState, useCallback, useMemo, useContext } from 'react';\nimport { MapContext } from './map';\nexport const MountedMapsContext = React.createContext(null);\nexport const MapProvider = props => {\n const [maps, setMaps] = useState({});\n const onMapMount = useCallback((map, id = 'default') => {\n setMaps(currMaps => {\n if (id === 'current') {\n throw new Error(\"'current' cannot be used as map id\");\n }\n if (currMaps[id]) {\n throw new Error(`Multiple maps with the same id: ${id}`);\n }\n return { ...currMaps, [id]: map };\n });\n }, []);\n const onMapUnmount = useCallback((id = 'default') => {\n setMaps(currMaps => {\n if (currMaps[id]) {\n const nextMaps = { ...currMaps };\n delete nextMaps[id];\n return nextMaps;\n }\n return currMaps;\n });\n }, []);\n return (React.createElement(MountedMapsContext.Provider, { value: {\n maps,\n onMapMount,\n onMapUnmount\n } }, props.children));\n};\nexport function useMap() {\n var _a;\n const maps = (_a = useContext(MountedMapsContext)) === null || _a === void 0 ? void 0 : _a.maps;\n const currentMap = useContext(MapContext);\n const mapsWithCurrent = useMemo(() => {\n return { ...maps, current: currentMap === null || currentMap === void 0 ? void 0 : currentMap.map };\n }, [maps, currentMap]);\n return mapsWithCurrent;\n}\n//# sourceMappingURL=use-map.js.map"],"names":["MountedMapsContext","React","useMap","_a","maps","useContext","currentMap","MapContext","useMemo"],"mappings":";;;AAGa,MAAAA,IAAqBC,EAAM,cAAc,IAAI;AA8BnD,SAASC,IAAS;AACjB,MAAAC;AACE,QAAAC,KAAQD,IAAKE,EAAWL,CAAkB,OAAO,QAAQG,MAAO,SAAS,SAASA,EAAG,MACrFG,IAAaD,EAAWE,CAAU;AAIjC,SAHiBC,EAAQ,OACrB,EAAE,GAAGJ,GAAM,SAASE,KAAe,OAAgC,SAASA,EAAW,IAAI,IACnG,CAACF,GAAME,CAAU,CAAC;AAEzB;","x_google_ignoreList":[0]}
@@ -1,5 +1,5 @@
1
1
  import { useContext as m, useRef as L, useState as g, useMemo as x, useEffect as h } from "react";
2
- import { MapContext as b } from "./index.es66.js";
2
+ import { MapContext as b } from "./index.es68.js";
3
3
  import d from "./index.es188.js";
4
4
  import { deepEqual as l } from "./index.es187.js";
5
5
  function k(t, e, a, o) {
@@ -1,6 +1,6 @@
1
1
  import * as u from "react";
2
2
  import { useContext as f, useRef as y, useState as m, useMemo as g, useEffect as S, cloneElement as h } from "react";
3
- import { MapContext as C } from "./index.es66.js";
3
+ import { MapContext as C } from "./index.es68.js";
4
4
  import s from "./index.es188.js";
5
5
  import { deepEqual as v } from "./index.es187.js";
6
6
  let x = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@performant-software/geospatial",
3
- "version": "2.2.20-beta.6",
3
+ "version": "2.2.21-beta.1",
4
4
  "description": "A package of components for all things map-related.",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.cjs.js",
package/build/index.js DELETED
@@ -1,2 +0,0 @@
1
- (()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{DrawControl:()=>u,GeoJsonLayer:()=>v,LayerMenu:()=>I,MapControl:()=>A,MapDraw:()=>q,RasterLayer:()=>U});const r=require("@mapbox/mapbox-gl-draw");var n=e.n(r);const o=require("react");var a=e.n(o);const i=require("react-map-gl");var l=e.n(i);const u=(0,o.forwardRef)((function(e,t){var r=(0,i.useControl)((function(){return new(n())(e)}),(function(t){var r=t.map;r.on("draw.create",e.onCreate),r.on("draw.update",e.onUpdate),r.on("draw.delete",e.onDelete)}),(function(t){var r=t.map;r.off("draw.create",e.onCreate),r.off("draw.update",e.onUpdate),r.off("draw.delete",e.onDelete)}),{position:e.position});return(0,o.useImperativeHandle)(t,(function(){return r}),[r]),null})),c=require("underscore");var f=e.n(c);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var m="#CC3333",p="#990000",y={"fill-color":m,"fill-opacity":.2},d={"line-color":p,"line-opacity":.6},b={"circle-radius":["interpolate",["linear"],["number",["get","point_count"],1],0,4,10,14],"circle-stroke-width":1,"circle-color":m,"circle-stroke-color":p};const v=function(e){var t,r,n=(t=(0,o.useState)(e.data),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw o}}return a}}(t,r)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),l=n[0],u=n[1],c=(0,o.useCallback)((function(e,t){return f().defaults(e,t)}),[]),m=(0,o.useMemo)((function(){return c(e.fillStyle,y)}),[c,e.fillStyle]),p=(0,o.useMemo)((function(){return c(e.lineStyle,d)}),[c,e.lineStyle]),v=(0,o.useMemo)((function(){return c(e.pointStyle,b)}),[c,e.pointStyle]);return(0,o.useEffect)((function(){e.url&&fetch(e.url).then((function(e){return e.json()})).then((function(e){return u(e)}))}),[e.url]),a().createElement(i.Source,{data:l,type:"geojson"},a().createElement(i.Layer,{filter:["!=","$type","Point"],paint:m,type:"fill"}),a().createElement(i.Layer,{filter:["!=","$type","Point"],paint:p,type:"line"}),a().createElement(i.Layer,{filter:["==","$type","Point"],paint:v,type:"circle"}))},h=require("react-icons/bs"),g=require("react-icons/io5"),w=require("maplibre-gl");var S=e.n(w);const O=require("react-dom");function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function C(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var j=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._map=null,this._redraw=t}var t,r;return t=e,(r=[{key:"onAdd",value:function(e){return this._map=e,e.on("move",this._redraw),this._container=document.createElement("div"),this._container.className="maplibregl-ctrl-group maplibregl-ctrl",this._redraw(),this._container}},{key:"onRemove",value:function(){this._container.remove(),this._map.off("move",this._redraw),this._map=null}},{key:"getMap",value:function(){return this._map}},{key:"getElement",value:function(){return this._container}}])&&C(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();const A=function(e){var t,r,n=(t=(0,o.useState)(0),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw o}}return a}}(t,r)||function(e,t){if(e){if("string"==typeof e)return E(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?E(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[1],a=(0,o.useCallback)((function(){return n((function(e){return e+1}))}),[]),l=(0,i.useControl)((function(){return new j(a)}),{position:e.position}),u=l.getMap(),c=o.Children.map(f().compact(o.Children.toArray(e.children)),(function(e){return(0,o.cloneElement)(e,{map:u})}));return(0,o.useEffect)((function(){e.mapRef&&(e.mapRef.current=u)}),[u,e.mapRef]),u&&(0,O.createPortal)(c,l.getElement())};function _(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw o}}return a}}(e,t)||P(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(e,t){if(e){if("string"==typeof e)return k(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?k(e,t):void 0}}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var x=function(e){var t=_((0,o.useState)(0),2),r=t[0],n=t[1],i=_((0,o.useState)(),2),l=i[0],u=i[1],c=_((0,o.useState)(!1),2),s=c[0],m=c[1],p=(0,o.useRef)(),y=(0,o.useCallback)((function(t){return e.names&&e.names.length>t&&e.names[t]}),[e.names]),d=(0,o.useCallback)((function(e){return f().includes(l,e)}),[l]),b=(0,o.useMemo)((function(){return o.Children.toArray(e.children)}),[e.children]),v=(0,o.useMemo)((function(){return f().filter(b,(function(e,t){return d(t)}))}),[b,d]),w=(0,o.useCallback)((function(e){var t,r;t=d(e)?f().without(l,e):[].concat(function(e){if(Array.isArray(e))return k(e)}(r=l)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||P(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[e]),u(t)}),[d,l]);return(0,o.useEffect)((function(){u(f().times(b.length,(function(e){return e})))}),[]),(0,o.useEffect)((function(){var e=p.current;if(e&&e._canvas){var t=p.current._canvas.offsetHeight;n(void 0===t?0:t)}}),[p.current]),f().isEmpty(b)?null:a().createElement(a().Fragment,null,a().createElement(A,{mapRef:p,position:e.position},a().createElement("button",{className:"mapbox-gl-draw_ctrl-draw-btn layer-button",onClick:function(){return m((function(e){return!e}))},type:"button"},a().createElement(h.BsStack,{size:"1.25em"})),s&&a().createElement("div",{className:"layer-menu",style:{maxHeight:"calc(".concat(r,"px - ").concat(30,"px)")}},a().createElement("div",{className:"menu"},f().map(b,(function(e,t){return a().createElement("div",{"aria-selected":d(t),className:"option",role:"option",onClick:function(){return w(t)},onKeyDown:function(){return w(t)},tabIndex:t},a().createElement("div",{className:"checkmark-container"},d(t)&&a().createElement(g.IoCheckmarkOutline,{size:"1em"})),y(t))}))))),v)};x.defaultProps={position:"top-left"};const I=x,M=require("@turf/turf");function R(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function z(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function D(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return L(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?L(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function L(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}n().constants.classes.CONTROL_BASE="maplibregl-ctrl",n().constants.classes.CONTROL_PREFIX="maplibregl-ctrl-",n().constants.classes.CONTROL_GROUP="maplibregl-ctrl-group";var T=function(e){var t=D((0,o.useState)(!1),2),r=t[0],n=t[1],i=(0,o.useRef)(),c=(0,o.useRef)(),s=(0,o.useCallback)((function(){e.onChange(i.current.getAll())}),[e.onChange]),m=(0,o.useMemo)((function(){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?R(Object(r),!0).forEach((function(t){z(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({height:500,width:"100%"},e.style||{})}),[e.style]);return(0,o.useEffect)((function(){if(r&&e.data){var t=(0,M.bbox)(e.data),n=(0,M.bboxPolygon)(t),o=(0,M.buffer)(n,e.buffer,{units:"miles"}),a=(0,M.bbox)(o);if(f().every(a,f().isFinite)){var l=D(a,4),u=[[l[0],l[1]],[l[2],l[3]]];c.current.fitBounds(u,{duration:e.zoomDuration})}"GeometryCollection"===e.data.type?f().each(e.data.geometries,(function(e){i.current.add((0,M.feature)(e))})):i.current.add(e.data)}}),[r,e.data]),a().createElement(l(),{attributionControl:!1,onLoad:function(){return n(!0)},mapLib:S(),ref:c,style:m,mapStyle:e.mapStyle},a().createElement(u,{ref:i,controls:{line_string:!0,point:!0,polygon:!0,trash:!0},displayControlsDefault:!1,onCreate:s,onUpdate:s,onDelete:s,position:"bottom-left"}),e.children)};T.defaultProps={buffer:2,zoomDuration:1e3};const q=T;var N=function(e){return a().createElement(i.Source,{tileSize:e.tileSize,tiles:[e.url],type:"raster"},a().createElement(i.Layer,{type:"raster",paint:{"raster-opacity":e.opacity},minzoom:e.minzoom,maxzoom:e.maxzoom}))};N.defaultProps={maxzoom:22,minzoom:0,opacity:.7,tileSize:256};const U=N;module.exports=t})();
2
- //# sourceMappingURL=index.js.map