@performant-software/geospatial 2.2.23-beta.13 → 2.2.23-beta.15

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 (115) hide show
  1. package/build/index.js +2 -0
  2. package/build/index.js.map +1 -0
  3. package/build/main.css +127 -0
  4. package/dist/index.cjs14.js +1 -1
  5. package/dist/index.cjs15.js +1 -1
  6. package/dist/index.cjs16.js +1 -1
  7. package/dist/index.cjs17.js +1 -1
  8. package/dist/index.cjs19.js +1 -1
  9. package/dist/index.cjs198.js +1 -1
  10. package/dist/index.cjs233.js +1 -1
  11. package/dist/index.cjs233.js.map +1 -1
  12. package/dist/index.cjs234.js +1 -1
  13. package/dist/index.cjs234.js.map +1 -1
  14. package/dist/index.cjs235.js +1 -1
  15. package/dist/index.cjs235.js.map +1 -1
  16. package/dist/index.cjs26.js +1 -1
  17. package/dist/index.cjs52.js +1 -1
  18. package/dist/index.cjs59.js +1 -1
  19. package/dist/index.cjs6.js +1 -1
  20. package/dist/index.cjs6.js.map +1 -1
  21. package/dist/index.cjs60.js +9 -1
  22. package/dist/index.cjs60.js.map +1 -1
  23. package/dist/index.cjs61.js +19 -1
  24. package/dist/index.cjs61.js.map +1 -1
  25. package/dist/index.cjs62.js +1 -9
  26. package/dist/index.cjs62.js.map +1 -1
  27. package/dist/index.cjs63.js +1 -19
  28. package/dist/index.cjs63.js.map +1 -1
  29. package/dist/index.cjs67.js +1 -1
  30. package/dist/index.cjs67.js.map +1 -1
  31. package/dist/index.cjs68.js +1 -1
  32. package/dist/index.cjs68.js.map +1 -1
  33. package/dist/index.cjs69.js +1 -1
  34. package/dist/index.cjs69.js.map +1 -1
  35. package/dist/index.cjs70.js +1 -1
  36. package/dist/index.cjs70.js.map +1 -1
  37. package/dist/index.cjs71.js +1 -1
  38. package/dist/index.cjs71.js.map +1 -1
  39. package/dist/index.cjs72.js +1 -1
  40. package/dist/index.cjs72.js.map +1 -1
  41. package/dist/index.cjs73.js +1 -1
  42. package/dist/index.cjs73.js.map +1 -1
  43. package/dist/index.cjs74.js +1 -1
  44. package/dist/index.cjs74.js.map +1 -1
  45. package/dist/index.cjs75.js +1 -1
  46. package/dist/index.cjs75.js.map +1 -1
  47. package/dist/index.cjs76.js +1 -1
  48. package/dist/index.cjs76.js.map +1 -1
  49. package/dist/index.cjs77.js +1 -1
  50. package/dist/index.cjs77.js.map +1 -1
  51. package/dist/index.cjs78.js +1 -1
  52. package/dist/index.cjs78.js.map +1 -1
  53. package/dist/index.cjs79.js +1 -1
  54. package/dist/index.cjs79.js.map +1 -1
  55. package/dist/index.cjs80.js +1 -1
  56. package/dist/index.cjs80.js.map +1 -1
  57. package/dist/index.es14.js +2 -2
  58. package/dist/index.es15.js +9 -9
  59. package/dist/index.es16.js +1 -1
  60. package/dist/index.es17.js +3 -3
  61. package/dist/index.es19.js +2 -2
  62. package/dist/index.es198.js +2 -2
  63. package/dist/index.es233.js +46 -3
  64. package/dist/index.es233.js.map +1 -1
  65. package/dist/index.es234.js +22 -45
  66. package/dist/index.es234.js.map +1 -1
  67. package/dist/index.es235.js +3 -23
  68. package/dist/index.es235.js.map +1 -1
  69. package/dist/index.es26.js +1 -1
  70. package/dist/index.es52.js +6 -6
  71. package/dist/index.es59.js +2 -6
  72. package/dist/index.es59.js.map +1 -1
  73. package/dist/index.es6.js +19 -19
  74. package/dist/index.es6.js.map +1 -1
  75. package/dist/index.es60.js +30 -2
  76. package/dist/index.es60.js.map +1 -1
  77. package/dist/index.es61.js +602 -2
  78. package/dist/index.es61.js.map +1 -1
  79. package/dist/index.es62.js +5 -29
  80. package/dist/index.es62.js.map +1 -1
  81. package/dist/index.es63.js +2 -602
  82. package/dist/index.es63.js.map +1 -1
  83. package/dist/index.es64.js +2 -2
  84. package/dist/index.es67.js +2 -55
  85. package/dist/index.es67.js.map +1 -1
  86. package/dist/index.es68.js +4 -48
  87. package/dist/index.es68.js.map +1 -1
  88. package/dist/index.es69.js +28 -37
  89. package/dist/index.es69.js.map +1 -1
  90. package/dist/index.es70.js +56 -11
  91. package/dist/index.es70.js.map +1 -1
  92. package/dist/index.es71.js +47 -14
  93. package/dist/index.es71.js.map +1 -1
  94. package/dist/index.es72.js +38 -29
  95. package/dist/index.es72.js.map +1 -1
  96. package/dist/index.es73.js +8 -11
  97. package/dist/index.es73.js.map +1 -1
  98. package/dist/index.es74.js +14 -13
  99. package/dist/index.es74.js.map +1 -1
  100. package/dist/index.es75.js +29 -12
  101. package/dist/index.es75.js.map +1 -1
  102. package/dist/index.es76.js +13 -2
  103. package/dist/index.es76.js.map +1 -1
  104. package/dist/index.es77.js +14 -4
  105. package/dist/index.es77.js.map +1 -1
  106. package/dist/index.es78.js +49 -26
  107. package/dist/index.es78.js.map +1 -1
  108. package/dist/index.es79.js +58 -44
  109. package/dist/index.es79.js.map +1 -1
  110. package/dist/index.es80.js +10 -64
  111. package/dist/index.es80.js.map +1 -1
  112. package/package.json +1 -1
  113. package/src/components/LocationMarkers.js +11 -1
  114. package/types/components/LocationMarker.js.flow +82 -0
  115. package/types/components/LocationMarkers.js.flow +11 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs79.js","sources":["../../../node_modules/react-map-gl/dist/esm/components/layer.js"],"sourcesContent":["import { useContext, useEffect, useMemo, useState, useRef } from 'react';\nimport { MapContext } from './map';\nimport assert from '../utils/assert';\nimport { deepEqual } from '../utils/deep-equal';\n/* eslint-disable complexity, max-statements */\nfunction updateLayer(map, id, props, prevProps) {\n assert(props.id === prevProps.id, 'layer id changed');\n assert(props.type === prevProps.type, 'layer type changed');\n if (props.type === 'custom' || prevProps.type === 'custom') {\n return;\n }\n const { layout = {}, paint = {}, filter, minzoom, maxzoom, beforeId } = props;\n if (beforeId !== prevProps.beforeId) {\n map.moveLayer(id, beforeId);\n }\n if (layout !== prevProps.layout) {\n const prevLayout = prevProps.layout || {};\n for (const key in layout) {\n if (!deepEqual(layout[key], prevLayout[key])) {\n map.setLayoutProperty(id, key, layout[key]);\n }\n }\n for (const key in prevLayout) {\n if (!layout.hasOwnProperty(key)) {\n map.setLayoutProperty(id, key, undefined);\n }\n }\n }\n if (paint !== prevProps.paint) {\n const prevPaint = prevProps.paint || {};\n for (const key in paint) {\n if (!deepEqual(paint[key], prevPaint[key])) {\n map.setPaintProperty(id, key, paint[key]);\n }\n }\n for (const key in prevPaint) {\n if (!paint.hasOwnProperty(key)) {\n map.setPaintProperty(id, key, undefined);\n }\n }\n }\n if (!deepEqual(filter, prevProps.filter)) {\n map.setFilter(id, filter);\n }\n if (minzoom !== prevProps.minzoom || maxzoom !== prevProps.maxzoom) {\n map.setLayerZoomRange(id, minzoom, maxzoom);\n }\n}\nfunction createLayer(map, id, props) {\n // @ts-ignore\n if (map.style && map.style._loaded && (!('source' in props) || map.getSource(props.source))) {\n const options = { ...props, id };\n delete options.beforeId;\n // @ts-ignore\n map.addLayer(options, props.beforeId);\n }\n}\n/* eslint-enable complexity, max-statements */\nlet layerCounter = 0;\nfunction Layer(props) {\n const map = useContext(MapContext).map.getMap();\n const propsRef = useRef(props);\n const [, setStyleLoaded] = useState(0);\n const id = useMemo(() => props.id || `jsx-layer-${layerCounter++}`, []);\n useEffect(() => {\n if (map) {\n const forceUpdate = () => setStyleLoaded(version => version + 1);\n map.on('styledata', forceUpdate);\n forceUpdate();\n return () => {\n map.off('styledata', forceUpdate);\n // @ts-ignore\n if (map.style && map.style._loaded && map.getLayer(id)) {\n map.removeLayer(id);\n }\n };\n }\n return undefined;\n }, [map]);\n // @ts-ignore\n const layer = map && map.style && map.getLayer(id);\n if (layer) {\n try {\n updateLayer(map, id, props, propsRef.current);\n }\n catch (error) {\n console.warn(error); // eslint-disable-line\n }\n }\n else {\n createLayer(map, id, props);\n }\n // Store last rendered props\n propsRef.current = props;\n return null;\n}\nexport default Layer;\n//# sourceMappingURL=layer.js.map"],"names":["updateLayer","map","id","props","prevProps","assert","layout","paint","filter","minzoom","maxzoom","beforeId","prevLayout","key","deepEqual","prevPaint","createLayer","options","layerCounter","Layer","useContext","MapContext","propsRef","useRef","setStyleLoaded","useState","useMemo","useEffect","forceUpdate","version","error"],"mappings":"kIAKA,SAASA,EAAYC,EAAKC,EAAIC,EAAOC,EAAW,CAG5C,GAFAC,EAAOF,EAAM,KAAOC,EAAU,GAAI,kBAAkB,EACpDC,EAAOF,EAAM,OAASC,EAAU,KAAM,oBAAoB,EACtDD,EAAM,OAAS,UAAYC,EAAU,OAAS,SAC9C,OAEE,KAAA,CAAE,OAAAE,EAAS,GAAI,MAAAC,EAAQ,CAAC,EAAG,OAAAC,EAAQ,QAAAC,EAAS,QAAAC,EAAS,SAAAC,CAAa,EAAAR,EAIpE,GAHAQ,IAAaP,EAAU,UACnBH,EAAA,UAAUC,EAAIS,CAAQ,EAE1BL,IAAWF,EAAU,OAAQ,CACvB,MAAAQ,EAAaR,EAAU,QAAU,GACvC,UAAWS,KAAOP,EACTQ,YAAUR,EAAOO,CAAG,EAAGD,EAAWC,CAAG,CAAC,GACvCZ,EAAI,kBAAkBC,EAAIW,EAAKP,EAAOO,CAAG,CAAC,EAGlD,UAAWA,KAAOD,EACTN,EAAO,eAAeO,CAAG,GACtBZ,EAAA,kBAAkBC,EAAIW,EAAK,MAAS,CAGpD,CACI,GAAAN,IAAUH,EAAU,MAAO,CACrB,MAAAW,EAAYX,EAAU,OAAS,GACrC,UAAWS,KAAON,EACTO,YAAUP,EAAMM,CAAG,EAAGE,EAAUF,CAAG,CAAC,GACrCZ,EAAI,iBAAiBC,EAAIW,EAAKN,EAAMM,CAAG,CAAC,EAGhD,UAAWA,KAAOE,EACTR,EAAM,eAAeM,CAAG,GACrBZ,EAAA,iBAAiBC,EAAIW,EAAK,MAAS,CAGnD,CACKC,EAAAA,UAAUN,EAAQJ,EAAU,MAAM,GAC/BH,EAAA,UAAUC,EAAIM,CAAM,GAExBC,IAAYL,EAAU,SAAWM,IAAYN,EAAU,UACnDH,EAAA,kBAAkBC,EAAIO,EAASC,CAAO,CAElD,CACA,SAASM,EAAYf,EAAKC,EAAIC,EAAO,CAEjC,GAAIF,EAAI,OAASA,EAAI,MAAM,UAAY,EAAE,WAAYE,IAAUF,EAAI,UAAUE,EAAM,MAAM,GAAI,CACzF,MAAMc,EAAU,CAAE,GAAGd,EAAO,GAAAD,CAAG,EAC/B,OAAOe,EAAQ,SAEXhB,EAAA,SAASgB,EAASd,EAAM,QAAQ,CACxC,CACJ,CAEA,IAAIe,EAAe,EACnB,SAASC,EAAMhB,EAAO,CAClB,MAAMF,EAAMmB,EAAAA,WAAWC,EAAAA,UAAU,EAAE,IAAI,OAAO,EACxCC,EAAWC,SAAOpB,CAAK,EACvB,EAAGqB,CAAc,EAAIC,WAAS,CAAC,EAC/BvB,EAAKwB,EAAAA,QAAQ,IAAMvB,EAAM,IAAM,aAAae,GAAc,GAAI,CAAA,CAAE,EAkBtE,GAjBAS,EAAAA,UAAU,IAAM,CACZ,GAAI1B,EAAK,CACL,MAAM2B,EAAc,IAAMJ,EAAeK,GAAWA,EAAU,CAAC,EAC3D5B,OAAAA,EAAA,GAAG,YAAa2B,CAAW,EACnBA,IACL,IAAM,CACL3B,EAAA,IAAI,YAAa2B,CAAW,EAE5B3B,EAAI,OAASA,EAAI,MAAM,SAAWA,EAAI,SAASC,CAAE,GACjDD,EAAI,YAAYC,CAAE,CACtB,CAER,CACO,EACR,CAACD,CAAG,CAAC,EAEMA,GAAOA,EAAI,OAASA,EAAI,SAASC,CAAE,EAEzC,GAAA,CACAF,EAAYC,EAAKC,EAAIC,EAAOmB,EAAS,OAAO,QAEzCQ,EAAO,CACV,QAAQ,KAAKA,CAAK,CACtB,MAGYd,EAAAf,EAAKC,EAAIC,CAAK,EAG9B,OAAAmB,EAAS,QAAUnB,EACZ,IACX","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.cjs79.js","sources":["../../../node_modules/react-map-gl/dist/esm/components/source.js"],"sourcesContent":["import * as React from 'react';\nimport { useContext, useEffect, useMemo, useState, useRef } from 'react';\nimport { cloneElement } from 'react';\nimport { MapContext } from './map';\nimport assert from '../utils/assert';\nimport { deepEqual } from '../utils/deep-equal';\nlet sourceCounter = 0;\nfunction createSource(map, id, props) {\n // @ts-ignore\n if (map.style && map.style._loaded) {\n const options = { ...props };\n delete options.id;\n delete options.children;\n // @ts-ignore\n map.addSource(id, options);\n return map.getSource(id);\n }\n return null;\n}\n/* eslint-disable complexity */\nfunction updateSource(source, props, prevProps) {\n assert(props.id === prevProps.id, 'source id changed');\n assert(props.type === prevProps.type, 'source type changed');\n let changedKey = '';\n let changedKeyCount = 0;\n for (const key in props) {\n if (key !== 'children' && key !== 'id' && !deepEqual(prevProps[key], props[key])) {\n changedKey = key;\n changedKeyCount++;\n }\n }\n if (!changedKeyCount) {\n return;\n }\n const type = props.type;\n if (type === 'geojson') {\n source.setData(props.data);\n }\n else if (type === 'image') {\n source.updateImage({\n url: props.url,\n coordinates: props.coordinates\n });\n }\n else if ('setCoordinates' in source && changedKeyCount === 1 && changedKey === 'coordinates') {\n source.setCoordinates(props.coordinates);\n }\n else if ('setUrl' in source) {\n // Added in 1.12.0:\n // vectorTileSource.setTiles\n // vectorTileSource.setUrl\n switch (changedKey) {\n case 'url':\n source.setUrl(props.url);\n break;\n case 'tiles':\n source.setTiles(props.tiles);\n break;\n default:\n }\n }\n else {\n // eslint-disable-next-line\n console.warn(`Unable to update <Source> prop: ${changedKey}`);\n }\n}\n/* eslint-enable complexity */\nfunction Source(props) {\n const map = useContext(MapContext).map.getMap();\n const propsRef = useRef(props);\n const [, setStyleLoaded] = useState(0);\n const id = useMemo(() => props.id || `jsx-source-${sourceCounter++}`, []);\n useEffect(() => {\n if (map) {\n /* global setTimeout */\n const forceUpdate = () => setTimeout(() => setStyleLoaded(version => version + 1), 0);\n map.on('styledata', forceUpdate);\n forceUpdate();\n return () => {\n var _a;\n map.off('styledata', forceUpdate);\n // @ts-ignore\n if (map.style && map.style._loaded && map.getSource(id)) {\n // Parent effects are destroyed before child ones, see\n // https://github.com/facebook/react/issues/16728\n // Source can only be removed after all child layers are removed\n const allLayers = (_a = map.getStyle()) === null || _a === void 0 ? void 0 : _a.layers;\n if (allLayers) {\n for (const layer of allLayers) {\n // @ts-ignore (2339) source does not exist on all layer types\n if (layer.source === id) {\n map.removeLayer(layer.id);\n }\n }\n }\n map.removeSource(id);\n }\n };\n }\n return undefined;\n }, [map]);\n // @ts-ignore\n let source = map && map.style && map.getSource(id);\n if (source) {\n updateSource(source, props, propsRef.current);\n }\n else {\n source = createSource(map, id, props);\n }\n propsRef.current = props;\n return ((source &&\n React.Children.map(props.children, child => child &&\n cloneElement(child, {\n source: id\n }))) ||\n null);\n}\nexport default Source;\n//# sourceMappingURL=source.js.map"],"names":["sourceCounter","createSource","map","id","props","options","updateSource","source","prevProps","assert","changedKey","changedKeyCount","key","deepEqual","type","Source","useContext","MapContext","propsRef","useRef","setStyleLoaded","useState","useMemo","useEffect","forceUpdate","version","_a","allLayers","layer","React","child","cloneElement"],"mappings":"4ZAMA,IAAIA,EAAgB,EACpB,SAASC,EAAaC,EAAKC,EAAIC,EAAO,CAElC,GAAIF,EAAI,OAASA,EAAI,MAAM,QAAS,CAC1B,MAAAG,EAAU,CAAE,GAAGD,GACrB,cAAOC,EAAQ,GACf,OAAOA,EAAQ,SAEXH,EAAA,UAAUC,EAAIE,CAAO,EAClBH,EAAI,UAAUC,CAAE,CAC3B,CACO,OAAA,IACX,CAEA,SAASG,EAAaC,EAAQH,EAAOI,EAAW,CAC5CC,EAAOL,EAAM,KAAOI,EAAU,GAAI,mBAAmB,EACrDC,EAAOL,EAAM,OAASI,EAAU,KAAM,qBAAqB,EAC3D,IAAIE,EAAa,GACbC,EAAkB,EACtB,UAAWC,KAAOR,EACVQ,IAAQ,YAAcA,IAAQ,MAAQ,CAACC,EAAAA,UAAUL,EAAUI,CAAG,EAAGR,EAAMQ,CAAG,CAAC,IAC9DF,EAAAE,EACbD,KAGR,GAAI,CAACA,EACD,OAEJ,MAAMG,EAAOV,EAAM,KACnB,GAAIU,IAAS,UACFP,EAAA,QAAQH,EAAM,IAAI,UAEpBU,IAAS,QACdP,EAAO,YAAY,CACf,IAAKH,EAAM,IACX,YAAaA,EAAM,WAAA,CACtB,UAEI,mBAAoBG,GAAUI,IAAoB,GAAKD,IAAe,cACpEH,EAAA,eAAeH,EAAM,WAAW,UAElC,WAAYG,EAIjB,OAAQG,EAAY,CAChB,IAAK,MACMH,EAAA,OAAOH,EAAM,GAAG,EACvB,MACJ,IAAK,QACMG,EAAA,SAASH,EAAM,KAAK,EAC3B,KAER,MAIQ,QAAA,KAAK,mCAAmCM,CAAU,EAAE,CAEpE,CAEA,SAASK,EAAOX,EAAO,CACnB,MAAMF,EAAMc,EAAAA,WAAWC,EAAAA,UAAU,EAAE,IAAI,OAAO,EACxCC,EAAWC,SAAOf,CAAK,EACvB,EAAGgB,CAAc,EAAIC,WAAS,CAAC,EAC/BlB,EAAKmB,EAAAA,QAAQ,IAAMlB,EAAM,IAAM,cAAcJ,GAAe,GAAI,CAAA,CAAE,EACxEuB,EAAAA,UAAU,IAAM,CACZ,GAAIrB,EAAK,CAEC,MAAAsB,EAAc,IAAM,WAAW,IAAMJ,EAA0BK,GAAAA,EAAU,CAAC,EAAG,CAAC,EAChFvB,OAAAA,EAAA,GAAG,YAAasB,CAAW,EACnBA,IACL,IAAM,CACL,IAAAE,EAGA,GAFAxB,EAAA,IAAI,YAAasB,CAAW,EAE5BtB,EAAI,OAASA,EAAI,MAAM,SAAWA,EAAI,UAAUC,CAAE,EAAG,CAI/C,MAAAwB,GAAaD,EAAKxB,EAAI,SAAA,KAAgB,MAAQwB,IAAO,OAAS,OAASA,EAAG,OAChF,GAAIC,EACA,UAAWC,KAASD,EAEZC,EAAM,SAAWzB,GACbD,EAAA,YAAY0B,EAAM,EAAE,EAIpC1B,EAAI,aAAaC,CAAE,CACvB,CAAA,CAER,CACO,EACR,CAACD,CAAG,CAAC,EAER,IAAIK,EAASL,GAAOA,EAAI,OAASA,EAAI,UAAUC,CAAE,EACjD,OAAII,EACaD,EAAAC,EAAQH,EAAOc,EAAS,OAAO,EAGnCX,EAAAN,EAAaC,EAAKC,EAAIC,CAAK,EAExCc,EAAS,QAAUd,EACVG,GACLsB,EAAM,SAAS,IAAIzB,EAAM,SAAU0B,GAASA,GACxCC,EAAAA,aAAaD,EAAO,CAChB,OAAQ3B,CAAA,CACX,CAAC,GACN,IACR","x_google_ignoreList":[0]}
@@ -1,2 +1,2 @@
1
- "use strict";const l=require("react"),f=require("./index.cjs67.js"),d=require("./index.cjs204.js"),y=require("./index.cjs203.js");function g(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const S=g(l);let m=0;function b(t,e,n){if(t.style&&t.style._loaded){const o={...n};return delete o.id,delete o.children,t.addSource(e,o),t.getSource(e)}return null}function h(t,e,n){d(e.id===n.id,"source id changed"),d(e.type===n.type,"source type changed");let o="",c=0;for(const r in e)r!=="children"&&r!=="id"&&!y.deepEqual(n[r],e[r])&&(o=r,c++);if(!c)return;const a=e.type;if(a==="geojson")t.setData(e.data);else if(a==="image")t.updateImage({url:e.url,coordinates:e.coordinates});else if("setCoordinates"in t&&c===1&&o==="coordinates")t.setCoordinates(e.coordinates);else if("setUrl"in t)switch(o){case"url":t.setUrl(e.url);break;case"tiles":t.setTiles(e.tiles);break}else console.warn(`Unable to update <Source> prop: ${o}`)}function C(t){const e=l.useContext(f.MapContext).map.getMap(),n=l.useRef(t),[,o]=l.useState(0),c=l.useMemo(()=>t.id||`jsx-source-${m++}`,[]);l.useEffect(()=>{if(e){const r=()=>setTimeout(()=>o(i=>i+1),0);return e.on("styledata",r),r(),()=>{var i;if(e.off("styledata",r),e.style&&e.style._loaded&&e.getSource(c)){const u=(i=e.getStyle())===null||i===void 0?void 0:i.layers;if(u)for(const s of u)s.source===c&&e.removeLayer(s.id);e.removeSource(c)}}}},[e]);let a=e&&e.style&&e.getSource(c);return a?h(a,t,n.current):a=b(e,c,t),n.current=t,a&&S.Children.map(t.children,r=>r&&l.cloneElement(r,{source:c}))||null}module.exports=C;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react"),a=require("./index.cjs70.js");function c(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const s=c(o),u=s.createContext(null);function i(){var e;const n=(e=o.useContext(u))===null||e===void 0?void 0:e.maps,t=o.useContext(a.MapContext);return o.useMemo(()=>({...n,current:t==null?void 0:t.map}),[n,t])}exports.MountedMapsContext=u;exports.useMap=i;
2
2
  //# sourceMappingURL=index.cjs80.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs80.js","sources":["../../../node_modules/react-map-gl/dist/esm/components/source.js"],"sourcesContent":["import * as React from 'react';\nimport { useContext, useEffect, useMemo, useState, useRef } from 'react';\nimport { cloneElement } from 'react';\nimport { MapContext } from './map';\nimport assert from '../utils/assert';\nimport { deepEqual } from '../utils/deep-equal';\nlet sourceCounter = 0;\nfunction createSource(map, id, props) {\n // @ts-ignore\n if (map.style && map.style._loaded) {\n const options = { ...props };\n delete options.id;\n delete options.children;\n // @ts-ignore\n map.addSource(id, options);\n return map.getSource(id);\n }\n return null;\n}\n/* eslint-disable complexity */\nfunction updateSource(source, props, prevProps) {\n assert(props.id === prevProps.id, 'source id changed');\n assert(props.type === prevProps.type, 'source type changed');\n let changedKey = '';\n let changedKeyCount = 0;\n for (const key in props) {\n if (key !== 'children' && key !== 'id' && !deepEqual(prevProps[key], props[key])) {\n changedKey = key;\n changedKeyCount++;\n }\n }\n if (!changedKeyCount) {\n return;\n }\n const type = props.type;\n if (type === 'geojson') {\n source.setData(props.data);\n }\n else if (type === 'image') {\n source.updateImage({\n url: props.url,\n coordinates: props.coordinates\n });\n }\n else if ('setCoordinates' in source && changedKeyCount === 1 && changedKey === 'coordinates') {\n source.setCoordinates(props.coordinates);\n }\n else if ('setUrl' in source) {\n // Added in 1.12.0:\n // vectorTileSource.setTiles\n // vectorTileSource.setUrl\n switch (changedKey) {\n case 'url':\n source.setUrl(props.url);\n break;\n case 'tiles':\n source.setTiles(props.tiles);\n break;\n default:\n }\n }\n else {\n // eslint-disable-next-line\n console.warn(`Unable to update <Source> prop: ${changedKey}`);\n }\n}\n/* eslint-enable complexity */\nfunction Source(props) {\n const map = useContext(MapContext).map.getMap();\n const propsRef = useRef(props);\n const [, setStyleLoaded] = useState(0);\n const id = useMemo(() => props.id || `jsx-source-${sourceCounter++}`, []);\n useEffect(() => {\n if (map) {\n /* global setTimeout */\n const forceUpdate = () => setTimeout(() => setStyleLoaded(version => version + 1), 0);\n map.on('styledata', forceUpdate);\n forceUpdate();\n return () => {\n var _a;\n map.off('styledata', forceUpdate);\n // @ts-ignore\n if (map.style && map.style._loaded && map.getSource(id)) {\n // Parent effects are destroyed before child ones, see\n // https://github.com/facebook/react/issues/16728\n // Source can only be removed after all child layers are removed\n const allLayers = (_a = map.getStyle()) === null || _a === void 0 ? void 0 : _a.layers;\n if (allLayers) {\n for (const layer of allLayers) {\n // @ts-ignore (2339) source does not exist on all layer types\n if (layer.source === id) {\n map.removeLayer(layer.id);\n }\n }\n }\n map.removeSource(id);\n }\n };\n }\n return undefined;\n }, [map]);\n // @ts-ignore\n let source = map && map.style && map.getSource(id);\n if (source) {\n updateSource(source, props, propsRef.current);\n }\n else {\n source = createSource(map, id, props);\n }\n propsRef.current = props;\n return ((source &&\n React.Children.map(props.children, child => child &&\n cloneElement(child, {\n source: id\n }))) ||\n null);\n}\nexport default Source;\n//# sourceMappingURL=source.js.map"],"names":["sourceCounter","createSource","map","id","props","options","updateSource","source","prevProps","assert","changedKey","changedKeyCount","key","deepEqual","type","Source","useContext","MapContext","propsRef","useRef","setStyleLoaded","useState","useMemo","useEffect","forceUpdate","version","_a","allLayers","layer","React","child","cloneElement"],"mappings":"4ZAMA,IAAIA,EAAgB,EACpB,SAASC,EAAaC,EAAKC,EAAIC,EAAO,CAElC,GAAIF,EAAI,OAASA,EAAI,MAAM,QAAS,CAC1B,MAAAG,EAAU,CAAE,GAAGD,GACrB,cAAOC,EAAQ,GACf,OAAOA,EAAQ,SAEXH,EAAA,UAAUC,EAAIE,CAAO,EAClBH,EAAI,UAAUC,CAAE,CAC3B,CACO,OAAA,IACX,CAEA,SAASG,EAAaC,EAAQH,EAAOI,EAAW,CAC5CC,EAAOL,EAAM,KAAOI,EAAU,GAAI,mBAAmB,EACrDC,EAAOL,EAAM,OAASI,EAAU,KAAM,qBAAqB,EAC3D,IAAIE,EAAa,GACbC,EAAkB,EACtB,UAAWC,KAAOR,EACVQ,IAAQ,YAAcA,IAAQ,MAAQ,CAACC,EAAAA,UAAUL,EAAUI,CAAG,EAAGR,EAAMQ,CAAG,CAAC,IAC9DF,EAAAE,EACbD,KAGR,GAAI,CAACA,EACD,OAEJ,MAAMG,EAAOV,EAAM,KACnB,GAAIU,IAAS,UACFP,EAAA,QAAQH,EAAM,IAAI,UAEpBU,IAAS,QACdP,EAAO,YAAY,CACf,IAAKH,EAAM,IACX,YAAaA,EAAM,WAAA,CACtB,UAEI,mBAAoBG,GAAUI,IAAoB,GAAKD,IAAe,cACpEH,EAAA,eAAeH,EAAM,WAAW,UAElC,WAAYG,EAIjB,OAAQG,EAAY,CAChB,IAAK,MACMH,EAAA,OAAOH,EAAM,GAAG,EACvB,MACJ,IAAK,QACMG,EAAA,SAASH,EAAM,KAAK,EAC3B,KAER,MAIQ,QAAA,KAAK,mCAAmCM,CAAU,EAAE,CAEpE,CAEA,SAASK,EAAOX,EAAO,CACnB,MAAMF,EAAMc,EAAAA,WAAWC,EAAAA,UAAU,EAAE,IAAI,OAAO,EACxCC,EAAWC,SAAOf,CAAK,EACvB,EAAGgB,CAAc,EAAIC,WAAS,CAAC,EAC/BlB,EAAKmB,EAAAA,QAAQ,IAAMlB,EAAM,IAAM,cAAcJ,GAAe,GAAI,CAAA,CAAE,EACxEuB,EAAAA,UAAU,IAAM,CACZ,GAAIrB,EAAK,CAEC,MAAAsB,EAAc,IAAM,WAAW,IAAMJ,EAA0BK,GAAAA,EAAU,CAAC,EAAG,CAAC,EAChFvB,OAAAA,EAAA,GAAG,YAAasB,CAAW,EACnBA,IACL,IAAM,CACL,IAAAE,EAGA,GAFAxB,EAAA,IAAI,YAAasB,CAAW,EAE5BtB,EAAI,OAASA,EAAI,MAAM,SAAWA,EAAI,UAAUC,CAAE,EAAG,CAI/C,MAAAwB,GAAaD,EAAKxB,EAAI,SAAA,KAAgB,MAAQwB,IAAO,OAAS,OAASA,EAAG,OAChF,GAAIC,EACA,UAAWC,KAASD,EAEZC,EAAM,SAAWzB,GACbD,EAAA,YAAY0B,EAAM,EAAE,EAIpC1B,EAAI,aAAaC,CAAE,CACvB,CAAA,CAER,CACO,EACR,CAACD,CAAG,CAAC,EAER,IAAIK,EAASL,GAAOA,EAAI,OAASA,EAAI,UAAUC,CAAE,EACjD,OAAII,EACaD,EAAAC,EAAQH,EAAOc,EAAS,OAAO,EAGnCX,EAAAN,EAAaC,EAAKC,EAAIC,CAAK,EAExCc,EAAS,QAAUd,EACVG,GACLsB,EAAM,SAAS,IAAIzB,EAAM,SAAU0B,GAASA,GACxCC,EAAAA,aAAaD,EAAO,CAChB,OAAQ3B,CAAA,CACX,CAAC,GACN,IACR","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.cjs80.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":"iaAGaA,EAAqBC,EAAM,cAAc,IAAI,EA8BnD,SAASC,GAAS,CACjB,IAAAC,EACE,MAAAC,GAAQD,EAAKE,EAAW,WAAAL,CAAkB,KAAO,MAAQG,IAAO,OAAS,OAASA,EAAG,KACrFG,EAAaD,aAAWE,EAAAA,UAAU,EAIjC,OAHiBC,EAAAA,QAAQ,KACrB,CAAE,GAAGJ,EAAM,QAASE,GAAe,KAAgC,OAASA,EAAW,GAAI,GACnG,CAACF,EAAME,CAAU,CAAC,CAEzB","x_google_ignoreList":[0]}
@@ -1,5 +1,5 @@
1
- import { commonjsGlobal as Je, getDefaultExportFromCjs as oo } from "./index.es59.js";
2
- import { __module as Zn } from "./index.es60.js";
1
+ import { commonjsGlobal as Je, getDefaultExportFromCjs as oo } from "./index.es62.js";
2
+ import { __module as Zn } from "./index.es64.js";
3
3
  (function(Wn, ao) {
4
4
  (function(ze, de) {
5
5
  Wn.exports = de();
@@ -1,19 +1,19 @@
1
1
  import * as i from "react";
2
- import p from "./index.es67.js";
3
- import "./index.es68.js";
4
- import "./index.es69.js";
5
- import "./index.es70.js";
2
+ import p from "./index.es70.js";
6
3
  import "./index.es71.js";
7
4
  import "./index.es72.js";
8
- import m from "./index.es73.js";
5
+ import "./index.es73.js";
9
6
  import "./index.es74.js";
10
- import a from "./index.es79.js";
11
- import n from "./index.es80.js";
12
- import { useMap as e } from "./index.es75.js";
7
+ import "./index.es75.js";
8
+ import m from "./index.es76.js";
9
+ import "./index.es77.js";
10
+ import a from "./index.es78.js";
11
+ import n from "./index.es79.js";
12
+ import { useMap as e } from "./index.es80.js";
13
13
  function C() {
14
14
  return e();
15
15
  }
16
- const f = import("./index.es78.js").then((o) => o.i), N = i.forwardRef(function(r, t) {
16
+ const f = import("./index.es69.js").then((o) => o.i), N = i.forwardRef(function(r, t) {
17
17
  return p(r, t, f);
18
18
  }), R = m, S = a, b = n;
19
19
  export {
@@ -1,5 +1,5 @@
1
1
  import { useContext as p, useMemo as r, useEffect as m } from "react";
2
- import { MapContext as d } from "./index.es67.js";
2
+ import { MapContext as d } from "./index.es70.js";
3
3
  function x(c, o, n, l) {
4
4
  const e = p(d), t = r(() => c(e), []);
5
5
  return m(() => {
@@ -1,6 +1,6 @@
1
- import { __module as e } from "./index.es61.js";
2
- import { __require as r } from "./index.es62.js";
3
- import { __require as o } from "./index.es63.js";
1
+ import { __module as e } from "./index.es59.js";
2
+ import { __require as r } from "./index.es60.js";
3
+ import { __require as o } from "./index.es61.js";
4
4
  process.env.NODE_ENV === "production" ? e.exports = r() : e.exports = o();
5
5
  var m = e.exports;
6
6
  export {
@@ -1,5 +1,5 @@
1
- import { commonjsGlobal as nd, getDefaultExportFromCjs as od } from "./index.es59.js";
2
- import { __module as lu } from "./index.es64.js";
1
+ import { commonjsGlobal as nd, getDefaultExportFromCjs as od } from "./index.es62.js";
2
+ import { __module as lu } from "./index.es63.js";
3
3
  function ld(an, vl) {
4
4
  for (var Ur = 0; Ur < vl.length; Ur++) {
5
5
  const cr = vl[Ur];
@@ -1,5 +1,5 @@
1
- import { syncProjection as f, cloneTransform as T, applyViewStateToTransform as p, transformToViewState as _ } from "./index.es234.js";
2
- import { normalizeStyle as v } from "./index.es235.js";
1
+ import { syncProjection as f, cloneTransform as T, applyViewStateToTransform as p, transformToViewState as _ } from "./index.es233.js";
2
+ import { normalizeStyle as v } from "./index.es234.js";
3
3
  import { deepEqual as h } from "./index.es203.js";
4
4
  const g = { version: 8, sources: {}, layers: [] }, y = {
5
5
  mousedown: "onMouseDown",
@@ -1,6 +1,49 @@
1
- import t from "./index.es206.js";
2
- const a = t("Object");
1
+ import { deepEqual as c } from "./index.es203.js";
2
+ function g(n) {
3
+ const o = n.clone();
4
+ return o.pixelsToGLUnits = n.pixelsToGLUnits, o;
5
+ }
6
+ function r(n, o) {
7
+ if (!n.getProjection)
8
+ return;
9
+ const i = n.getProjection(), e = o.getProjection();
10
+ c(i, e) || o.setProjection(i);
11
+ }
12
+ function d(n) {
13
+ return {
14
+ longitude: n.center.lng,
15
+ latitude: n.center.lat,
16
+ zoom: n.zoom,
17
+ pitch: n.pitch,
18
+ bearing: n.bearing,
19
+ padding: n.padding
20
+ };
21
+ }
22
+ function s(n, o) {
23
+ const i = o.viewState || o;
24
+ let e = !1;
25
+ if ("longitude" in i && "latitude" in i) {
26
+ const t = n.center;
27
+ n.center = new t.constructor(i.longitude, i.latitude), e = e || t !== n.center;
28
+ }
29
+ if ("zoom" in i) {
30
+ const t = n.zoom;
31
+ n.zoom = i.zoom, e = e || t !== n.zoom;
32
+ }
33
+ if ("bearing" in i) {
34
+ const t = n.bearing;
35
+ n.bearing = i.bearing, e = e || t !== n.bearing;
36
+ }
37
+ if ("pitch" in i) {
38
+ const t = n.pitch;
39
+ n.pitch = i.pitch, e = e || t !== n.pitch;
40
+ }
41
+ return i.padding && !n.isPaddingEqual(i.padding) && (e = !0, n.padding = i.padding), e;
42
+ }
3
43
  export {
4
- a as default
44
+ s as applyViewStateToTransform,
45
+ g as cloneTransform,
46
+ r as syncProjection,
47
+ d as transformToViewState
5
48
  };
6
49
  //# sourceMappingURL=index.es233.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es233.js","sources":["../../../node_modules/underscore/modules/_hasObjectTag.js"],"sourcesContent":["import tagTester from './_tagTester.js';\n\nexport default tagTester('Object');\n"],"names":["hasObjectTag","tagTester"],"mappings":";AAEA,MAAeA,IAAAC,EAAU,QAAQ;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es233.js","sources":["../../../node_modules/react-map-gl/dist/esm/utils/transform.js"],"sourcesContent":["import { deepEqual } from './deep-equal';\n/**\n * Make a copy of a transform\n * @param tr\n */\nexport function cloneTransform(tr) {\n const newTransform = tr.clone();\n // Work around mapbox bug - this value is not assigned in clone(), only in resize()\n newTransform.pixelsToGLUnits = tr.pixelsToGLUnits;\n return newTransform;\n}\n/**\n * Copy projection from one transform to another. This only applies to mapbox-gl transforms\n * @param src the transform to copy projection settings from\n * @param dest to transform to copy projection settings to\n */\nexport function syncProjection(src, dest) {\n if (!src.getProjection) {\n return;\n }\n const srcProjection = src.getProjection();\n const destProjection = dest.getProjection();\n if (!deepEqual(srcProjection, destProjection)) {\n dest.setProjection(srcProjection);\n }\n}\n/**\n * Capture a transform's current state\n * @param transform\n * @returns descriptor of the view state\n */\nexport function transformToViewState(tr) {\n return {\n longitude: tr.center.lng,\n latitude: tr.center.lat,\n zoom: tr.zoom,\n pitch: tr.pitch,\n bearing: tr.bearing,\n padding: tr.padding\n };\n}\n/* eslint-disable complexity */\n/**\n * Mutate a transform to match the given view state\n * @param transform\n * @param viewState\n * @returns true if the transform has changed\n */\nexport function applyViewStateToTransform(tr, props) {\n const v = props.viewState || props;\n let changed = false;\n if ('longitude' in v && 'latitude' in v) {\n const center = tr.center;\n // @ts-ignore\n tr.center = new center.constructor(v.longitude, v.latitude);\n changed = changed || center !== tr.center;\n }\n if ('zoom' in v) {\n const zoom = tr.zoom;\n tr.zoom = v.zoom;\n changed = changed || zoom !== tr.zoom;\n }\n if ('bearing' in v) {\n const bearing = tr.bearing;\n tr.bearing = v.bearing;\n changed = changed || bearing !== tr.bearing;\n }\n if ('pitch' in v) {\n const pitch = tr.pitch;\n tr.pitch = v.pitch;\n changed = changed || pitch !== tr.pitch;\n }\n if (v.padding && !tr.isPaddingEqual(v.padding)) {\n changed = true;\n tr.padding = v.padding;\n }\n return changed;\n}\n//# sourceMappingURL=transform.js.map"],"names":["cloneTransform","tr","newTransform","syncProjection","src","dest","srcProjection","destProjection","deepEqual","transformToViewState","applyViewStateToTransform","props","v","changed","center","zoom","bearing","pitch"],"mappings":";AAKO,SAASA,EAAeC,GAAI;AACzB,QAAAC,IAAeD,EAAG;AAExB,SAAAC,EAAa,kBAAkBD,EAAG,iBAC3BC;AACX;AAMgB,SAAAC,EAAeC,GAAKC,GAAM;AAClC,MAAA,CAACD,EAAI;AACL;AAEE,QAAAE,IAAgBF,EAAI,iBACpBG,IAAiBF,EAAK;AAC5B,EAAKG,EAAUF,GAAeC,CAAc,KACxCF,EAAK,cAAcC,CAAa;AAExC;AAMO,SAASG,EAAqBR,GAAI;AAC9B,SAAA;AAAA,IACH,WAAWA,EAAG,OAAO;AAAA,IACrB,UAAUA,EAAG,OAAO;AAAA,IACpB,MAAMA,EAAG;AAAA,IACT,OAAOA,EAAG;AAAA,IACV,SAASA,EAAG;AAAA,IACZ,SAASA,EAAG;AAAA,EAAA;AAEpB;AAQgB,SAAAS,EAA0BT,GAAIU,GAAO;AAC3C,QAAAC,IAAID,EAAM,aAAaA;AAC7B,MAAIE,IAAU;AACV,MAAA,eAAeD,KAAK,cAAcA,GAAG;AACrC,UAAME,IAASb,EAAG;AAElB,IAAAA,EAAG,SAAS,IAAIa,EAAO,YAAYF,EAAE,WAAWA,EAAE,QAAQ,GAChDC,IAAAA,KAAWC,MAAWb,EAAG;AAAA,EACvC;AACA,MAAI,UAAUW,GAAG;AACb,UAAMG,IAAOd,EAAG;AAChB,IAAAA,EAAG,OAAOW,EAAE,MACFC,IAAAA,KAAWE,MAASd,EAAG;AAAA,EACrC;AACA,MAAI,aAAaW,GAAG;AAChB,UAAMI,IAAUf,EAAG;AACnB,IAAAA,EAAG,UAAUW,EAAE,SACLC,IAAAA,KAAWG,MAAYf,EAAG;AAAA,EACxC;AACA,MAAI,WAAWW,GAAG;AACd,UAAMK,IAAQhB,EAAG;AACjB,IAAAA,EAAG,QAAQW,EAAE,OACHC,IAAAA,KAAWI,MAAUhB,EAAG;AAAA,EACtC;AACA,SAAIW,EAAE,WAAW,CAACX,EAAG,eAAeW,EAAE,OAAO,MAC/BC,IAAA,IACVZ,EAAG,UAAUW,EAAE,UAEZC;AACX;","x_google_ignoreList":[0]}
@@ -1,49 +1,26 @@
1
- import { deepEqual as c } from "./index.es203.js";
2
- function g(n) {
3
- const o = n.clone();
4
- return o.pixelsToGLUnits = n.pixelsToGLUnits, o;
5
- }
6
- function r(n, o) {
7
- if (!n.getProjection)
8
- return;
9
- const i = n.getProjection(), e = o.getProjection();
10
- c(i, e) || o.setProjection(i);
11
- }
12
- function d(n) {
13
- return {
14
- longitude: n.center.lng,
15
- latitude: n.center.lat,
16
- zoom: n.zoom,
17
- pitch: n.pitch,
18
- bearing: n.bearing,
19
- padding: n.padding
20
- };
21
- }
22
- function s(n, o) {
23
- const i = o.viewState || o;
24
- let e = !1;
25
- if ("longitude" in i && "latitude" in i) {
26
- const t = n.center;
27
- n.center = new t.constructor(i.longitude, i.latitude), e = e || t !== n.center;
28
- }
29
- if ("zoom" in i) {
30
- const t = n.zoom;
31
- n.zoom = i.zoom, e = e || t !== n.zoom;
32
- }
33
- if ("bearing" in i) {
34
- const t = n.bearing;
35
- n.bearing = i.bearing, e = e || t !== n.bearing;
36
- }
37
- if ("pitch" in i) {
38
- const t = n.pitch;
39
- n.pitch = i.pitch, e = e || t !== n.pitch;
40
- }
41
- return i.padding && !n.isPaddingEqual(i.padding) && (e = !0, n.padding = i.padding), e;
1
+ const a = ["type", "source", "source-layer", "minzoom", "maxzoom", "filter", "layout"];
2
+ function c(r) {
3
+ if (!r)
4
+ return null;
5
+ if (typeof r == "string" || ("toJS" in r && (r = r.toJS()), !r.layers))
6
+ return r;
7
+ const t = {};
8
+ for (const e of r.layers)
9
+ t[e.id] = e;
10
+ const f = r.layers.map((e) => {
11
+ let n = null;
12
+ "interactive" in e && (n = Object.assign({}, e), delete n.interactive);
13
+ const o = t[e.ref];
14
+ if (o) {
15
+ n = n || Object.assign({}, e), delete n.ref;
16
+ for (const i of a)
17
+ i in o && (n[i] = o[i]);
18
+ }
19
+ return n || e;
20
+ });
21
+ return { ...r, layers: f };
42
22
  }
43
23
  export {
44
- s as applyViewStateToTransform,
45
- g as cloneTransform,
46
- r as syncProjection,
47
- d as transformToViewState
24
+ c as normalizeStyle
48
25
  };
49
26
  //# sourceMappingURL=index.es234.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es234.js","sources":["../../../node_modules/react-map-gl/dist/esm/utils/transform.js"],"sourcesContent":["import { deepEqual } from './deep-equal';\n/**\n * Make a copy of a transform\n * @param tr\n */\nexport function cloneTransform(tr) {\n const newTransform = tr.clone();\n // Work around mapbox bug - this value is not assigned in clone(), only in resize()\n newTransform.pixelsToGLUnits = tr.pixelsToGLUnits;\n return newTransform;\n}\n/**\n * Copy projection from one transform to another. This only applies to mapbox-gl transforms\n * @param src the transform to copy projection settings from\n * @param dest to transform to copy projection settings to\n */\nexport function syncProjection(src, dest) {\n if (!src.getProjection) {\n return;\n }\n const srcProjection = src.getProjection();\n const destProjection = dest.getProjection();\n if (!deepEqual(srcProjection, destProjection)) {\n dest.setProjection(srcProjection);\n }\n}\n/**\n * Capture a transform's current state\n * @param transform\n * @returns descriptor of the view state\n */\nexport function transformToViewState(tr) {\n return {\n longitude: tr.center.lng,\n latitude: tr.center.lat,\n zoom: tr.zoom,\n pitch: tr.pitch,\n bearing: tr.bearing,\n padding: tr.padding\n };\n}\n/* eslint-disable complexity */\n/**\n * Mutate a transform to match the given view state\n * @param transform\n * @param viewState\n * @returns true if the transform has changed\n */\nexport function applyViewStateToTransform(tr, props) {\n const v = props.viewState || props;\n let changed = false;\n if ('longitude' in v && 'latitude' in v) {\n const center = tr.center;\n // @ts-ignore\n tr.center = new center.constructor(v.longitude, v.latitude);\n changed = changed || center !== tr.center;\n }\n if ('zoom' in v) {\n const zoom = tr.zoom;\n tr.zoom = v.zoom;\n changed = changed || zoom !== tr.zoom;\n }\n if ('bearing' in v) {\n const bearing = tr.bearing;\n tr.bearing = v.bearing;\n changed = changed || bearing !== tr.bearing;\n }\n if ('pitch' in v) {\n const pitch = tr.pitch;\n tr.pitch = v.pitch;\n changed = changed || pitch !== tr.pitch;\n }\n if (v.padding && !tr.isPaddingEqual(v.padding)) {\n changed = true;\n tr.padding = v.padding;\n }\n return changed;\n}\n//# sourceMappingURL=transform.js.map"],"names":["cloneTransform","tr","newTransform","syncProjection","src","dest","srcProjection","destProjection","deepEqual","transformToViewState","applyViewStateToTransform","props","v","changed","center","zoom","bearing","pitch"],"mappings":";AAKO,SAASA,EAAeC,GAAI;AACzB,QAAAC,IAAeD,EAAG;AAExB,SAAAC,EAAa,kBAAkBD,EAAG,iBAC3BC;AACX;AAMgB,SAAAC,EAAeC,GAAKC,GAAM;AAClC,MAAA,CAACD,EAAI;AACL;AAEE,QAAAE,IAAgBF,EAAI,iBACpBG,IAAiBF,EAAK;AAC5B,EAAKG,EAAUF,GAAeC,CAAc,KACxCF,EAAK,cAAcC,CAAa;AAExC;AAMO,SAASG,EAAqBR,GAAI;AAC9B,SAAA;AAAA,IACH,WAAWA,EAAG,OAAO;AAAA,IACrB,UAAUA,EAAG,OAAO;AAAA,IACpB,MAAMA,EAAG;AAAA,IACT,OAAOA,EAAG;AAAA,IACV,SAASA,EAAG;AAAA,IACZ,SAASA,EAAG;AAAA,EAAA;AAEpB;AAQgB,SAAAS,EAA0BT,GAAIU,GAAO;AAC3C,QAAAC,IAAID,EAAM,aAAaA;AAC7B,MAAIE,IAAU;AACV,MAAA,eAAeD,KAAK,cAAcA,GAAG;AACrC,UAAME,IAASb,EAAG;AAElB,IAAAA,EAAG,SAAS,IAAIa,EAAO,YAAYF,EAAE,WAAWA,EAAE,QAAQ,GAChDC,IAAAA,KAAWC,MAAWb,EAAG;AAAA,EACvC;AACA,MAAI,UAAUW,GAAG;AACb,UAAMG,IAAOd,EAAG;AAChB,IAAAA,EAAG,OAAOW,EAAE,MACFC,IAAAA,KAAWE,MAASd,EAAG;AAAA,EACrC;AACA,MAAI,aAAaW,GAAG;AAChB,UAAMI,IAAUf,EAAG;AACnB,IAAAA,EAAG,UAAUW,EAAE,SACLC,IAAAA,KAAWG,MAAYf,EAAG;AAAA,EACxC;AACA,MAAI,WAAWW,GAAG;AACd,UAAMK,IAAQhB,EAAG;AACjB,IAAAA,EAAG,QAAQW,EAAE,OACHC,IAAAA,KAAWI,MAAUhB,EAAG;AAAA,EACtC;AACA,SAAIW,EAAE,WAAW,CAACX,EAAG,eAAeW,EAAE,OAAO,MAC/BC,IAAA,IACVZ,EAAG,UAAUW,EAAE,UAEZC;AACX;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es234.js","sources":["../../../node_modules/react-map-gl/dist/esm/utils/style-utils.js"],"sourcesContent":["const refProps = ['type', 'source', 'source-layer', 'minzoom', 'maxzoom', 'filter', 'layout'];\n// Prepare a map style object for diffing\n// If immutable - convert to plain object\n// Work around some issues in older styles that would fail Mapbox's diffing\nexport function normalizeStyle(style) {\n if (!style) {\n return null;\n }\n if (typeof style === 'string') {\n return style;\n }\n if ('toJS' in style) {\n style = style.toJS();\n }\n if (!style.layers) {\n return style;\n }\n const layerIndex = {};\n for (const layer of style.layers) {\n layerIndex[layer.id] = layer;\n }\n const layers = style.layers.map(layer => {\n let normalizedLayer = null;\n if ('interactive' in layer) {\n normalizedLayer = Object.assign({}, layer);\n // Breaks style diffing :(\n // @ts-ignore legacy field not typed\n delete normalizedLayer.interactive;\n }\n // Style diffing doesn't work with refs so expand them out manually before diffing.\n // @ts-ignore legacy field not typed\n const layerRef = layerIndex[layer.ref];\n if (layerRef) {\n normalizedLayer = normalizedLayer || Object.assign({}, layer);\n // @ts-ignore\n delete normalizedLayer.ref;\n // https://github.com/mapbox/mapbox-gl-js/blob/master/src/style-spec/deref.js\n for (const propName of refProps) {\n if (propName in layerRef) {\n normalizedLayer[propName] = layerRef[propName];\n }\n }\n }\n return normalizedLayer || layer;\n });\n // Do not mutate the style object provided by the user\n return { ...style, layers };\n}\n//# sourceMappingURL=style-utils.js.map"],"names":["refProps","normalizeStyle","style","layerIndex","layer","layers","normalizedLayer","layerRef","propName"],"mappings":"AAAA,MAAMA,IAAW,CAAC,QAAQ,UAAU,gBAAgB,WAAW,WAAW,UAAU,QAAQ;AAIrF,SAASC,EAAeC,GAAO;AAClC,MAAI,CAACA;AACM,WAAA;AAQP,MANA,OAAOA,KAAU,aAGjB,UAAUA,MACVA,IAAQA,EAAM,SAEd,CAACA,EAAM;AACA,WAAAA;AAEX,QAAMC,IAAa,CAAA;AACR,aAAAC,KAASF,EAAM;AACX,IAAAC,EAAAC,EAAM,EAAE,IAAIA;AAE3B,QAAMC,IAASH,EAAM,OAAO,IAAI,CAASE,MAAA;AACrC,QAAIE,IAAkB;AACtB,IAAI,iBAAiBF,MACjBE,IAAkB,OAAO,OAAO,CAAC,GAAGF,CAAK,GAGzC,OAAOE,EAAgB;AAIrB,UAAAC,IAAWJ,EAAWC,EAAM,GAAG;AACrC,QAAIG,GAAU;AACV,MAAAD,IAAkBA,KAAmB,OAAO,OAAO,IAAIF,CAAK,GAE5D,OAAOE,EAAgB;AAEvB,iBAAWE,KAAYR;AACnB,QAAIQ,KAAYD,MACID,EAAAE,CAAQ,IAAID,EAASC,CAAQ;AAAA,IAGzD;AACA,WAAOF,KAAmBF;AAAA,EAAA,CAC7B;AAEM,SAAA,EAAE,GAAGF,GAAO,QAAAG;AACvB;","x_google_ignoreList":[0]}
@@ -1,26 +1,6 @@
1
- const a = ["type", "source", "source-layer", "minzoom", "maxzoom", "filter", "layout"];
2
- function c(r) {
3
- if (!r)
4
- return null;
5
- if (typeof r == "string" || ("toJS" in r && (r = r.toJS()), !r.layers))
6
- return r;
7
- const t = {};
8
- for (const e of r.layers)
9
- t[e.id] = e;
10
- const f = r.layers.map((e) => {
11
- let n = null;
12
- "interactive" in e && (n = Object.assign({}, e), delete n.interactive);
13
- const o = t[e.ref];
14
- if (o) {
15
- n = n || Object.assign({}, e), delete n.ref;
16
- for (const i of a)
17
- i in o && (n[i] = o[i]);
18
- }
19
- return n || e;
20
- });
21
- return { ...r, layers: f };
22
- }
1
+ import t from "./index.es206.js";
2
+ const a = t("Object");
23
3
  export {
24
- c as normalizeStyle
4
+ a as default
25
5
  };
26
6
  //# sourceMappingURL=index.es235.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es235.js","sources":["../../../node_modules/react-map-gl/dist/esm/utils/style-utils.js"],"sourcesContent":["const refProps = ['type', 'source', 'source-layer', 'minzoom', 'maxzoom', 'filter', 'layout'];\n// Prepare a map style object for diffing\n// If immutable - convert to plain object\n// Work around some issues in older styles that would fail Mapbox's diffing\nexport function normalizeStyle(style) {\n if (!style) {\n return null;\n }\n if (typeof style === 'string') {\n return style;\n }\n if ('toJS' in style) {\n style = style.toJS();\n }\n if (!style.layers) {\n return style;\n }\n const layerIndex = {};\n for (const layer of style.layers) {\n layerIndex[layer.id] = layer;\n }\n const layers = style.layers.map(layer => {\n let normalizedLayer = null;\n if ('interactive' in layer) {\n normalizedLayer = Object.assign({}, layer);\n // Breaks style diffing :(\n // @ts-ignore legacy field not typed\n delete normalizedLayer.interactive;\n }\n // Style diffing doesn't work with refs so expand them out manually before diffing.\n // @ts-ignore legacy field not typed\n const layerRef = layerIndex[layer.ref];\n if (layerRef) {\n normalizedLayer = normalizedLayer || Object.assign({}, layer);\n // @ts-ignore\n delete normalizedLayer.ref;\n // https://github.com/mapbox/mapbox-gl-js/blob/master/src/style-spec/deref.js\n for (const propName of refProps) {\n if (propName in layerRef) {\n normalizedLayer[propName] = layerRef[propName];\n }\n }\n }\n return normalizedLayer || layer;\n });\n // Do not mutate the style object provided by the user\n return { ...style, layers };\n}\n//# sourceMappingURL=style-utils.js.map"],"names":["refProps","normalizeStyle","style","layerIndex","layer","layers","normalizedLayer","layerRef","propName"],"mappings":"AAAA,MAAMA,IAAW,CAAC,QAAQ,UAAU,gBAAgB,WAAW,WAAW,UAAU,QAAQ;AAIrF,SAASC,EAAeC,GAAO;AAClC,MAAI,CAACA;AACM,WAAA;AAQP,MANA,OAAOA,KAAU,aAGjB,UAAUA,MACVA,IAAQA,EAAM,SAEd,CAACA,EAAM;AACA,WAAAA;AAEX,QAAMC,IAAa,CAAA;AACR,aAAAC,KAASF,EAAM;AACX,IAAAC,EAAAC,EAAM,EAAE,IAAIA;AAE3B,QAAMC,IAASH,EAAM,OAAO,IAAI,CAASE,MAAA;AACrC,QAAIE,IAAkB;AACtB,IAAI,iBAAiBF,MACjBE,IAAkB,OAAO,OAAO,CAAC,GAAGF,CAAK,GAGzC,OAAOE,EAAgB;AAIrB,UAAAC,IAAWJ,EAAWC,EAAM,GAAG;AACrC,QAAIG,GAAU;AACV,MAAAD,IAAkBA,KAAmB,OAAO,OAAO,IAAIF,CAAK,GAE5D,OAAOE,EAAgB;AAEvB,iBAAWE,KAAYR;AACnB,QAAIQ,KAAYD,MACID,EAAAE,CAAQ,IAAID,EAASC,CAAQ;AAAA,IAGzD;AACA,WAAOF,KAAmBF;AAAA,EAAA,CAC7B;AAEM,SAAA,EAAE,GAAGF,GAAO,QAAAG;AACvB;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es235.js","sources":["../../../node_modules/underscore/modules/_hasObjectTag.js"],"sourcesContent":["import tagTester from './_tagTester.js';\n\nexport default tagTester('Object');\n"],"names":["hasObjectTag","tagTester"],"mappings":";AAEA,MAAeA,IAAAC,EAAU,QAAQ;","x_google_ignoreList":[0]}
@@ -1,5 +1,5 @@
1
1
  import { supportsDataView as e } from "./index.es24.js";
2
- import a from "./index.es233.js";
2
+ import a from "./index.es235.js";
3
3
  var p = e && a(new DataView(new ArrayBuffer(8))), i = typeof Map < "u" && a(/* @__PURE__ */ new Map());
4
4
  export {
5
5
  p as hasStringTagBug,
@@ -1,13 +1,13 @@
1
1
  import * as m from "react";
2
- import p from "./index.es67.js";
3
- import "./index.es68.js";
4
- import "./index.es69.js";
5
- import "./index.es70.js";
6
- import i from "./index.es71.js";
2
+ import p from "./index.es70.js";
3
+ import "./index.es71.js";
7
4
  import "./index.es72.js";
8
5
  import "./index.es73.js";
9
- import "./index.es74.js";
6
+ import i from "./index.es74.js";
10
7
  import "./index.es75.js";
8
+ import "./index.es76.js";
9
+ import "./index.es77.js";
10
+ import "./index.es80.js";
11
11
  const n = import("./index.es19.js").then((r) => r.o);
12
12
  m.forwardRef(function(o, t) {
13
13
  return p(o, t, n);
@@ -1,9 +1,5 @@
1
- var o = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2
- function l(e) {
3
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
4
- }
1
+ var e = { exports: {} };
5
2
  export {
6
- o as commonjsGlobal,
7
- l as getDefaultExportFromCjs
3
+ e as __module
8
4
  };
9
5
  //# sourceMappingURL=index.es59.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es59.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"index.es59.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
package/dist/index.es6.js CHANGED
@@ -1,7 +1,7 @@
1
- import { j as i } from "./index.es17.js";
2
- import { useMap as a, PulsingMarkerLayer as n, GeoJSONLayer as l } from "@peripleo/maplibre";
3
- import { useMemo as u, useEffect as d } from "react";
4
- import f from "./index.es23.js";
1
+ import { j as o } from "./index.es17.js";
2
+ import { useMap as l, PulsingMarkerLayer as u, GeoJSONLayer as f } from "@peripleo/maplibre";
3
+ import { useMemo as n, useEffect as d } from "react";
4
+ import s from "./index.es23.js";
5
5
  import "./index.es24.js";
6
6
  import "./index.es25.js";
7
7
  import "./index.es26.js";
@@ -30,26 +30,26 @@ import "./index.es48.js";
30
30
  import "./index.es49.js";
31
31
  import "./index.es50.js";
32
32
  import r from "./index.es13.js";
33
- import s from "./index.es12.js";
34
- const c = 2, x = (t) => {
35
- const o = a(), e = u(() => f.isEmpty(t.data) ? null : t.data, [t.data]);
33
+ import c from "./index.es12.js";
34
+ const x = 2, y = (t) => {
35
+ const e = l(), i = n(() => s.isEmpty(t.data) ? null : t.data, [t.data]), a = n(() => t.cluster ? (console.log(i), !0) : !1, [i, t.cluster]);
36
36
  return d(() => {
37
- if (o && e && t.fitBoundingBox) {
38
- const m = s.getBoundingBox(e, t.buffer);
39
- m && o.fitBounds(m, t.boundingBoxOptions, t.boundingBoxData);
37
+ if (e && i && t.fitBoundingBox) {
38
+ const m = c.getBoundingBox(i, t.buffer);
39
+ m && e.fitBounds(m, t.boundingBoxOptions, t.boundingBoxData);
40
40
  }
41
- }, [o, t.buffer, t.data, t.boundingBoxData, t.boundingBoxOptions, t.fitBoundingBox]), e ? /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
42
- t.animate && /* @__PURE__ */ i.jsx(
43
- n,
41
+ }, [e, t.buffer, t.data, t.boundingBoxData, t.boundingBoxOptions, t.fitBoundingBox]), i ? /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
42
+ t.animate && /* @__PURE__ */ o.jsx(
43
+ u,
44
44
  {
45
45
  data: t.data,
46
46
  id: t.layerId
47
47
  }
48
48
  ),
49
- /* @__PURE__ */ i.jsx(
50
- l,
49
+ /* @__PURE__ */ o.jsx(
50
+ f,
51
51
  {
52
- cluster: t.cluster,
52
+ cluster: a,
53
53
  clusterMaxZoom: t.clusterMaxZoom,
54
54
  clusterMinPoints: t.clusterMinPoints,
55
55
  clusterProperties: t.clusterProperties,
@@ -63,14 +63,14 @@ const c = 2, x = (t) => {
63
63
  )
64
64
  ] }) : null;
65
65
  };
66
- x.defaultProps = {
67
- buffer: c,
66
+ y.defaultProps = {
67
+ buffer: x,
68
68
  fillStyle: r.fill,
69
69
  fitBoundingBox: !0,
70
70
  pointStyle: r.point,
71
71
  strokeStyle: r.stroke
72
72
  };
73
73
  export {
74
- x as default
74
+ y as default
75
75
  };
76
76
  //# sourceMappingURL=index.es6.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es6.js","sources":["../src/components/LocationMarkers.js"],"sourcesContent":["// @flow\n\nimport { GeoJSONLayer, PulsingMarkerLayer, useMap } from '@peripleo/maplibre';\nimport React, { useEffect, useMemo } from 'react';\nimport _ from 'underscore';\nimport MapStyles from '../utils/MapStyles';\nimport MapUtils from '../utils/Map';\n\ntype Props = {\n /**\n * If `true`, the point marker will display with a pulsing animation.\n */\n animate?: boolean,\n\n /**\n * (Optional) data to pass to the fitToBounds function.\n */\n boundingBoxData?: any,\n\n /**\n * (Optional) options to pass to the fitToBounds function.\n * See [spec](https://maplibre.org/maplibre-gl-js/docs/API/types/FitBoundsOptions/).\n */\n boundingBoxOptions?: any,\n\n /**\n * The number of miles to buffer the GeoJSON data.\n */\n buffer: number,\n\n /**\n * If true, markers will be clustered before the specified zoom level.\n */\n cluster?: boolean,\n\n /**\n * Max zoom to cluster points on.\n */\n clusterMaxZoom?: number,\n\n /**\n * Minimum number of points necessary to form a cluster.\n */\n clusterMinPoints?: number,\n\n /**\n * An object defining custom properties on the generated clusters.\n */\n clusterProperties?: any,\n\n /**\n * Radius of each cluster when clustering point.\n */\n clusterRadius?: number,\n\n /**\n * The GeoJSON data representing the location.\n */\n data: { [key: string]: any },\n\n /**\n * GeoJSON layer fill style.\n */\n fillStyle?: { [key: string]: any },\n\n /**\n * If `true`, the map will fit the bounding box around the passed data.\n */\n fitBoundingBox?: boolean,\n\n /**\n * An ID value to apply to the layer.\n */\n layerId?: string,\n\n /**\n * GeoJSON layer point style.\n */\n pointStyle?: { [key: string]: any },\n\n /**\n * GeoJSON layer stroke style\n */\n strokeStyle?: { [key: string]: any }\n};\n\nconst DEFAULT_BUFFER = 2;\n\n/**\n * This component renders a location marker to be used in a Peripleo context.\n */\nconst LocationMarkers = (props: Props) => {\n const map = useMap();\n\n /**\n * Memo-izes the data prop.\n *\n * @type {{[p: string]: *}}\n */\n const data = useMemo(() => (_.isEmpty(props.data) ? null : props.data), [props.data]);\n\n /**\n * Sets the bounding box on the map.\n */\n useEffect(() => {\n if (map && data && props.fitBoundingBox) {\n const bbox = MapUtils.getBoundingBox(data, props.buffer);\n\n if (bbox) {\n map.fitBounds(bbox, props.boundingBoxOptions, props.boundingBoxData);\n }\n }\n }, [map, props.buffer, props.data, props.boundingBoxData, props.boundingBoxOptions, props.fitBoundingBox]);\n\n if (!data) {\n return null;\n }\n\n return (\n <>\n { props.animate && (\n <PulsingMarkerLayer\n data={props.data}\n id={props.layerId}\n />\n )}\n <GeoJSONLayer\n cluster={props.cluster}\n clusterMaxZoom={props.clusterMaxZoom}\n clusterMinPoints={props.clusterMinPoints}\n clusterProperties={props.clusterProperties}\n clusterRadius={props.clusterRadius}\n data={props.data}\n fillStyle={props.fillStyle}\n id={props.layerId}\n strokeStyle={props.strokeStyle}\n pointStyle={props.pointStyle}\n />\n </>\n );\n};\n\nLocationMarkers.defaultProps = {\n buffer: DEFAULT_BUFFER,\n fillStyle: MapStyles.fill,\n fitBoundingBox: true,\n pointStyle: MapStyles.point,\n strokeStyle: MapStyles.stroke\n};\n\nexport default LocationMarkers;\n"],"names":["DEFAULT_BUFFER","LocationMarkers","props","map","useMap","data","useMemo","_","useEffect","bbox","MapUtils","jsxs","Fragment","jsx","PulsingMarkerLayer","GeoJSONLayer","MapStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsFA,MAAMA,IAAiB,GAKjBC,IAAkB,CAACC,MAAiB;AACxC,QAAMC,IAAMC,KAONC,IAAOC,EAAQ,MAAOC,EAAE,QAAQL,EAAM,IAAI,IAAI,OAAOA,EAAM,MAAO,CAACA,EAAM,IAAI,CAAC;AAepF,SAVAM,EAAU,MAAM;AACV,QAAAL,KAAOE,KAAQH,EAAM,gBAAgB;AACvC,YAAMO,IAAOC,EAAS,eAAeL,GAAMH,EAAM,MAAM;AAEvD,MAAIO,KACFN,EAAI,UAAUM,GAAMP,EAAM,oBAAoBA,EAAM,eAAe;AAAA,IAEvE;AAAA,EACC,GAAA,CAACC,GAAKD,EAAM,QAAQA,EAAM,MAAMA,EAAM,iBAAiBA,EAAM,oBAAoBA,EAAM,cAAc,CAAC,GAEpGG,IAMCM,gBAAAA,EAAA,KAAAC,YAAA,EAAA,UAAA;AAAA,IAAAV,EAAM,WACNW,gBAAAA,EAAA;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAMZ,EAAM;AAAA,QACZ,IAAIA,EAAM;AAAA,MAAA;AAAA,IACZ;AAAA,IAEFW,gBAAAA,EAAA;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,SAASb,EAAM;AAAA,QACf,gBAAgBA,EAAM;AAAA,QACtB,kBAAkBA,EAAM;AAAA,QACxB,mBAAmBA,EAAM;AAAA,QACzB,eAAeA,EAAM;AAAA,QACrB,MAAMA,EAAM;AAAA,QACZ,WAAWA,EAAM;AAAA,QACjB,IAAIA,EAAM;AAAA,QACV,aAAaA,EAAM;AAAA,QACnB,YAAYA,EAAM;AAAA,MAAA;AAAA,IACpB;AAAA,EACF,EAAA,CAAA,IAvBO;AAyBX;AAEAD,EAAgB,eAAe;AAAA,EAC7B,QAAQD;AAAA,EACR,WAAWgB,EAAU;AAAA,EACrB,gBAAgB;AAAA,EAChB,YAAYA,EAAU;AAAA,EACtB,aAAaA,EAAU;AACzB;"}
1
+ {"version":3,"file":"index.es6.js","sources":["../src/components/LocationMarkers.js"],"sourcesContent":["// @flow\n\nimport { GeoJSONLayer, PulsingMarkerLayer, useMap } from '@peripleo/maplibre';\nimport React, { useEffect, useMemo } from 'react';\nimport _ from 'underscore';\nimport MapStyles from '../utils/MapStyles';\nimport MapUtils from '../utils/Map';\n\ntype Props = {\n /**\n * If `true`, the point marker will display with a pulsing animation.\n */\n animate?: boolean,\n\n /**\n * (Optional) data to pass to the fitToBounds function.\n */\n boundingBoxData?: any,\n\n /**\n * (Optional) options to pass to the fitToBounds function.\n * See [spec](https://maplibre.org/maplibre-gl-js/docs/API/types/FitBoundsOptions/).\n */\n boundingBoxOptions?: any,\n\n /**\n * The number of miles to buffer the GeoJSON data.\n */\n buffer: number,\n\n /**\n * If true, markers will be clustered before the specified zoom level.\n */\n cluster?: boolean,\n\n /**\n * Max zoom to cluster points on.\n */\n clusterMaxZoom?: number,\n\n /**\n * Minimum number of points necessary to form a cluster.\n */\n clusterMinPoints?: number,\n\n /**\n * An object defining custom properties on the generated clusters.\n */\n clusterProperties?: any,\n\n /**\n * Radius of each cluster when clustering point.\n */\n clusterRadius?: number,\n\n /**\n * The GeoJSON data representing the location.\n */\n data: { [key: string]: any },\n\n /**\n * GeoJSON layer fill style.\n */\n fillStyle?: { [key: string]: any },\n\n /**\n * If `true`, the map will fit the bounding box around the passed data.\n */\n fitBoundingBox?: boolean,\n\n /**\n * An ID value to apply to the layer.\n */\n layerId?: string,\n\n /**\n * GeoJSON layer point style.\n */\n pointStyle?: { [key: string]: any },\n\n /**\n * GeoJSON layer stroke style\n */\n strokeStyle?: { [key: string]: any }\n};\n\nconst DEFAULT_BUFFER = 2;\n\n/**\n * This component renders a location marker to be used in a Peripleo context.\n */\nconst LocationMarkers = (props: Props) => {\n const map = useMap();\n\n /**\n * Memo-izes the data prop.\n *\n * @type {{[p: string]: *}}\n */\n const data = useMemo(() => (_.isEmpty(props.data) ? null : props.data), [props.data]);\n\n const cluster = useMemo(() => {\n if (!props.cluster) {\n return false;\n }\n\n console.log(data);\n\n return true;\n }, [data, props.cluster]);\n\n /**\n * Sets the bounding box on the map.\n */\n useEffect(() => {\n if (map && data && props.fitBoundingBox) {\n const bbox = MapUtils.getBoundingBox(data, props.buffer);\n\n if (bbox) {\n map.fitBounds(bbox, props.boundingBoxOptions, props.boundingBoxData);\n }\n }\n }, [map, props.buffer, props.data, props.boundingBoxData, props.boundingBoxOptions, props.fitBoundingBox]);\n\n if (!data) {\n return null;\n }\n\n return (\n <>\n { props.animate && (\n <PulsingMarkerLayer\n data={props.data}\n id={props.layerId}\n />\n )}\n <GeoJSONLayer\n cluster={cluster}\n clusterMaxZoom={props.clusterMaxZoom}\n clusterMinPoints={props.clusterMinPoints}\n clusterProperties={props.clusterProperties}\n clusterRadius={props.clusterRadius}\n data={props.data}\n fillStyle={props.fillStyle}\n id={props.layerId}\n strokeStyle={props.strokeStyle}\n pointStyle={props.pointStyle}\n />\n </>\n );\n};\n\nLocationMarkers.defaultProps = {\n buffer: DEFAULT_BUFFER,\n fillStyle: MapStyles.fill,\n fitBoundingBox: true,\n pointStyle: MapStyles.point,\n strokeStyle: MapStyles.stroke\n};\n\nexport default LocationMarkers;\n"],"names":["DEFAULT_BUFFER","LocationMarkers","props","map","useMap","data","useMemo","_","cluster","useEffect","bbox","MapUtils","jsxs","Fragment","jsx","PulsingMarkerLayer","GeoJSONLayer","MapStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsFA,MAAMA,IAAiB,GAKjBC,IAAkB,CAACC,MAAiB;AACxC,QAAMC,IAAMC,KAONC,IAAOC,EAAQ,MAAOC,EAAE,QAAQL,EAAM,IAAI,IAAI,OAAOA,EAAM,MAAO,CAACA,EAAM,IAAI,CAAC,GAE9EM,IAAUF,EAAQ,MACjBJ,EAAM,WAIX,QAAQ,IAAIG,CAAI,GAET,MALE,IAMR,CAACA,GAAMH,EAAM,OAAO,CAAC;AAexB,SAVAO,EAAU,MAAM;AACV,QAAAN,KAAOE,KAAQH,EAAM,gBAAgB;AACvC,YAAMQ,IAAOC,EAAS,eAAeN,GAAMH,EAAM,MAAM;AAEvD,MAAIQ,KACFP,EAAI,UAAUO,GAAMR,EAAM,oBAAoBA,EAAM,eAAe;AAAA,IAEvE;AAAA,EACC,GAAA,CAACC,GAAKD,EAAM,QAAQA,EAAM,MAAMA,EAAM,iBAAiBA,EAAM,oBAAoBA,EAAM,cAAc,CAAC,GAEpGG,IAMCO,gBAAAA,EAAA,KAAAC,YAAA,EAAA,UAAA;AAAA,IAAAX,EAAM,WACNY,gBAAAA,EAAA;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAMb,EAAM;AAAA,QACZ,IAAIA,EAAM;AAAA,MAAA;AAAA,IACZ;AAAA,IAEFY,gBAAAA,EAAA;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,SAAAR;AAAA,QACA,gBAAgBN,EAAM;AAAA,QACtB,kBAAkBA,EAAM;AAAA,QACxB,mBAAmBA,EAAM;AAAA,QACzB,eAAeA,EAAM;AAAA,QACrB,MAAMA,EAAM;AAAA,QACZ,WAAWA,EAAM;AAAA,QACjB,IAAIA,EAAM;AAAA,QACV,aAAaA,EAAM;AAAA,QACnB,YAAYA,EAAM;AAAA,MAAA;AAAA,IACpB;AAAA,EACF,EAAA,CAAA,IAvBO;AAyBX;AAEAD,EAAgB,eAAe;AAAA,EAC7B,QAAQD;AAAA,EACR,WAAWiB,EAAU;AAAA,EACrB,gBAAgB;AAAA,EAChB,YAAYA,EAAU;AAAA,EACtB,aAAaA,EAAU;AACzB;"}
@@ -1,5 +1,33 @@
1
- var a = { exports: {} };
1
+ import { __exports as t } from "./index.es67.js";
2
+ import R from "react";
3
+ var p;
4
+ function v() {
5
+ if (p)
6
+ return t;
7
+ p = 1;
8
+ /**
9
+ * @license React
10
+ * react-jsx-runtime.production.min.js
11
+ *
12
+ * Copyright (c) Facebook, Inc. and its affiliates.
13
+ *
14
+ * This source code is licensed under the MIT license found in the
15
+ * LICENSE file in the root directory of this source tree.
16
+ */
17
+ var s = R, m = Symbol.for("react.element"), l = Symbol.for("react.fragment"), c = Object.prototype.hasOwnProperty, a = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, d = { key: !0, ref: !0, __self: !0, __source: !0 };
18
+ function u(o, r, i) {
19
+ var e, n = {}, _ = null, f = null;
20
+ i !== void 0 && (_ = "" + i), r.key !== void 0 && (_ = "" + r.key), r.ref !== void 0 && (f = r.ref);
21
+ for (e in r)
22
+ c.call(r, e) && !d.hasOwnProperty(e) && (n[e] = r[e]);
23
+ if (o && o.defaultProps)
24
+ for (e in r = o.defaultProps, r)
25
+ n[e] === void 0 && (n[e] = r[e]);
26
+ return { $$typeof: m, type: o, key: _, ref: f, props: n, _owner: a.current };
27
+ }
28
+ return t.Fragment = l, t.jsx = u, t.jsxs = u, t;
29
+ }
2
30
  export {
3
- a as __module
31
+ v as __require
4
32
  };
5
33
  //# sourceMappingURL=index.es60.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es60.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"index.es60.js","sources":["../../../node_modules/react/cjs/react-jsx-runtime.production.min.js"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n"],"names":["f","require$$0","k","m","n","p","q","c","a","g","b","d","e","h","reactJsxRuntime_production_min"],"mappings":";;;;;;;EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASa,MAAIA,IAAEC,GAAiBC,IAAE,OAAO,IAAI,eAAe,GAAE,IAAE,OAAO,IAAI,gBAAgB,GAAEC,IAAE,OAAO,UAAU,gBAAeC,IAAEJ,EAAE,mDAAmD,mBAAkBK,IAAE,EAAC,KAAI,IAAG,KAAI,IAAG,QAAO,IAAG,UAAS,GAAE;AAClP,WAASC,EAAEC,GAAEC,GAAEC,GAAE;AAAC,QAAIC,GAAEC,IAAE,CAAG,GAAAC,IAAE,MAAKC,IAAE;AAAc,IAAAJ,MAAA,WAAIG,IAAE,KAAGH,IAAYD,EAAE,QAAX,WAAiBI,IAAE,KAAGJ,EAAE,MAAcA,EAAE,QAAF,WAAQK,IAAEL,EAAE;AAAK,SAAIE,KAAKF;AAAE,MAAAL,EAAE,KAAKK,GAAEE,CAAC,KAAG,CAACL,EAAE,eAAeK,CAAC,MAAIC,EAAED,CAAC,IAAEF,EAAEE,CAAC;AAAG,QAAGH,KAAGA,EAAE;AAAiB,WAAAG,KAAKF,IAAED,EAAE,cAAaC;AAAE,QAASG,EAAED,CAAC,MAAZ,WAAgBC,EAAED,CAAC,IAAEF,EAAEE,CAAC;AAAG,WAAM,EAAC,UAASR,GAAE,MAAKK,GAAE,KAAIK,GAAE,KAAIC,GAAE,OAAMF,GAAE,QAAOP,EAAE,QAAO;AAAA,EAAC;AAAkB,SAAAU,EAAA,WAAA,GAAcA,EAAA,MAAAR,GAAEQ,EAAA,OAAaR;;","x_google_ignoreList":[0]}