react-three-map 0.0.4 → 0.1.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 (56) hide show
  1. package/dist/cjs/main.js.js +1 -1
  2. package/dist/es/main.js2.mjs +14 -15
  3. package/dist/es/main.js2.mjs.map +1 -1
  4. package/dist/es/main.js3.mjs +7 -17
  5. package/dist/es/main.js3.mjs.map +1 -1
  6. package/dist/es/main.js4.mjs +49 -7
  7. package/dist/es/main.js4.mjs.map +1 -1
  8. package/dist/es/main.js5.mjs +11 -48
  9. package/dist/es/main.js5.mjs.map +1 -1
  10. package/dist/es/main.js6.mjs +52 -12
  11. package/dist/es/main.js6.mjs.map +1 -1
  12. package/dist/es/main.js7.mjs +6 -59
  13. package/dist/es/main.js7.mjs.map +1 -1
  14. package/package.json +1 -1
  15. package/dist/es/main.js10.mjs +0 -40
  16. package/dist/es/main.js10.mjs.map +0 -1
  17. package/dist/es/main.js11.mjs +0 -13
  18. package/dist/es/main.js11.mjs.map +0 -1
  19. package/dist/es/main.js12.mjs +0 -13
  20. package/dist/es/main.js12.mjs.map +0 -1
  21. package/dist/es/main.js13.mjs +0 -31
  22. package/dist/es/main.js13.mjs.map +0 -1
  23. package/dist/es/main.js14.mjs +0 -13
  24. package/dist/es/main.js14.mjs.map +0 -1
  25. package/dist/es/main.js15.mjs +0 -15
  26. package/dist/es/main.js15.mjs.map +0 -1
  27. package/dist/es/main.js16.mjs +0 -14
  28. package/dist/es/main.js16.mjs.map +0 -1
  29. package/dist/es/main.js17.mjs +0 -56
  30. package/dist/es/main.js17.mjs.map +0 -1
  31. package/dist/es/main.js18.mjs +0 -9
  32. package/dist/es/main.js18.mjs.map +0 -1
  33. package/dist/es/main.js19.mjs +0 -320
  34. package/dist/es/main.js19.mjs.map +0 -1
  35. package/dist/es/main.js20.mjs +0 -72
  36. package/dist/es/main.js20.mjs.map +0 -1
  37. package/dist/es/main.js21.mjs +0 -6
  38. package/dist/es/main.js21.mjs.map +0 -1
  39. package/dist/es/main.js22.mjs +0 -19
  40. package/dist/es/main.js22.mjs.map +0 -1
  41. package/dist/es/main.js23.mjs +0 -14
  42. package/dist/es/main.js23.mjs.map +0 -1
  43. package/dist/es/main.js24.mjs +0 -34
  44. package/dist/es/main.js24.mjs.map +0 -1
  45. package/dist/es/main.js25.mjs +0 -15
  46. package/dist/es/main.js25.mjs.map +0 -1
  47. package/dist/es/main.js26.mjs +0 -8
  48. package/dist/es/main.js26.mjs.map +0 -1
  49. package/dist/es/main.js27.mjs +0 -41
  50. package/dist/es/main.js27.mjs.map +0 -1
  51. package/dist/es/main.js28.mjs +0 -26
  52. package/dist/es/main.js28.mjs.map +0 -1
  53. package/dist/es/main.js8.mjs +0 -58
  54. package/dist/es/main.js8.mjs.map +0 -1
  55. package/dist/es/main.js9.mjs +0 -49
  56. package/dist/es/main.js9.mjs.map +0 -1
@@ -1,72 +0,0 @@
1
- const i = [
2
- "setMaxBounds",
3
- "setMinZoom",
4
- "setMaxZoom",
5
- "setMinPitch",
6
- "setMaxPitch",
7
- "setRenderWorldCopies",
8
- "setProjection",
9
- "setStyle",
10
- "addSource",
11
- "removeSource",
12
- "addLayer",
13
- "removeLayer",
14
- "setLayerZoomRange",
15
- "setFilter",
16
- "setPaintProperty",
17
- "setLayoutProperty",
18
- "setLight",
19
- "setTerrain",
20
- "setFog",
21
- "remove"
22
- ];
23
- function u(e) {
24
- if (!e)
25
- return null;
26
- const r = e.map, o = {
27
- getMap: () => r,
28
- // Overwrite getters to use our shadow transform
29
- getCenter: () => e.transform.center,
30
- getZoom: () => e.transform.zoom,
31
- getBearing: () => e.transform.bearing,
32
- getPitch: () => e.transform.pitch,
33
- getPadding: () => e.transform.padding,
34
- getBounds: () => e.transform.getBounds(),
35
- project: (t) => {
36
- const n = r.transform;
37
- r.transform = e.transform;
38
- const s = r.project(t);
39
- return r.transform = n, s;
40
- },
41
- unproject: (t) => {
42
- const n = r.transform;
43
- r.transform = e.transform;
44
- const s = r.unproject(t);
45
- return r.transform = n, s;
46
- },
47
- // options diverge between mapbox and maplibre
48
- queryTerrainElevation: (t, n) => {
49
- const s = r.transform;
50
- r.transform = e.transform;
51
- const f = r.queryTerrainElevation(t, n);
52
- return r.transform = s, f;
53
- }
54
- };
55
- for (const t of a(r))
56
- !(t in o) && !i.includes(t) && (o[t] = r[t].bind(r));
57
- return o;
58
- }
59
- function a(e) {
60
- const r = /* @__PURE__ */ new Set();
61
- let o = e;
62
- for (; o; ) {
63
- for (const t of Object.getOwnPropertyNames(o))
64
- t[0] !== "_" && typeof e[t] == "function" && t !== "fire" && t !== "setEventedParent" && r.add(t);
65
- o = Object.getPrototypeOf(o);
66
- }
67
- return Array.from(r);
68
- }
69
- export {
70
- u as default
71
- };
72
- //# sourceMappingURL=main.js20.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"main.js20.mjs","sources":["../../node_modules/react-map-gl/dist/esm/mapbox/create-ref.js"],"sourcesContent":["/** These methods may break the react binding if called directly */\nconst skipMethods = [\n 'setMaxBounds',\n 'setMinZoom',\n 'setMaxZoom',\n 'setMinPitch',\n 'setMaxPitch',\n 'setRenderWorldCopies',\n 'setProjection',\n 'setStyle',\n 'addSource',\n 'removeSource',\n 'addLayer',\n 'removeLayer',\n 'setLayerZoomRange',\n 'setFilter',\n 'setPaintProperty',\n 'setLayoutProperty',\n 'setLight',\n 'setTerrain',\n 'setFog',\n 'remove'\n];\nexport default function createRef(mapInstance) {\n if (!mapInstance) {\n return null;\n }\n const map = mapInstance.map;\n const result = {\n getMap: () => map,\n // Overwrite getters to use our shadow transform\n getCenter: () => mapInstance.transform.center,\n getZoom: () => mapInstance.transform.zoom,\n getBearing: () => mapInstance.transform.bearing,\n getPitch: () => mapInstance.transform.pitch,\n getPadding: () => mapInstance.transform.padding,\n getBounds: () => mapInstance.transform.getBounds(),\n project: (lnglat) => {\n const tr = map.transform;\n map.transform = mapInstance.transform;\n const result = map.project(lnglat);\n map.transform = tr;\n return result;\n },\n unproject: (point) => {\n const tr = map.transform;\n map.transform = mapInstance.transform;\n const result = map.unproject(point);\n map.transform = tr;\n return result;\n },\n // options diverge between mapbox and maplibre\n queryTerrainElevation: (lnglat, options) => {\n const tr = map.transform;\n map.transform = mapInstance.transform;\n const result = map.queryTerrainElevation(lnglat, options);\n map.transform = tr;\n return result;\n }\n };\n for (const key of getMethodNames(map)) {\n // @ts-expect-error\n if (!(key in result) && !skipMethods.includes(key)) {\n result[key] = map[key].bind(map);\n }\n }\n return result;\n}\nfunction getMethodNames(obj) {\n const result = new Set();\n let proto = obj;\n while (proto) {\n for (const key of Object.getOwnPropertyNames(proto)) {\n if (key[0] !== '_' &&\n typeof obj[key] === 'function' &&\n key !== 'fire' &&\n key !== 'setEventedParent') {\n result.add(key);\n }\n }\n proto = Object.getPrototypeOf(proto);\n }\n return Array.from(result);\n}\n//# sourceMappingURL=create-ref.js.map"],"names":["skipMethods","createRef","mapInstance","map","result","lnglat","tr","point","options","key","getMethodNames","obj","proto"],"mappings":"AACA,MAAMA,IAAc;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ;AACe,SAASC,EAAUC,GAAa;AAC3C,MAAI,CAACA;AACD,WAAO;AAEX,QAAMC,IAAMD,EAAY,KAClBE,IAAS;AAAA,IACX,QAAQ,MAAMD;AAAA;AAAA,IAEd,WAAW,MAAMD,EAAY,UAAU;AAAA,IACvC,SAAS,MAAMA,EAAY,UAAU;AAAA,IACrC,YAAY,MAAMA,EAAY,UAAU;AAAA,IACxC,UAAU,MAAMA,EAAY,UAAU;AAAA,IACtC,YAAY,MAAMA,EAAY,UAAU;AAAA,IACxC,WAAW,MAAMA,EAAY,UAAU,UAAW;AAAA,IAClD,SAAS,CAACG,MAAW;AACjB,YAAMC,IAAKH,EAAI;AACf,MAAAA,EAAI,YAAYD,EAAY;AAC5B,YAAME,IAASD,EAAI,QAAQE,CAAM;AACjC,aAAAF,EAAI,YAAYG,GACTF;AAAA,IACV;AAAA,IACD,WAAW,CAACG,MAAU;AAClB,YAAMD,IAAKH,EAAI;AACf,MAAAA,EAAI,YAAYD,EAAY;AAC5B,YAAME,IAASD,EAAI,UAAUI,CAAK;AAClC,aAAAJ,EAAI,YAAYG,GACTF;AAAA,IACV;AAAA;AAAA,IAED,uBAAuB,CAACC,GAAQG,MAAY;AACxC,YAAMF,IAAKH,EAAI;AACf,MAAAA,EAAI,YAAYD,EAAY;AAC5B,YAAME,IAASD,EAAI,sBAAsBE,GAAQG,CAAO;AACxD,aAAAL,EAAI,YAAYG,GACTF;AAAA,IACV;AAAA,EACT;AACI,aAAWK,KAAOC,EAAeP,CAAG;AAEhC,IAAI,EAAEM,KAAOL,MAAW,CAACJ,EAAY,SAASS,CAAG,MAC7CL,EAAOK,CAAG,IAAIN,EAAIM,CAAG,EAAE,KAAKN,CAAG;AAGvC,SAAOC;AACX;AACA,SAASM,EAAeC,GAAK;AACzB,QAAMP,IAAS,oBAAI;AACnB,MAAIQ,IAAQD;AACZ,SAAOC,KAAO;AACV,eAAWH,KAAO,OAAO,oBAAoBG,CAAK;AAC9C,MAAIH,EAAI,CAAC,MAAM,OACX,OAAOE,EAAIF,CAAG,KAAM,cACpBA,MAAQ,UACRA,MAAQ,sBACRL,EAAO,IAAIK,CAAG;AAGtB,IAAAG,IAAQ,OAAO,eAAeA,CAAK;AAAA;AAEvC,SAAO,MAAM,KAAKR,CAAM;AAC5B;","x_google_ignoreList":[0]}
@@ -1,6 +0,0 @@
1
- import { useLayoutEffect as e, useEffect as t } from "react";
2
- const o = typeof document < "u" ? e : t;
3
- export {
4
- o as default
5
- };
6
- //# sourceMappingURL=main.js21.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"main.js21.mjs","sources":["../../node_modules/react-map-gl/dist/esm/utils/use-isomorphic-layout-effect.js"],"sourcesContent":["// From https://github.com/streamich/react-use/blob/master/src/useIsomorphicLayoutEffect.ts\n// useLayoutEffect but does not trigger warning in server-side rendering\nimport { useEffect, useLayoutEffect } from 'react';\nconst useIsomorphicLayoutEffect = typeof document !== 'undefined' ? useLayoutEffect : useEffect;\nexport default useIsomorphicLayoutEffect;\n//# sourceMappingURL=use-isomorphic-layout-effect.js.map"],"names":["useIsomorphicLayoutEffect","useLayoutEffect","useEffect"],"mappings":";AAGK,MAACA,IAA4B,OAAO,WAAa,MAAcC,IAAkBC;","x_google_ignoreList":[0]}
@@ -1,19 +0,0 @@
1
- const a = [
2
- "baseApiUrl",
3
- "maxParallelImageRequests",
4
- "workerClass",
5
- "workerCount",
6
- "workerUrl"
7
- ];
8
- function o(e, l) {
9
- for (const t of a)
10
- t in l && (e[t] = l[t]);
11
- const { RTLTextPlugin: s = "https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js" } = l;
12
- s && e.getRTLTextPluginStatus && e.getRTLTextPluginStatus() === "unavailable" && e.setRTLTextPlugin(s, (t) => {
13
- t && console.error(t);
14
- }, !1);
15
- }
16
- export {
17
- o as default
18
- };
19
- //# sourceMappingURL=main.js22.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"main.js22.mjs","sources":["../../node_modules/react-map-gl/dist/esm/utils/set-globals.js"],"sourcesContent":["const globalSettings = [\n 'baseApiUrl',\n 'maxParallelImageRequests',\n 'workerClass',\n 'workerCount',\n 'workerUrl'\n];\nexport default function setGlobals(mapLib, props) {\n for (const key of globalSettings) {\n if (key in props) {\n mapLib[key] = props[key];\n }\n }\n const { RTLTextPlugin = 'https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js' } = props;\n if (RTLTextPlugin &&\n mapLib.getRTLTextPluginStatus &&\n mapLib.getRTLTextPluginStatus() === 'unavailable') {\n mapLib.setRTLTextPlugin(RTLTextPlugin, (error) => {\n if (error) {\n // eslint-disable-next-line\n console.error(error);\n }\n }, false);\n }\n}\n//# sourceMappingURL=set-globals.js.map"],"names":["globalSettings","setGlobals","mapLib","props","key","RTLTextPlugin","error"],"mappings":"AAAA,MAAMA,IAAiB;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ;AACe,SAASC,EAAWC,GAAQC,GAAO;AAC9C,aAAWC,KAAOJ;AACd,IAAII,KAAOD,MACPD,EAAOE,CAAG,IAAID,EAAMC,CAAG;AAG/B,QAAM,EAAE,eAAAC,IAAgB,8FAA+F,IAAGF;AAC1H,EAAIE,KACAH,EAAO,0BACPA,EAAO,uBAAwB,MAAK,iBACpCA,EAAO,iBAAiBG,GAAe,CAACC,MAAU;AAC9C,IAAIA,KAEA,QAAQ,MAAMA,CAAK;AAAA,EAE1B,GAAE,EAAK;AAEhB;","x_google_ignoreList":[0]}
@@ -1,14 +0,0 @@
1
- const r = /box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;
2
- function c(n, t) {
3
- if (!n || !t)
4
- return;
5
- const o = n.style;
6
- for (const e in t) {
7
- const i = t[e];
8
- Number.isFinite(i) && !r.test(e) ? o[e] = `${i}px` : o[e] = i;
9
- }
10
- }
11
- export {
12
- c as applyReactStyle
13
- };
14
- //# sourceMappingURL=main.js23.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"main.js23.mjs","sources":["../../node_modules/react-map-gl/dist/esm/utils/apply-react-style.js"],"sourcesContent":["// This is a simplified version of\n// https://github.com/facebook/react/blob/4131af3e4bf52f3a003537ec95a1655147c81270/src/renderers/dom/shared/CSSPropertyOperations.js#L62\nconst unitlessNumber = /box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;\nexport function applyReactStyle(element, styles) {\n if (!element || !styles) {\n return;\n }\n const style = element.style;\n for (const key in styles) {\n const value = styles[key];\n if (Number.isFinite(value) && !unitlessNumber.test(key)) {\n style[key] = `${value}px`;\n }\n else {\n style[key] = value;\n }\n }\n}\n//# sourceMappingURL=apply-react-style.js.map"],"names":["unitlessNumber","applyReactStyle","element","styles","style","key","value"],"mappings":"AAEA,MAAMA,IAAiB;AAChB,SAASC,EAAgBC,GAASC,GAAQ;AAC7C,MAAI,CAACD,KAAW,CAACC;AACb;AAEJ,QAAMC,IAAQF,EAAQ;AACtB,aAAWG,KAAOF,GAAQ;AACtB,UAAMG,IAAQH,EAAOE,CAAG;AACxB,IAAI,OAAO,SAASC,CAAK,KAAK,CAACN,EAAe,KAAKK,CAAG,IAClDD,EAAMC,CAAG,IAAI,GAAGC,QAGhBF,EAAMC,CAAG,IAAIC;AAAA;AAGzB;","x_google_ignoreList":[0]}
@@ -1,34 +0,0 @@
1
- function i(e, r) {
2
- const t = Array.isArray(e) ? e[0] : e ? e.x : 0, s = Array.isArray(e) ? e[1] : e ? e.y : 0, n = Array.isArray(r) ? r[0] : r ? r.x : 0, f = Array.isArray(r) ? r[1] : r ? r.y : 0;
3
- return t === n && s === f;
4
- }
5
- function y(e, r) {
6
- if (e === r)
7
- return !0;
8
- if (!e || !r)
9
- return !1;
10
- if (Array.isArray(e)) {
11
- if (!Array.isArray(r) || e.length !== r.length)
12
- return !1;
13
- for (let t = 0; t < e.length; t++)
14
- if (!y(e[t], r[t]))
15
- return !1;
16
- return !0;
17
- } else if (Array.isArray(r))
18
- return !1;
19
- if (typeof e == "object" && typeof r == "object") {
20
- const t = Object.keys(e), s = Object.keys(r);
21
- if (t.length !== s.length)
22
- return !1;
23
- for (const n of t)
24
- if (!r.hasOwnProperty(n) || !y(e[n], r[n]))
25
- return !1;
26
- return !0;
27
- }
28
- return !1;
29
- }
30
- export {
31
- i as arePointsEqual,
32
- y as deepEqual
33
- };
34
- //# sourceMappingURL=main.js24.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"main.js24.mjs","sources":["../../node_modules/react-map-gl/dist/esm/utils/deep-equal.js"],"sourcesContent":["/**\n * Compare two points\n * @param a\n * @param b\n * @returns true if the points are equal\n */\nexport function arePointsEqual(a, b) {\n const ax = Array.isArray(a) ? a[0] : a ? a.x : 0;\n const ay = Array.isArray(a) ? a[1] : a ? a.y : 0;\n const bx = Array.isArray(b) ? b[0] : b ? b.x : 0;\n const by = Array.isArray(b) ? b[1] : b ? b.y : 0;\n return ax === bx && ay === by;\n}\n/* eslint-disable complexity */\n/**\n * Compare any two objects\n * @param a\n * @param b\n * @returns true if the objects are deep equal\n */\nexport function deepEqual(a, b) {\n if (a === b) {\n return true;\n }\n if (!a || !b) {\n return false;\n }\n if (Array.isArray(a)) {\n if (!Array.isArray(b) || a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (!deepEqual(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n else if (Array.isArray(b)) {\n return false;\n }\n if (typeof a === 'object' && typeof b === 'object') {\n const aKeys = Object.keys(a);\n const bKeys = Object.keys(b);\n if (aKeys.length !== bKeys.length) {\n return false;\n }\n for (const key of aKeys) {\n if (!b.hasOwnProperty(key)) {\n return false;\n }\n if (!deepEqual(a[key], b[key])) {\n return false;\n }\n }\n return true;\n }\n return false;\n}\n//# sourceMappingURL=deep-equal.js.map"],"names":["arePointsEqual","a","b","ax","ay","bx","by","deepEqual","i","aKeys","bKeys","key"],"mappings":"AAMO,SAASA,EAAeC,GAAGC,GAAG;AACjC,QAAMC,IAAK,MAAM,QAAQF,CAAC,IAAIA,EAAE,CAAC,IAAIA,IAAIA,EAAE,IAAI,GACzCG,IAAK,MAAM,QAAQH,CAAC,IAAIA,EAAE,CAAC,IAAIA,IAAIA,EAAE,IAAI,GACzCI,IAAK,MAAM,QAAQH,CAAC,IAAIA,EAAE,CAAC,IAAIA,IAAIA,EAAE,IAAI,GACzCI,IAAK,MAAM,QAAQJ,CAAC,IAAIA,EAAE,CAAC,IAAIA,IAAIA,EAAE,IAAI;AAC/C,SAAOC,MAAOE,KAAMD,MAAOE;AAC/B;AAQO,SAASC,EAAUN,GAAGC,GAAG;AAC5B,MAAID,MAAMC;AACN,WAAO;AAEX,MAAI,CAACD,KAAK,CAACC;AACP,WAAO;AAEX,MAAI,MAAM,QAAQD,CAAC,GAAG;AAClB,QAAI,CAAC,MAAM,QAAQC,CAAC,KAAKD,EAAE,WAAWC,EAAE;AACpC,aAAO;AAEX,aAASM,IAAI,GAAGA,IAAIP,EAAE,QAAQO;AAC1B,UAAI,CAACD,EAAUN,EAAEO,CAAC,GAAGN,EAAEM,CAAC,CAAC;AACrB,eAAO;AAGf,WAAO;AAAA,aAEF,MAAM,QAAQN,CAAC;AACpB,WAAO;AAEX,MAAI,OAAOD,KAAM,YAAY,OAAOC,KAAM,UAAU;AAChD,UAAMO,IAAQ,OAAO,KAAKR,CAAC,GACrBS,IAAQ,OAAO,KAAKR,CAAC;AAC3B,QAAIO,EAAM,WAAWC,EAAM;AACvB,aAAO;AAEX,eAAWC,KAAOF;AAId,UAHI,CAACP,EAAE,eAAeS,CAAG,KAGrB,CAACJ,EAAUN,EAAEU,CAAG,GAAGT,EAAES,CAAG,CAAC;AACzB,eAAO;AAGf,WAAO;AAAA;AAEX,SAAO;AACX;","x_google_ignoreList":[0]}
@@ -1,15 +0,0 @@
1
- import { useContext as p, useMemo as r, useEffect as m } from "react";
2
- import { MapContext as d } from "./main.js8.mjs";
3
- function x(c, o, n, l) {
4
- const e = p(d), t = r(() => c(e), []);
5
- return m(() => {
6
- const i = l || n || o, s = typeof o == "function" && typeof n == "function" ? o : null, u = typeof n == "function" ? n : typeof o == "function" ? o : null, { map: f } = e;
7
- return f.hasControl(t) || (f.addControl(t, i == null ? void 0 : i.position), s && s(e)), () => {
8
- u && u(e), f.hasControl(t) && f.removeControl(t);
9
- };
10
- }, []), t;
11
- }
12
- export {
13
- x as default
14
- };
15
- //# sourceMappingURL=main.js25.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"main.js25.mjs","sources":["../../node_modules/react-map-gl/dist/esm/components/use-control.js"],"sourcesContent":["import { useContext, useMemo, useEffect } from 'react';\nimport { MapContext } from './map';\nfunction useControl(onCreate, arg1, arg2, arg3) {\n const context = useContext(MapContext);\n const ctrl = useMemo(() => onCreate(context), []);\n useEffect(() => {\n const opts = (arg3 || arg2 || arg1);\n const onAdd = typeof arg1 === 'function' && typeof arg2 === 'function' ? arg1 : null;\n const onRemove = typeof arg2 === 'function' ? arg2 : typeof arg1 === 'function' ? arg1 : null;\n const { map } = context;\n if (!map.hasControl(ctrl)) {\n map.addControl(ctrl, opts === null || opts === void 0 ? void 0 : opts.position);\n if (onAdd) {\n onAdd(context);\n }\n }\n return () => {\n if (onRemove) {\n onRemove(context);\n }\n // Map might have been removed (parent effects are destroyed before child ones)\n if (map.hasControl(ctrl)) {\n map.removeControl(ctrl);\n }\n };\n }, []);\n return ctrl;\n}\nexport default useControl;\n//# sourceMappingURL=use-control.js.map"],"names":["useControl","onCreate","arg1","arg2","arg3","context","useContext","MapContext","ctrl","useMemo","useEffect","opts","onAdd","onRemove","map"],"mappings":";;AAEA,SAASA,EAAWC,GAAUC,GAAMC,GAAMC,GAAM;AAC5C,QAAMC,IAAUC,EAAWC,CAAU,GAC/BC,IAAOC,EAAQ,MAAMR,EAASI,CAAO,GAAG,CAAA,CAAE;AAChD,SAAAK,EAAU,MAAM;AACZ,UAAMC,IAAQP,KAAQD,KAAQD,GACxBU,IAAQ,OAAOV,KAAS,cAAc,OAAOC,KAAS,aAAaD,IAAO,MAC1EW,IAAW,OAAOV,KAAS,aAAaA,IAAO,OAAOD,KAAS,aAAaA,IAAO,MACnF,EAAE,KAAAY,EAAK,IAAGT;AAChB,WAAKS,EAAI,WAAWN,CAAI,MACpBM,EAAI,WAAWN,GAAMG,KAAS,OAA0B,SAASA,EAAK,QAAQ,GAC1EC,KACAA,EAAMP,CAAO,IAGd,MAAM;AACT,MAAIQ,KACAA,EAASR,CAAO,GAGhBS,EAAI,WAAWN,CAAI,KACnBM,EAAI,cAAcN,CAAI;AAAA,IAEtC;AAAA,EACK,GAAE,CAAE,CAAA,GACEA;AACX;","x_google_ignoreList":[0]}
@@ -1,8 +0,0 @@
1
- function e(r, t) {
2
- if (!r)
3
- throw new Error(t);
4
- }
5
- export {
6
- e as default
7
- };
8
- //# sourceMappingURL=main.js26.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"main.js26.mjs","sources":["../../node_modules/react-map-gl/dist/esm/utils/assert.js"],"sourcesContent":["export default function assert(condition, message) {\n if (!condition) {\n throw new Error(message);\n }\n}\n//# sourceMappingURL=assert.js.map"],"names":["assert","condition","message"],"mappings":"AAAe,SAASA,EAAOC,GAAWC,GAAS;AAC/C,MAAI,CAACD;AACD,UAAM,IAAI,MAAMC,CAAO;AAE/B;","x_google_ignoreList":[0]}
@@ -1,41 +0,0 @@
1
- function a(n) {
2
- const t = n.clone();
3
- return t.pixelsToGLUnits = n.pixelsToGLUnits, t;
4
- }
5
- function c(n) {
6
- return {
7
- longitude: n.center.lng,
8
- latitude: n.center.lat,
9
- zoom: n.zoom,
10
- pitch: n.pitch,
11
- bearing: n.bearing,
12
- padding: n.padding
13
- };
14
- }
15
- function d(n, t) {
16
- const i = t.viewState || t;
17
- let e = !1;
18
- if ("longitude" in i && "latitude" in i) {
19
- const o = n.center;
20
- n.center = new o.constructor(i.longitude, i.latitude), e = e || o !== n.center;
21
- }
22
- if ("zoom" in i) {
23
- const o = n.zoom;
24
- n.zoom = i.zoom, e = e || o !== n.zoom;
25
- }
26
- if ("bearing" in i) {
27
- const o = n.bearing;
28
- n.bearing = i.bearing, e = e || o !== n.bearing;
29
- }
30
- if ("pitch" in i) {
31
- const o = n.pitch;
32
- n.pitch = i.pitch, e = e || o !== n.pitch;
33
- }
34
- return i.padding && !n.isPaddingEqual(i.padding) && (e = !0, n.padding = i.padding), e;
35
- }
36
- export {
37
- d as applyViewStateToTransform,
38
- a as cloneTransform,
39
- c as transformToViewState
40
- };
41
- //# sourceMappingURL=main.js27.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"main.js27.mjs","sources":["../../node_modules/react-map-gl/dist/esm/utils/transform.js"],"sourcesContent":["/**\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 * 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","transformToViewState","applyViewStateToTransform","props","v","changed","center","zoom","bearing","pitch"],"mappings":"AAIO,SAASA,EAAeC,GAAI;AAC/B,QAAMC,IAAeD,EAAG;AAExB,SAAAC,EAAa,kBAAkBD,EAAG,iBAC3BC;AACX;AAMO,SAASC,EAAqBF,GAAI;AACrC,SAAO;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,EACpB;AACA;AAQO,SAASG,EAA0BH,GAAII,GAAO;AACjD,QAAMC,IAAID,EAAM,aAAaA;AAC7B,MAAIE,IAAU;AACd,MAAI,eAAeD,KAAK,cAAcA,GAAG;AACrC,UAAME,IAASP,EAAG;AAElB,IAAAA,EAAG,SAAS,IAAIO,EAAO,YAAYF,EAAE,WAAWA,EAAE,QAAQ,GAC1DC,IAAUA,KAAWC,MAAWP,EAAG;AAAA;AAEvC,MAAI,UAAUK,GAAG;AACb,UAAMG,IAAOR,EAAG;AAChB,IAAAA,EAAG,OAAOK,EAAE,MACZC,IAAUA,KAAWE,MAASR,EAAG;AAAA;AAErC,MAAI,aAAaK,GAAG;AAChB,UAAMI,IAAUT,EAAG;AACnB,IAAAA,EAAG,UAAUK,EAAE,SACfC,IAAUA,KAAWG,MAAYT,EAAG;AAAA;AAExC,MAAI,WAAWK,GAAG;AACd,UAAMK,IAAQV,EAAG;AACjB,IAAAA,EAAG,QAAQK,EAAE,OACbC,IAAUA,KAAWI,MAAUV,EAAG;AAAA;AAEtC,SAAIK,EAAE,WAAW,CAACL,EAAG,eAAeK,EAAE,OAAO,MACzCC,IAAU,IACVN,EAAG,UAAUK,EAAE,UAEZC;AACX;","x_google_ignoreList":[0]}
@@ -1,26 +0,0 @@
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
- }
23
- export {
24
- c as normalizeStyle
25
- };
26
- //# sourceMappingURL=main.js28.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"main.js28.mjs","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;AACD,WAAO;AAQX,MANI,OAAOA,KAAU,aAGjB,UAAUA,MACVA,IAAQA,EAAM,SAEd,CAACA,EAAM;AACP,WAAOA;AAEX,QAAMC,IAAa,CAAA;AACnB,aAAWC,KAASF,EAAM;AACtB,IAAAC,EAAWC,EAAM,EAAE,IAAIA;AAE3B,QAAMC,IAASH,EAAM,OAAO,IAAI,CAAAE,MAAS;AACrC,QAAIE,IAAkB;AACtB,IAAI,iBAAiBF,MACjBE,IAAkB,OAAO,OAAO,CAAE,GAAEF,CAAK,GAGzC,OAAOE,EAAgB;AAI3B,UAAMC,IAAWJ,EAAWC,EAAM,GAAG;AACrC,QAAIG,GAAU;AACV,MAAAD,IAAkBA,KAAmB,OAAO,OAAO,CAAE,GAAEF,CAAK,GAE5D,OAAOE,EAAgB;AAEvB,iBAAWE,KAAYR;AACnB,QAAIQ,KAAYD,MACZD,EAAgBE,CAAQ,IAAID,EAASC,CAAQ;AAAA;AAIzD,WAAOF,KAAmBF;AAAA,EAClC,CAAK;AAED,SAAO,EAAE,GAAGF,GAAO,QAAAG;AACvB;","x_google_ignoreList":[0]}
@@ -1,58 +0,0 @@
1
- import * as l from "react";
2
- import { useContext as b, useState as E, useRef as c, useEffect as x, useImperativeHandle as y, useMemo as w } from "react";
3
- import { MountedMapsContext as L } from "./main.js16.mjs";
4
- import m from "./main.js19.mjs";
5
- import I from "./main.js20.mjs";
6
- import C from "./main.js21.mjs";
7
- import g from "./main.js22.mjs";
8
- const R = l.createContext(null);
9
- function A(e, f, d) {
10
- const o = b(L), [i, p] = E(null), s = c(), { current: a } = c({ mapLib: null, map: null });
11
- x(() => {
12
- const v = e.mapLib;
13
- let u = !0, n;
14
- return Promise.resolve(v || d).then((r) => {
15
- if (!u)
16
- return;
17
- if (!r)
18
- throw new Error("Invalid mapLib");
19
- const t = "Map" in r ? r : r.default;
20
- if (!t.Map)
21
- throw new Error("Invalid mapLib");
22
- if (g(t, e), !t.supported || t.supported(e))
23
- e.reuseMaps && (n = m.reuse(e, s.current)), n || (n = new m(t.Map, e, s.current)), a.map = I(n), a.mapLib = t, p(n), o == null || o.onMapMount(a.map, e.id);
24
- else
25
- throw new Error("Map is not supported by this browser");
26
- }).catch((r) => {
27
- const { onError: t } = e;
28
- t ? t({
29
- type: "error",
30
- target: null,
31
- originalEvent: null,
32
- error: r
33
- }) : console.error(r);
34
- }), () => {
35
- u = !1, n && (o == null || o.onMapUnmount(e.id), e.reuseMaps ? n.recycle() : n.destroy());
36
- };
37
- }, []), C(() => {
38
- i && i.setProps(e);
39
- }), y(f, () => a.map, [i]);
40
- const M = w(() => ({
41
- position: "relative",
42
- width: "100%",
43
- height: "100%",
44
- ...e.style
45
- }), [e.style]), h = {
46
- height: "100%"
47
- };
48
- return l.createElement("div", { id: e.id, ref: s, style: M }, i && l.createElement(
49
- R.Provider,
50
- { value: a },
51
- l.createElement("div", { "mapboxgl-children": "", style: h }, e.children)
52
- ));
53
- }
54
- export {
55
- R as MapContext,
56
- A as default
57
- };
58
- //# sourceMappingURL=main.js8.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"main.js8.mjs","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":";;;;;;;AAOY,MAACA,IAAaC,EAAM,cAAc,IAAI;AACnC,SAASC,EAAIC,GAAOC,GAAKC,GAAY;AAChD,QAAMC,IAAqBC,EAAWC,CAAkB,GAClD,CAACC,GAAaC,CAAc,IAAIC,EAAS,IAAI,GAC7CC,IAAeC,KACf,EAAE,SAASC,EAAY,IAAKD,EAAO,EAAE,QAAQ,MAAM,KAAK,KAAI,CAAE;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;AACD,cAAM,IAAI,MAAM,gBAAgB;AAEpC,YAAMC,IAAW,SAASD,IAASA,IAASA,EAAO;AACnD,UAAI,CAACC,EAAS;AACV,cAAM,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,IAEjEE,EAAa,MAAMS,EAAUL,CAAM,GACnCJ,EAAa,SAASM,GACtBV,EAAeQ,CAAM,GACrBZ,KAAuB,QAAiDA,EAAmB,WAAWQ,EAAa,KAAKX,EAAM,EAAE;AAAA;AAGhI,cAAM,IAAI,MAAM,sCAAsC;AAAA,IAEtE,CAAS,EACI,MAAM,CAAAqB,MAAS;AAChB,YAAM,EAAE,SAAAC,EAAS,IAAGtB;AACpB,MAAIsB,IACAA,EAAQ;AAAA,QACJ,MAAM;AAAA,QACN,QAAQ;AAAA,QACR,eAAe;AAAA,QACf,OAAAD;AAAA,MACpB,CAAiB,IAGD,QAAQ,MAAMA,CAAK;AAAA,IAEnC,CAAS,GACM,MAAM;AACT,MAAAP,IAAY,IACRC,MACAZ,KAAuB,QAAiDA,EAAmB,aAAaH,EAAM,EAAE,GAC5GA,EAAM,YACNe,EAAO,QAAO,IAGdA,EAAO,QAAO;AAAA,IAGlC;AAAA,EACK,GAAE,CAAE,CAAA,GACLQ,EAA0B,MAAM;AAC5B,IAAIjB,KACAA,EAAY,SAASN,CAAK;AAAA,EAEtC,CAAK,GACDwB,EAAoBvB,GAAK,MAAMU,EAAa,KAAK,CAACL,CAAW,CAAC;AAC9D,QAAMmB,IAAQC,EAAQ,OAAO;AAAA,IACzB,UAAU;AAAA,IACV,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,GAAG1B,EAAM;AAAA,EACZ,IAAG,CAACA,EAAM,KAAK,CAAC,GACX2B,IAAwB;AAAA,IAC1B,QAAQ;AAAA,EAChB;AACI,SAAQ7B,EAAM,cAAc,OAAO,EAAE,IAAIE,EAAM,IAAI,KAAKS,GAAc,OAAOgB,EAAO,GAAEnB,KAAgBR,EAAM;AAAA,IAAcD,EAAW;AAAA,IAAU,EAAE,OAAOc,EAAc;AAAA,IAClKb,EAAM,cAAc,OAAO,EAAE,qBAAqB,IAAI,OAAO6B,EAAuB,GAAE3B,EAAM,QAAQ;AAAA,EAAC,CAAE;AAC/G;","x_google_ignoreList":[0]}
@@ -1,49 +0,0 @@
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 "./main.js23.mjs";
5
- import { MapContext as O } from "./main.js8.mjs";
6
- import { arePointsEqual as S } from "./main.js24.mjs";
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());
47
- }
48
- A(P(q));
49
- //# sourceMappingURL=main.js9.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"main.js9.mjs","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":"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","x_google_ignoreList":[0]}