@performant-software/geospatial 3.1.6 → 3.1.7-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs14.js +1 -1
- package/dist/index.cjs15.js +1 -1
- package/dist/index.cjs16.js +1 -1
- package/dist/index.cjs17.js +1 -1
- package/dist/index.cjs18.js +1 -1
- package/dist/index.cjs186.js +1 -1
- package/dist/index.cjs186.js.map +1 -1
- package/dist/index.cjs187.js +1 -1
- package/dist/index.cjs187.js.map +1 -1
- package/dist/index.cjs188.js +1 -1
- package/dist/index.cjs188.js.map +1 -1
- package/dist/index.cjs189.js +1 -1
- package/dist/index.cjs189.js.map +1 -1
- package/dist/index.cjs19.js +1 -1
- package/dist/index.cjs190.js +1 -1
- package/dist/index.cjs190.js.map +1 -1
- package/dist/index.cjs191.js +1 -1
- package/dist/index.cjs191.js.map +1 -1
- package/dist/index.cjs192.js +1 -1
- package/dist/index.cjs192.js.map +1 -1
- package/dist/index.cjs193.js +1 -1
- package/dist/index.cjs193.js.map +1 -1
- package/dist/index.cjs194.js +1 -1
- package/dist/index.cjs194.js.map +1 -1
- package/dist/index.cjs195.js +1 -1
- package/dist/index.cjs195.js.map +1 -1
- package/dist/index.cjs196.js +1 -1
- package/dist/index.cjs196.js.map +1 -1
- package/dist/index.cjs197.js +1 -1
- package/dist/index.cjs197.js.map +1 -1
- package/dist/index.cjs198.js +1 -1
- package/dist/index.cjs198.js.map +1 -1
- package/dist/index.cjs199.js +1 -1
- package/dist/index.cjs199.js.map +1 -1
- package/dist/index.cjs20.js +1 -1
- package/dist/index.cjs200.js +1 -1
- package/dist/index.cjs200.js.map +1 -1
- package/dist/index.cjs201.js +1 -1
- package/dist/index.cjs201.js.map +1 -1
- package/dist/index.cjs202.js +1 -1
- package/dist/index.cjs202.js.map +1 -1
- package/dist/index.cjs203.js +1 -1
- package/dist/index.cjs203.js.map +1 -1
- package/dist/index.cjs204.js +1 -1
- package/dist/index.cjs204.js.map +1 -1
- package/dist/index.cjs205.js +1 -1
- package/dist/index.cjs205.js.map +1 -1
- package/dist/index.cjs206.js +1 -1
- package/dist/index.cjs206.js.map +1 -1
- package/dist/index.cjs207.js +1 -1
- package/dist/index.cjs207.js.map +1 -1
- package/dist/index.cjs208.js +1 -1
- package/dist/index.cjs208.js.map +1 -1
- package/dist/index.cjs21.js +1 -1
- package/dist/index.cjs22.js +1 -1
- package/dist/index.cjs23.js +1 -1
- package/dist/index.cjs236.js +1 -7
- package/dist/index.cjs236.js.map +1 -1
- package/dist/index.cjs237.js +1 -1
- package/dist/index.cjs237.js.map +1 -1
- package/dist/index.cjs238.js +7 -1
- package/dist/index.cjs238.js.map +1 -1
- package/dist/index.cjs239.js +1 -1
- package/dist/index.cjs239.js.map +1 -1
- package/dist/index.cjs24.js +1 -1
- package/dist/index.cjs244.js +1 -1
- package/dist/index.cjs247.js +1 -1
- package/dist/index.cjs253.js +1 -1
- package/dist/index.cjs259.js +1 -1
- package/dist/index.cjs264.js +1 -1
- package/dist/index.cjs27.js +1 -1
- package/dist/index.cjs28.js +1 -1
- package/dist/index.cjs29.js +1 -1
- package/dist/index.cjs31.js +1 -1
- package/dist/index.cjs68.js +1 -1
- package/dist/index.cjs70.js +1 -1
- package/dist/index.cjs71.js +1 -1
- package/dist/index.cjs71.js.map +1 -1
- package/dist/index.cjs72.js +1 -1
- package/dist/index.cjs73.js +1 -9
- package/dist/index.cjs73.js.map +1 -1
- package/dist/index.cjs74.js +1 -17
- package/dist/index.cjs74.js.map +1 -1
- package/dist/index.cjs75.js +1 -1
- package/dist/index.cjs75.js.map +1 -1
- package/dist/index.cjs76.js +9 -1
- package/dist/index.cjs76.js.map +1 -1
- package/dist/index.cjs77.js +17 -1
- package/dist/index.cjs77.js.map +1 -1
- package/dist/index.cjs8.js +1 -1
- package/dist/index.cjs8.js.map +1 -1
- package/dist/index.es14.js +2 -2
- package/dist/index.es15.js +4 -4
- package/dist/index.es16.js +3 -3
- package/dist/index.es17.js +3 -3
- package/dist/index.es18.js +1 -1
- package/dist/index.es186.js +239 -144
- package/dist/index.es186.js.map +1 -1
- package/dist/index.es187.js +42 -6
- package/dist/index.es187.js.map +1 -1
- package/dist/index.es188.js +3 -5
- package/dist/index.es188.js.map +1 -1
- package/dist/index.es189.js +13 -3
- package/dist/index.es189.js.map +1 -1
- package/dist/index.es19.js +1 -1
- package/dist/index.es190.js +13 -3
- package/dist/index.es190.js.map +1 -1
- package/dist/index.es191.js +28 -33
- package/dist/index.es191.js.map +1 -1
- package/dist/index.es192.js +16 -3
- package/dist/index.es192.js.map +1 -1
- package/dist/index.es193.js +4 -22
- package/dist/index.es193.js.map +1 -1
- package/dist/index.es194.js +150 -2
- package/dist/index.es194.js.map +1 -1
- package/dist/index.es195.js +9 -3
- package/dist/index.es195.js.map +1 -1
- package/dist/index.es196.js +7 -2
- package/dist/index.es196.js.map +1 -1
- package/dist/index.es197.js +3 -33
- package/dist/index.es197.js.map +1 -1
- package/dist/index.es198.js +2 -14
- package/dist/index.es198.js.map +1 -1
- package/dist/index.es199.js +35 -13
- package/dist/index.es199.js.map +1 -1
- package/dist/index.es20.js +1 -1
- package/dist/index.es200.js +3 -11
- package/dist/index.es200.js.map +1 -1
- package/dist/index.es201.js +22 -242
- package/dist/index.es201.js.map +1 -1
- package/dist/index.es202.js +2 -45
- package/dist/index.es202.js.map +1 -1
- package/dist/index.es203.js +3 -5
- package/dist/index.es203.js.map +1 -1
- package/dist/index.es204.js +2 -13
- package/dist/index.es204.js.map +1 -1
- package/dist/index.es205.js +30 -10
- package/dist/index.es205.js.map +1 -1
- package/dist/index.es206.js +13 -31
- package/dist/index.es206.js.map +1 -1
- package/dist/index.es207.js +13 -13
- package/dist/index.es207.js.map +1 -1
- package/dist/index.es208.js +8 -4
- package/dist/index.es208.js.map +1 -1
- package/dist/index.es21.js +1 -1
- package/dist/index.es22.js +1 -1
- package/dist/index.es23.js +1 -1
- package/dist/index.es236.js +20 -7506
- package/dist/index.es236.js.map +1 -1
- package/dist/index.es237.js +23 -2
- package/dist/index.es237.js.map +1 -1
- package/dist/index.es238.js +7506 -20
- package/dist/index.es238.js.map +1 -1
- package/dist/index.es239.js +2 -23
- package/dist/index.es239.js.map +1 -1
- package/dist/index.es24.js +1 -1
- package/dist/index.es244.js +1 -1
- package/dist/index.es247.js +1 -1
- package/dist/index.es253.js +2 -2
- package/dist/index.es259.js +1 -1
- package/dist/index.es264.js +2 -2
- package/dist/index.es27.js +1 -1
- package/dist/index.es28.js +2 -2
- package/dist/index.es29.js +2 -2
- package/dist/index.es31.js +1 -1
- package/dist/index.es68.js +1 -1
- package/dist/index.es70.js +12 -12
- package/dist/index.es71.js +1992 -7
- package/dist/index.es71.js.map +1 -1
- package/dist/index.es72.js +6 -2
- package/dist/index.es72.js.map +1 -1
- package/dist/index.es73.js +2 -26
- package/dist/index.es73.js.map +1 -1
- package/dist/index.es74.js +7 -588
- package/dist/index.es74.js.map +1 -1
- package/dist/index.es75.js +2 -1993
- package/dist/index.es75.js.map +1 -1
- package/dist/index.es76.js +25 -5
- package/dist/index.es76.js.map +1 -1
- package/dist/index.es77.js +589 -2
- package/dist/index.es77.js.map +1 -1
- package/dist/index.es8.js +44 -42
- package/dist/index.es8.js.map +1 -1
- package/package.json +1 -1
- package/src/components/MapDraw.js +14 -1
- package/types/components/MapDraw.js.flow +14 -1
package/dist/index.es189.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es189.js","sources":["../../../node_modules/
|
|
1
|
+
{"version":3,"file":"index.es189.js","sources":["../../../node_modules/@vis.gl/react-maplibre/dist/utils/set-globals.js"],"sourcesContent":["export default function setGlobals(mapLib, props) {\n const { RTLTextPlugin, maxParallelImageRequests, workerCount, workerUrl } = props;\n if (RTLTextPlugin &&\n mapLib.getRTLTextPluginStatus &&\n mapLib.getRTLTextPluginStatus() === 'unavailable') {\n const { pluginUrl, lazy = true } = typeof RTLTextPlugin === 'string' ? { pluginUrl: RTLTextPlugin } : RTLTextPlugin;\n mapLib.setRTLTextPlugin(pluginUrl, (error) => {\n if (error) {\n // eslint-disable-next-line\n console.error(error);\n }\n }, lazy);\n }\n if (maxParallelImageRequests !== undefined) {\n mapLib.setMaxParallelImageRequests(maxParallelImageRequests);\n }\n if (workerCount !== undefined) {\n mapLib.setWorkerCount(workerCount);\n }\n if (workerUrl !== undefined) {\n mapLib.setWorkerUrl(workerUrl);\n }\n}\n//# sourceMappingURL=set-globals.js.map"],"names":["setGlobals","mapLib","props","RTLTextPlugin","maxParallelImageRequests","workerCount","workerUrl","pluginUrl","lazy","error"],"mappings":"AAAA,SAAwBA,EAAWC,GAAQC,GAAO;AAC9C,QAAM,EAAE,eAAAC,GAAe,0BAAAC,GAA0B,aAAAC,GAAa,WAAAC,MAAcJ;AAC5E,MAAIC,KACAF,EAAO,0BACPA,EAAO,uBAAA,MAA6B,eAAe;AACnD,UAAM,EAAE,WAAAM,GAAW,MAAAC,IAAO,OAAS,OAAOL,KAAkB,WAAW,EAAE,WAAWA,EAAA,IAAkBA;AACtG,IAAAF,EAAO,iBAAiBM,GAAW,CAACE,MAAU;AAC1C,MAAIA,KAEA,QAAQ,MAAMA,CAAK;AAAA,IAE3B,GAAGD,CAAI;AAAA,EACX;AACA,EAAIJ,MAA6B,UAC7BH,EAAO,4BAA4BG,CAAwB,GAE3DC,MAAgB,UAChBJ,EAAO,eAAeI,CAAW,GAEjCC,MAAc,UACdL,EAAO,aAAaK,CAAS;AAErC;","x_google_ignoreList":[0]}
|
package/dist/index.es19.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { memo as e, useEffect as l } from "react";
|
|
2
|
-
import { applyReactStyle as r } from "./index.
|
|
2
|
+
import { applyReactStyle as r } from "./index.es190.js";
|
|
3
3
|
import { useControl as c } from "./index.es25.js";
|
|
4
4
|
function i(t) {
|
|
5
5
|
const n = c(({ mapLib: o }) => new o.FullscreenControl({
|
package/dist/index.es190.js
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
+
};
|
|
4
14
|
//# sourceMappingURL=index.es190.js.map
|
package/dist/index.es190.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es190.js","sources":["../../../node_modules/
|
|
1
|
+
{"version":3,"file":"index.es190.js","sources":["../../../node_modules/@vis.gl/react-maplibre/dist/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,CAAK,OAGrBF,EAAMC,CAAG,IAAIC;AAAA,EAErB;AACJ;","x_google_ignoreList":[0]}
|
package/dist/index.es191.js
CHANGED
|
@@ -1,39 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
return [r > z ? r - p : r < -z ? r + p : r, n];
|
|
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;
|
|
5
4
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
27
|
}
|
|
28
|
-
return
|
|
29
|
-
var f = i(c), s = i(u) * f, e = t(u) * f, v = t(c), D = v * y - e * k;
|
|
30
|
-
return [
|
|
31
|
-
I(e * y + v * k, s * o + D * x),
|
|
32
|
-
P(D * o - s * x)
|
|
33
|
-
];
|
|
34
|
-
}, w;
|
|
28
|
+
return !1;
|
|
35
29
|
}
|
|
36
30
|
export {
|
|
37
|
-
|
|
31
|
+
i as arePointsEqual,
|
|
32
|
+
y as deepEqual
|
|
38
33
|
};
|
|
39
34
|
//# sourceMappingURL=index.es191.js.map
|
package/dist/index.es191.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es191.js","sources":["../../../node_modules/
|
|
1
|
+
{"version":3,"file":"index.es191.js","sources":["../../../node_modules/@vis.gl/react-maplibre/dist/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,EACX,WACS,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,EACX;AACA,SAAO;AACX;","x_google_ignoreList":[0]}
|
package/dist/index.es192.js
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
function c(t, o) {
|
|
2
|
+
if (t === o)
|
|
3
|
+
return null;
|
|
4
|
+
const f = r(t), i = r(o), n = [];
|
|
5
|
+
for (const s of i)
|
|
6
|
+
f.has(s) || n.push(s);
|
|
7
|
+
for (const s of f)
|
|
8
|
+
i.has(s) || n.push(s);
|
|
9
|
+
return n.length === 0 ? null : n;
|
|
10
|
+
}
|
|
11
|
+
function r(t) {
|
|
12
|
+
return new Set(t ? t.trim().split(/\s+/) : []);
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
c as compareClassNames
|
|
16
|
+
};
|
|
4
17
|
//# sourceMappingURL=index.es192.js.map
|
package/dist/index.es192.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es192.js","sources":["../../../node_modules/
|
|
1
|
+
{"version":3,"file":"index.es192.js","sources":["../../../node_modules/@vis.gl/react-maplibre/dist/utils/compare-class-names.js"],"sourcesContent":["/** Compare two classNames string and return the difference */\nexport function compareClassNames(prevClassName, nextClassName) {\n if (prevClassName === nextClassName) {\n return null;\n }\n const prevClassList = getClassList(prevClassName);\n const nextClassList = getClassList(nextClassName);\n const diff = [];\n for (const c of nextClassList) {\n if (!prevClassList.has(c)) {\n diff.push(c);\n }\n }\n for (const c of prevClassList) {\n if (!nextClassList.has(c)) {\n diff.push(c);\n }\n }\n return diff.length === 0 ? null : diff;\n}\nfunction getClassList(className) {\n return new Set(className ? className.trim().split(/\\s+/) : []);\n}\n//# sourceMappingURL=compare-class-names.js.map"],"names":["compareClassNames","prevClassName","nextClassName","prevClassList","getClassList","nextClassList","diff","c","className"],"mappings":"AACO,SAASA,EAAkBC,GAAeC,GAAe;AAC5D,MAAID,MAAkBC;AAClB,WAAO;AAEX,QAAMC,IAAgBC,EAAaH,CAAa,GAC1CI,IAAgBD,EAAaF,CAAa,GAC1CI,IAAO,CAAA;AACb,aAAWC,KAAKF;AACZ,IAAKF,EAAc,IAAII,CAAC,KACpBD,EAAK,KAAKC,CAAC;AAGnB,aAAWA,KAAKJ;AACZ,IAAKE,EAAc,IAAIE,CAAC,KACpBD,EAAK,KAAKC,CAAC;AAGnB,SAAOD,EAAK,WAAW,IAAI,OAAOA;AACtC;AACA,SAASF,EAAaI,GAAW;AAC7B,SAAO,IAAI,IAAIA,IAAYA,EAAU,KAAA,EAAO,MAAM,KAAK,IAAI,EAAE;AACjE;","x_google_ignoreList":[0]}
|
package/dist/index.es193.js
CHANGED
|
@@ -1,26 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var n = Y();
|
|
5
|
-
function l(y, B) {
|
|
6
|
-
var f = B[0], E = B[1], W = [e(f), -s(f), 0], C = 0, F = 0;
|
|
7
|
-
n.reset();
|
|
8
|
-
for (var m = 0, X = y.length; m < X; ++m)
|
|
9
|
-
if (w = (q = y[m]).length)
|
|
10
|
-
for (var q, w, v = q[w - 1], x = v[0], G = v[1] / 2 + V, H = e(G), J = s(G), z = 0; z < w; ++z, x = I, H = L, J = M, v = o) {
|
|
11
|
-
var o = q[z], I = o[0], K = o[1] / 2 + V, L = e(K), M = s(K), r = I - x, N = r >= 0 ? 1 : -1, c = N * r, u = c > $, O = H * L;
|
|
12
|
-
if (n.add(Z(O * N * e(c), J * M + O * s(c))), C += u ? r + N * k : r, u ^ x >= f ^ I >= f) {
|
|
13
|
-
var a = S(T(v), T(o));
|
|
14
|
-
U(a);
|
|
15
|
-
var Q = S(W, a);
|
|
16
|
-
U(Q);
|
|
17
|
-
var R = (u ^ r >= 0 ? -1 : 1) * _(Q[2]);
|
|
18
|
-
(E > R || E === R && (a[0] || a[1])) && (F += u ^ r >= 0 ? 1 : -1);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return (C < -g || C < g && n < -g) ^ F & 1;
|
|
1
|
+
function e(r, t) {
|
|
2
|
+
if (!r)
|
|
3
|
+
throw new Error(t);
|
|
22
4
|
}
|
|
23
5
|
export {
|
|
24
|
-
|
|
6
|
+
e as default
|
|
25
7
|
};
|
|
26
8
|
//# sourceMappingURL=index.es193.js.map
|
package/dist/index.es193.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es193.js","sources":["../../../node_modules/
|
|
1
|
+
{"version":3,"file":"index.es193.js","sources":["../../../node_modules/@vis.gl/react-maplibre/dist/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":"AAAA,SAAwBA,EAAOC,GAAWC,GAAS;AAC/C,MAAI,CAACD;AACD,UAAM,IAAI,MAAMC,CAAO;AAE/B;","x_google_ignoreList":[0]}
|
package/dist/index.es194.js
CHANGED
|
@@ -1,3 +1,151 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
function b(e, o, f) {
|
|
2
|
+
if (e !== null)
|
|
3
|
+
for (var r, i, a, u, c, t, s, y = 0, l = 0, h, p = e.type, C = p === "FeatureCollection", G = p === "Feature", w = C ? e.features.length : 1, P = 0; P < w; P++) {
|
|
4
|
+
s = C ? e.features[P].geometry : G ? e.geometry : e, h = s ? s.type === "GeometryCollection" : !1, c = h ? s.geometries.length : 1;
|
|
5
|
+
for (var M = 0; M < c; M++) {
|
|
6
|
+
var n = 0, g = 0;
|
|
7
|
+
if (u = h ? s.geometries[M] : s, u !== null) {
|
|
8
|
+
t = u.coordinates;
|
|
9
|
+
var v = u.type;
|
|
10
|
+
switch (y = 0, v) {
|
|
11
|
+
case null:
|
|
12
|
+
break;
|
|
13
|
+
case "Point":
|
|
14
|
+
if (o(
|
|
15
|
+
t,
|
|
16
|
+
l,
|
|
17
|
+
P,
|
|
18
|
+
n,
|
|
19
|
+
g
|
|
20
|
+
) === !1)
|
|
21
|
+
return !1;
|
|
22
|
+
l++, n++;
|
|
23
|
+
break;
|
|
24
|
+
case "LineString":
|
|
25
|
+
case "MultiPoint":
|
|
26
|
+
for (r = 0; r < t.length; r++) {
|
|
27
|
+
if (o(
|
|
28
|
+
t[r],
|
|
29
|
+
l,
|
|
30
|
+
P,
|
|
31
|
+
n,
|
|
32
|
+
g
|
|
33
|
+
) === !1)
|
|
34
|
+
return !1;
|
|
35
|
+
l++, v === "MultiPoint" && n++;
|
|
36
|
+
}
|
|
37
|
+
v === "LineString" && n++;
|
|
38
|
+
break;
|
|
39
|
+
case "Polygon":
|
|
40
|
+
case "MultiLineString":
|
|
41
|
+
for (r = 0; r < t.length; r++) {
|
|
42
|
+
for (i = 0; i < t[r].length - y; i++) {
|
|
43
|
+
if (o(
|
|
44
|
+
t[r][i],
|
|
45
|
+
l,
|
|
46
|
+
P,
|
|
47
|
+
n,
|
|
48
|
+
g
|
|
49
|
+
) === !1)
|
|
50
|
+
return !1;
|
|
51
|
+
l++;
|
|
52
|
+
}
|
|
53
|
+
v === "MultiLineString" && n++, v === "Polygon" && g++;
|
|
54
|
+
}
|
|
55
|
+
v === "Polygon" && n++;
|
|
56
|
+
break;
|
|
57
|
+
case "MultiPolygon":
|
|
58
|
+
for (r = 0; r < t.length; r++) {
|
|
59
|
+
for (g = 0, i = 0; i < t[r].length; i++) {
|
|
60
|
+
for (a = 0; a < t[r][i].length - y; a++) {
|
|
61
|
+
if (o(
|
|
62
|
+
t[r][i][a],
|
|
63
|
+
l,
|
|
64
|
+
P,
|
|
65
|
+
n,
|
|
66
|
+
g
|
|
67
|
+
) === !1)
|
|
68
|
+
return !1;
|
|
69
|
+
l++;
|
|
70
|
+
}
|
|
71
|
+
g++;
|
|
72
|
+
}
|
|
73
|
+
n++;
|
|
74
|
+
}
|
|
75
|
+
break;
|
|
76
|
+
case "GeometryCollection":
|
|
77
|
+
for (r = 0; r < u.geometries.length; r++)
|
|
78
|
+
if (b(u.geometries[r], o) === !1)
|
|
79
|
+
return !1;
|
|
80
|
+
break;
|
|
81
|
+
default:
|
|
82
|
+
throw new Error("Unknown Geometry Type");
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function S(e, o) {
|
|
89
|
+
if (e.type === "Feature")
|
|
90
|
+
o(e, 0);
|
|
91
|
+
else if (e.type === "FeatureCollection")
|
|
92
|
+
for (var f = 0; f < e.features.length && o(e.features[f], f) !== !1; f++)
|
|
93
|
+
;
|
|
94
|
+
}
|
|
95
|
+
function k(e, o) {
|
|
96
|
+
var f, r, i, a, u, c, t, s, y, l, h = 0, p = e.type === "FeatureCollection", C = e.type === "Feature", G = p ? e.features.length : 1;
|
|
97
|
+
for (f = 0; f < G; f++) {
|
|
98
|
+
for (c = p ? e.features[f].geometry : C ? e.geometry : e, s = p ? e.features[f].properties : C ? e.properties : {}, y = p ? e.features[f].bbox : C ? e.bbox : void 0, l = p ? e.features[f].id : C ? e.id : void 0, t = c ? c.type === "GeometryCollection" : !1, u = t ? c.geometries.length : 1, i = 0; i < u; i++) {
|
|
99
|
+
if (a = t ? c.geometries[i] : c, a === null) {
|
|
100
|
+
if (o(
|
|
101
|
+
null,
|
|
102
|
+
h,
|
|
103
|
+
s,
|
|
104
|
+
y,
|
|
105
|
+
l
|
|
106
|
+
) === !1)
|
|
107
|
+
return !1;
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
switch (a.type) {
|
|
111
|
+
case "Point":
|
|
112
|
+
case "LineString":
|
|
113
|
+
case "MultiPoint":
|
|
114
|
+
case "Polygon":
|
|
115
|
+
case "MultiLineString":
|
|
116
|
+
case "MultiPolygon": {
|
|
117
|
+
if (o(
|
|
118
|
+
a,
|
|
119
|
+
h,
|
|
120
|
+
s,
|
|
121
|
+
y,
|
|
122
|
+
l
|
|
123
|
+
) === !1)
|
|
124
|
+
return !1;
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
case "GeometryCollection": {
|
|
128
|
+
for (r = 0; r < a.geometries.length; r++)
|
|
129
|
+
if (o(
|
|
130
|
+
a.geometries[r],
|
|
131
|
+
h,
|
|
132
|
+
s,
|
|
133
|
+
y,
|
|
134
|
+
l
|
|
135
|
+
) === !1)
|
|
136
|
+
return !1;
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
default:
|
|
140
|
+
throw new Error("Unknown Geometry Type");
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
h++;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
export {
|
|
147
|
+
b as coordEach,
|
|
148
|
+
S as featureEach,
|
|
149
|
+
k as geomEach
|
|
150
|
+
};
|
|
3
151
|
//# sourceMappingURL=index.es194.js.map
|
package/dist/index.es194.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es194.js","sources":["../../../node_modules/d3-geo/src/length.js"],"sourcesContent":["import adder from \"./adder\";\nimport {abs, atan2, cos, radians, sin, sqrt} from \"./math\";\nimport noop from \"./noop\";\nimport stream from \"./stream\";\n\nvar lengthSum = adder(),\n lambda0,\n sinPhi0,\n cosPhi0;\n\nvar lengthStream = {\n sphere: noop,\n point: noop,\n lineStart: lengthLineStart,\n lineEnd: noop,\n polygonStart: noop,\n polygonEnd: noop\n};\n\nfunction lengthLineStart() {\n lengthStream.point = lengthPointFirst;\n lengthStream.lineEnd = lengthLineEnd;\n}\n\nfunction lengthLineEnd() {\n lengthStream.point = lengthStream.lineEnd = noop;\n}\n\nfunction lengthPointFirst(lambda, phi) {\n lambda *= radians, phi *= radians;\n lambda0 = lambda, sinPhi0 = sin(phi), cosPhi0 = cos(phi);\n lengthStream.point = lengthPoint;\n}\n\nfunction lengthPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var sinPhi = sin(phi),\n cosPhi = cos(phi),\n delta = abs(lambda - lambda0),\n cosDelta = cos(delta),\n sinDelta = sin(delta),\n x = cosPhi * sinDelta,\n y = cosPhi0 * sinPhi - sinPhi0 * cosPhi * cosDelta,\n z = sinPhi0 * sinPhi + cosPhi0 * cosPhi * cosDelta;\n lengthSum.add(atan2(sqrt(x * x + y * y), z));\n lambda0 = lambda, sinPhi0 = sinPhi, cosPhi0 = cosPhi;\n}\n\nexport default function(object) {\n lengthSum.reset();\n stream(object, lengthStream);\n return +lengthSum;\n}\n"],"names":["adder"],"mappings":";AAKgBA,EAAA;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index.es194.js","sources":["../../../node_modules/@turf/meta/dist/esm/index.js"],"sourcesContent":["// index.js\nimport { feature, point, lineString, isObject } from \"@turf/helpers\";\nfunction coordEach(geojson, callback, excludeWrapCoord) {\n if (geojson === null) return;\n var j, k, l, geometry, stopG, coords, geometryMaybeCollection, wrapShrink = 0, coordIndex = 0, isGeometryCollection, type = geojson.type, isFeatureCollection = type === \"FeatureCollection\", isFeature = type === \"Feature\", stop = isFeatureCollection ? geojson.features.length : 1;\n for (var featureIndex = 0; featureIndex < stop; featureIndex++) {\n geometryMaybeCollection = isFeatureCollection ? geojson.features[featureIndex].geometry : isFeature ? geojson.geometry : geojson;\n isGeometryCollection = geometryMaybeCollection ? geometryMaybeCollection.type === \"GeometryCollection\" : false;\n stopG = isGeometryCollection ? geometryMaybeCollection.geometries.length : 1;\n for (var geomIndex = 0; geomIndex < stopG; geomIndex++) {\n var multiFeatureIndex = 0;\n var geometryIndex = 0;\n geometry = isGeometryCollection ? geometryMaybeCollection.geometries[geomIndex] : geometryMaybeCollection;\n if (geometry === null) continue;\n coords = geometry.coordinates;\n var geomType = geometry.type;\n wrapShrink = excludeWrapCoord && (geomType === \"Polygon\" || geomType === \"MultiPolygon\") ? 1 : 0;\n switch (geomType) {\n case null:\n break;\n case \"Point\":\n if (callback(\n coords,\n coordIndex,\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n ) === false)\n return false;\n coordIndex++;\n multiFeatureIndex++;\n break;\n case \"LineString\":\n case \"MultiPoint\":\n for (j = 0; j < coords.length; j++) {\n if (callback(\n coords[j],\n coordIndex,\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n ) === false)\n return false;\n coordIndex++;\n if (geomType === \"MultiPoint\") multiFeatureIndex++;\n }\n if (geomType === \"LineString\") multiFeatureIndex++;\n break;\n case \"Polygon\":\n case \"MultiLineString\":\n for (j = 0; j < coords.length; j++) {\n for (k = 0; k < coords[j].length - wrapShrink; k++) {\n if (callback(\n coords[j][k],\n coordIndex,\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n ) === false)\n return false;\n coordIndex++;\n }\n if (geomType === \"MultiLineString\") multiFeatureIndex++;\n if (geomType === \"Polygon\") geometryIndex++;\n }\n if (geomType === \"Polygon\") multiFeatureIndex++;\n break;\n case \"MultiPolygon\":\n for (j = 0; j < coords.length; j++) {\n geometryIndex = 0;\n for (k = 0; k < coords[j].length; k++) {\n for (l = 0; l < coords[j][k].length - wrapShrink; l++) {\n if (callback(\n coords[j][k][l],\n coordIndex,\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n ) === false)\n return false;\n coordIndex++;\n }\n geometryIndex++;\n }\n multiFeatureIndex++;\n }\n break;\n case \"GeometryCollection\":\n for (j = 0; j < geometry.geometries.length; j++)\n if (coordEach(geometry.geometries[j], callback, excludeWrapCoord) === false)\n return false;\n break;\n default:\n throw new Error(\"Unknown Geometry Type\");\n }\n }\n }\n}\nfunction coordReduce(geojson, callback, initialValue, excludeWrapCoord) {\n var previousValue = initialValue;\n coordEach(\n geojson,\n function(currentCoord, coordIndex, featureIndex, multiFeatureIndex, geometryIndex) {\n if (coordIndex === 0 && initialValue === void 0)\n previousValue = currentCoord;\n else\n previousValue = callback(\n previousValue,\n currentCoord,\n coordIndex,\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n );\n },\n excludeWrapCoord\n );\n return previousValue;\n}\nfunction propEach(geojson, callback) {\n var i;\n switch (geojson.type) {\n case \"FeatureCollection\":\n for (i = 0; i < geojson.features.length; i++) {\n if (callback(geojson.features[i].properties, i) === false) break;\n }\n break;\n case \"Feature\":\n callback(geojson.properties, 0);\n break;\n }\n}\nfunction propReduce(geojson, callback, initialValue) {\n var previousValue = initialValue;\n propEach(geojson, function(currentProperties, featureIndex) {\n if (featureIndex === 0 && initialValue === void 0)\n previousValue = currentProperties;\n else\n previousValue = callback(previousValue, currentProperties, featureIndex);\n });\n return previousValue;\n}\nfunction featureEach(geojson, callback) {\n if (geojson.type === \"Feature\") {\n callback(geojson, 0);\n } else if (geojson.type === \"FeatureCollection\") {\n for (var i = 0; i < geojson.features.length; i++) {\n if (callback(geojson.features[i], i) === false) break;\n }\n }\n}\nfunction featureReduce(geojson, callback, initialValue) {\n var previousValue = initialValue;\n featureEach(geojson, function(currentFeature, featureIndex) {\n if (featureIndex === 0 && initialValue === void 0)\n previousValue = currentFeature;\n else previousValue = callback(previousValue, currentFeature, featureIndex);\n });\n return previousValue;\n}\nfunction coordAll(geojson) {\n var coords = [];\n coordEach(geojson, function(coord) {\n coords.push(coord);\n });\n return coords;\n}\nfunction geomEach(geojson, callback) {\n var i, j, g, geometry, stopG, geometryMaybeCollection, isGeometryCollection, featureProperties, featureBBox, featureId, featureIndex = 0, isFeatureCollection = geojson.type === \"FeatureCollection\", isFeature = geojson.type === \"Feature\", stop = isFeatureCollection ? geojson.features.length : 1;\n for (i = 0; i < stop; i++) {\n geometryMaybeCollection = isFeatureCollection ? geojson.features[i].geometry : isFeature ? geojson.geometry : geojson;\n featureProperties = isFeatureCollection ? geojson.features[i].properties : isFeature ? geojson.properties : {};\n featureBBox = isFeatureCollection ? geojson.features[i].bbox : isFeature ? geojson.bbox : void 0;\n featureId = isFeatureCollection ? geojson.features[i].id : isFeature ? geojson.id : void 0;\n isGeometryCollection = geometryMaybeCollection ? geometryMaybeCollection.type === \"GeometryCollection\" : false;\n stopG = isGeometryCollection ? geometryMaybeCollection.geometries.length : 1;\n for (g = 0; g < stopG; g++) {\n geometry = isGeometryCollection ? geometryMaybeCollection.geometries[g] : geometryMaybeCollection;\n if (geometry === null) {\n if (callback(\n null,\n featureIndex,\n featureProperties,\n featureBBox,\n featureId\n ) === false)\n return false;\n continue;\n }\n switch (geometry.type) {\n case \"Point\":\n case \"LineString\":\n case \"MultiPoint\":\n case \"Polygon\":\n case \"MultiLineString\":\n case \"MultiPolygon\": {\n if (callback(\n geometry,\n featureIndex,\n featureProperties,\n featureBBox,\n featureId\n ) === false)\n return false;\n break;\n }\n case \"GeometryCollection\": {\n for (j = 0; j < geometry.geometries.length; j++) {\n if (callback(\n geometry.geometries[j],\n featureIndex,\n featureProperties,\n featureBBox,\n featureId\n ) === false)\n return false;\n }\n break;\n }\n default:\n throw new Error(\"Unknown Geometry Type\");\n }\n }\n featureIndex++;\n }\n}\nfunction geomReduce(geojson, callback, initialValue) {\n var previousValue = initialValue;\n geomEach(\n geojson,\n function(currentGeometry, featureIndex, featureProperties, featureBBox, featureId) {\n if (featureIndex === 0 && initialValue === void 0)\n previousValue = currentGeometry;\n else\n previousValue = callback(\n previousValue,\n currentGeometry,\n featureIndex,\n featureProperties,\n featureBBox,\n featureId\n );\n }\n );\n return previousValue;\n}\nfunction flattenEach(geojson, callback) {\n geomEach(geojson, function(geometry, featureIndex, properties, bbox, id) {\n var type = geometry === null ? null : geometry.type;\n switch (type) {\n case null:\n case \"Point\":\n case \"LineString\":\n case \"Polygon\":\n if (callback(\n feature(geometry, properties, { bbox, id }),\n featureIndex,\n 0\n ) === false)\n return false;\n return;\n }\n var geomType;\n switch (type) {\n case \"MultiPoint\":\n geomType = \"Point\";\n break;\n case \"MultiLineString\":\n geomType = \"LineString\";\n break;\n case \"MultiPolygon\":\n geomType = \"Polygon\";\n break;\n }\n for (var multiFeatureIndex = 0; multiFeatureIndex < geometry.coordinates.length; multiFeatureIndex++) {\n var coordinate = geometry.coordinates[multiFeatureIndex];\n var geom = {\n type: geomType,\n coordinates: coordinate\n };\n if (callback(feature(geom, properties), featureIndex, multiFeatureIndex) === false)\n return false;\n }\n });\n}\nfunction flattenReduce(geojson, callback, initialValue) {\n var previousValue = initialValue;\n flattenEach(\n geojson,\n function(currentFeature, featureIndex, multiFeatureIndex) {\n if (featureIndex === 0 && multiFeatureIndex === 0 && initialValue === void 0)\n previousValue = currentFeature;\n else\n previousValue = callback(\n previousValue,\n currentFeature,\n featureIndex,\n multiFeatureIndex\n );\n }\n );\n return previousValue;\n}\nfunction segmentEach(geojson, callback) {\n flattenEach(geojson, function(feature2, featureIndex, multiFeatureIndex) {\n var segmentIndex = 0;\n if (!feature2.geometry) return;\n var type = feature2.geometry.type;\n if (type === \"Point\" || type === \"MultiPoint\") return;\n var previousCoords;\n var previousFeatureIndex = 0;\n var previousMultiIndex = 0;\n var prevGeomIndex = 0;\n if (coordEach(\n feature2,\n function(currentCoord, coordIndex, featureIndexCoord, multiPartIndexCoord, geometryIndex) {\n if (previousCoords === void 0 || featureIndex > previousFeatureIndex || multiPartIndexCoord > previousMultiIndex || geometryIndex > prevGeomIndex) {\n previousCoords = currentCoord;\n previousFeatureIndex = featureIndex;\n previousMultiIndex = multiPartIndexCoord;\n prevGeomIndex = geometryIndex;\n segmentIndex = 0;\n return;\n }\n var currentSegment = lineString(\n [previousCoords, currentCoord],\n feature2.properties\n );\n if (callback(\n currentSegment,\n featureIndex,\n multiFeatureIndex,\n geometryIndex,\n segmentIndex\n ) === false)\n return false;\n segmentIndex++;\n previousCoords = currentCoord;\n }\n ) === false)\n return false;\n });\n}\nfunction segmentReduce(geojson, callback, initialValue) {\n var previousValue = initialValue;\n var started = false;\n segmentEach(\n geojson,\n function(currentSegment, featureIndex, multiFeatureIndex, geometryIndex, segmentIndex) {\n if (started === false && initialValue === void 0)\n previousValue = currentSegment;\n else\n previousValue = callback(\n previousValue,\n currentSegment,\n featureIndex,\n multiFeatureIndex,\n geometryIndex,\n segmentIndex\n );\n started = true;\n }\n );\n return previousValue;\n}\nfunction lineEach(geojson, callback) {\n if (!geojson) throw new Error(\"geojson is required\");\n flattenEach(geojson, function(feature2, featureIndex, multiFeatureIndex) {\n if (feature2.geometry === null) return;\n var type = feature2.geometry.type;\n var coords = feature2.geometry.coordinates;\n switch (type) {\n case \"LineString\":\n if (callback(feature2, featureIndex, multiFeatureIndex, 0, 0) === false)\n return false;\n break;\n case \"Polygon\":\n for (var geometryIndex = 0; geometryIndex < coords.length; geometryIndex++) {\n if (callback(\n lineString(coords[geometryIndex], feature2.properties),\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n ) === false)\n return false;\n }\n break;\n }\n });\n}\nfunction lineReduce(geojson, callback, initialValue) {\n var previousValue = initialValue;\n lineEach(\n geojson,\n function(currentLine, featureIndex, multiFeatureIndex, geometryIndex) {\n if (featureIndex === 0 && initialValue === void 0)\n previousValue = currentLine;\n else\n previousValue = callback(\n previousValue,\n currentLine,\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n );\n }\n );\n return previousValue;\n}\nfunction findSegment(geojson, options) {\n options = options || {};\n if (!isObject(options)) throw new Error(\"options is invalid\");\n var featureIndex = options.featureIndex || 0;\n var multiFeatureIndex = options.multiFeatureIndex || 0;\n var geometryIndex = options.geometryIndex || 0;\n var segmentIndex = options.segmentIndex || 0;\n var properties = options.properties;\n var geometry;\n switch (geojson.type) {\n case \"FeatureCollection\":\n if (featureIndex < 0)\n featureIndex = geojson.features.length + featureIndex;\n properties = properties || geojson.features[featureIndex].properties;\n geometry = geojson.features[featureIndex].geometry;\n break;\n case \"Feature\":\n properties = properties || geojson.properties;\n geometry = geojson.geometry;\n break;\n case \"Point\":\n case \"MultiPoint\":\n return null;\n case \"LineString\":\n case \"Polygon\":\n case \"MultiLineString\":\n case \"MultiPolygon\":\n geometry = geojson;\n break;\n default:\n throw new Error(\"geojson is invalid\");\n }\n if (geometry === null) return null;\n var coords = geometry.coordinates;\n switch (geometry.type) {\n case \"Point\":\n case \"MultiPoint\":\n return null;\n case \"LineString\":\n if (segmentIndex < 0) segmentIndex = coords.length + segmentIndex - 1;\n return lineString(\n [coords[segmentIndex], coords[segmentIndex + 1]],\n properties,\n options\n );\n case \"Polygon\":\n if (geometryIndex < 0) geometryIndex = coords.length + geometryIndex;\n if (segmentIndex < 0)\n segmentIndex = coords[geometryIndex].length + segmentIndex - 1;\n return lineString(\n [\n coords[geometryIndex][segmentIndex],\n coords[geometryIndex][segmentIndex + 1]\n ],\n properties,\n options\n );\n case \"MultiLineString\":\n if (multiFeatureIndex < 0)\n multiFeatureIndex = coords.length + multiFeatureIndex;\n if (segmentIndex < 0)\n segmentIndex = coords[multiFeatureIndex].length + segmentIndex - 1;\n return lineString(\n [\n coords[multiFeatureIndex][segmentIndex],\n coords[multiFeatureIndex][segmentIndex + 1]\n ],\n properties,\n options\n );\n case \"MultiPolygon\":\n if (multiFeatureIndex < 0)\n multiFeatureIndex = coords.length + multiFeatureIndex;\n if (geometryIndex < 0)\n geometryIndex = coords[multiFeatureIndex].length + geometryIndex;\n if (segmentIndex < 0)\n segmentIndex = coords[multiFeatureIndex][geometryIndex].length - segmentIndex - 1;\n return lineString(\n [\n coords[multiFeatureIndex][geometryIndex][segmentIndex],\n coords[multiFeatureIndex][geometryIndex][segmentIndex + 1]\n ],\n properties,\n options\n );\n }\n throw new Error(\"geojson is invalid\");\n}\nfunction findPoint(geojson, options) {\n options = options || {};\n if (!isObject(options)) throw new Error(\"options is invalid\");\n var featureIndex = options.featureIndex || 0;\n var multiFeatureIndex = options.multiFeatureIndex || 0;\n var geometryIndex = options.geometryIndex || 0;\n var coordIndex = options.coordIndex || 0;\n var properties = options.properties;\n var geometry;\n switch (geojson.type) {\n case \"FeatureCollection\":\n if (featureIndex < 0)\n featureIndex = geojson.features.length + featureIndex;\n properties = properties || geojson.features[featureIndex].properties;\n geometry = geojson.features[featureIndex].geometry;\n break;\n case \"Feature\":\n properties = properties || geojson.properties;\n geometry = geojson.geometry;\n break;\n case \"Point\":\n case \"MultiPoint\":\n return null;\n case \"LineString\":\n case \"Polygon\":\n case \"MultiLineString\":\n case \"MultiPolygon\":\n geometry = geojson;\n break;\n default:\n throw new Error(\"geojson is invalid\");\n }\n if (geometry === null) return null;\n var coords = geometry.coordinates;\n switch (geometry.type) {\n case \"Point\":\n return point(coords, properties, options);\n case \"MultiPoint\":\n if (multiFeatureIndex < 0)\n multiFeatureIndex = coords.length + multiFeatureIndex;\n return point(coords[multiFeatureIndex], properties, options);\n case \"LineString\":\n if (coordIndex < 0) coordIndex = coords.length + coordIndex;\n return point(coords[coordIndex], properties, options);\n case \"Polygon\":\n if (geometryIndex < 0) geometryIndex = coords.length + geometryIndex;\n if (coordIndex < 0)\n coordIndex = coords[geometryIndex].length + coordIndex;\n return point(coords[geometryIndex][coordIndex], properties, options);\n case \"MultiLineString\":\n if (multiFeatureIndex < 0)\n multiFeatureIndex = coords.length + multiFeatureIndex;\n if (coordIndex < 0)\n coordIndex = coords[multiFeatureIndex].length + coordIndex;\n return point(coords[multiFeatureIndex][coordIndex], properties, options);\n case \"MultiPolygon\":\n if (multiFeatureIndex < 0)\n multiFeatureIndex = coords.length + multiFeatureIndex;\n if (geometryIndex < 0)\n geometryIndex = coords[multiFeatureIndex].length + geometryIndex;\n if (coordIndex < 0)\n coordIndex = coords[multiFeatureIndex][geometryIndex].length - coordIndex;\n return point(\n coords[multiFeatureIndex][geometryIndex][coordIndex],\n properties,\n options\n );\n }\n throw new Error(\"geojson is invalid\");\n}\nexport {\n coordAll,\n coordEach,\n coordReduce,\n featureEach,\n featureReduce,\n findPoint,\n findSegment,\n flattenEach,\n flattenReduce,\n geomEach,\n geomReduce,\n lineEach,\n lineReduce,\n propEach,\n propReduce,\n segmentEach,\n segmentReduce\n};\n//# sourceMappingURL=index.js.map"],"names":["coordEach","geojson","callback","excludeWrapCoord","j","k","l","geometry","stopG","coords","geometryMaybeCollection","wrapShrink","coordIndex","isGeometryCollection","type","isFeatureCollection","isFeature","stop","featureIndex","geomIndex","multiFeatureIndex","geometryIndex","geomType","featureEach","i","geomEach","g","featureProperties","featureBBox","featureId"],"mappings":"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","x_google_ignoreList":[0]}
|
package/dist/index.es195.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
r
|
|
1
|
+
import { bbox as c } from "./index.es68.js";
|
|
2
|
+
import { point as p } from "./index.es66.js";
|
|
3
|
+
function x(r, o = {}) {
|
|
4
|
+
const t = c(r), e = (t[0] + t[2]) / 2, n = (t[1] + t[3]) / 2;
|
|
5
|
+
return p([e, n], o.properties, o);
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
x as center
|
|
9
|
+
};
|
|
4
10
|
//# sourceMappingURL=index.es195.js.map
|
package/dist/index.es195.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es195.js","sources":["
|
|
1
|
+
{"version":3,"file":"index.es195.js","sources":["../node_modules/@turf/center/dist/esm/index.js"],"sourcesContent":["// index.ts\nimport { bbox } from \"@turf/bbox\";\nimport { point } from \"@turf/helpers\";\nfunction center(geojson, options = {}) {\n const ext = bbox(geojson);\n const x = (ext[0] + ext[2]) / 2;\n const y = (ext[1] + ext[3]) / 2;\n return point([x, y], options.properties, options);\n}\nvar turf_center_default = center;\nexport {\n center,\n turf_center_default as default\n};\n//# sourceMappingURL=index.js.map"],"names":["center","geojson","options","ext","bbox","x","y","point"],"mappings":";;AAGA,SAASA,EAAOC,GAASC,IAAU,IAAI;AACrC,QAAMC,IAAMC,EAAKH,CAAO,GAClBI,KAAKF,EAAI,CAAC,IAAIA,EAAI,CAAC,KAAK,GACxBG,KAAKH,EAAI,CAAC,IAAIA,EAAI,CAAC,KAAK;AAC9B,SAAOI,EAAM,CAACF,GAAGC,CAAC,GAAGJ,EAAQ,YAAYA,CAAO;AAClD;","x_google_ignoreList":[0]}
|
package/dist/index.es196.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
import r from "./index.
|
|
2
|
-
|
|
1
|
+
import { getDefaultExportFromCjs as r } from "./index.es72.js";
|
|
2
|
+
import { __require as t } from "./index.es238.js";
|
|
3
|
+
var s = t();
|
|
4
|
+
const m = /* @__PURE__ */ r(s);
|
|
5
|
+
export {
|
|
6
|
+
m as default
|
|
7
|
+
};
|
|
3
8
|
//# sourceMappingURL=index.es196.js.map
|
package/dist/index.es196.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es196.js","sources":[
|
|
1
|
+
{"version":3,"file":"index.es196.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
package/dist/index.es197.js
CHANGED
|
@@ -1,34 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
for (var i in t) r[i] = t[i];
|
|
5
|
-
return r.stream = n, r;
|
|
6
|
-
};
|
|
7
|
-
}
|
|
8
|
-
function o() {
|
|
9
|
-
}
|
|
10
|
-
o.prototype = {
|
|
11
|
-
constructor: o,
|
|
12
|
-
point: function(t, n) {
|
|
13
|
-
this.stream.point(t, n);
|
|
14
|
-
},
|
|
15
|
-
sphere: function() {
|
|
16
|
-
this.stream.sphere();
|
|
17
|
-
},
|
|
18
|
-
lineStart: function() {
|
|
19
|
-
this.stream.lineStart();
|
|
20
|
-
},
|
|
21
|
-
lineEnd: function() {
|
|
22
|
-
this.stream.lineEnd();
|
|
23
|
-
},
|
|
24
|
-
polygonStart: function() {
|
|
25
|
-
this.stream.polygonStart();
|
|
26
|
-
},
|
|
27
|
-
polygonEnd: function() {
|
|
28
|
-
this.stream.polygonEnd();
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
export {
|
|
32
|
-
e as transformer
|
|
33
|
-
};
|
|
1
|
+
import r from "./index.es243.js";
|
|
2
|
+
r();
|
|
3
|
+
r();
|
|
34
4
|
//# sourceMappingURL=index.es197.js.map
|
package/dist/index.es197.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es197.js","sources":["../../../node_modules/d3-geo/src/
|
|
1
|
+
{"version":3,"file":"index.es197.js","sources":["../../../node_modules/d3-geo/src/area.js"],"sourcesContent":["import adder from \"./adder\";\nimport {atan2, cos, quarterPi, radians, sin, tau} from \"./math\";\nimport noop from \"./noop\";\nimport stream from \"./stream\";\n\nexport var areaRingSum = adder();\n\nvar areaSum = adder(),\n lambda00,\n phi00,\n lambda0,\n cosPhi0,\n sinPhi0;\n\nexport var areaStream = {\n point: noop,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: function() {\n areaRingSum.reset();\n areaStream.lineStart = areaRingStart;\n areaStream.lineEnd = areaRingEnd;\n },\n polygonEnd: function() {\n var areaRing = +areaRingSum;\n areaSum.add(areaRing < 0 ? tau + areaRing : areaRing);\n this.lineStart = this.lineEnd = this.point = noop;\n },\n sphere: function() {\n areaSum.add(tau);\n }\n};\n\nfunction areaRingStart() {\n areaStream.point = areaPointFirst;\n}\n\nfunction areaRingEnd() {\n areaPoint(lambda00, phi00);\n}\n\nfunction areaPointFirst(lambda, phi) {\n areaStream.point = areaPoint;\n lambda00 = lambda, phi00 = phi;\n lambda *= radians, phi *= radians;\n lambda0 = lambda, cosPhi0 = cos(phi = phi / 2 + quarterPi), sinPhi0 = sin(phi);\n}\n\nfunction areaPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n phi = phi / 2 + quarterPi; // half the angular distance from south pole\n\n // Spherical excess E for a spherical triangle with vertices: south pole,\n // previous point, current point. Uses a formula derived from Cagnoli’s\n // theorem. See Todhunter, Spherical Trig. (1871), Sec. 103, Eq. (2).\n var dLambda = lambda - lambda0,\n sdLambda = dLambda >= 0 ? 1 : -1,\n adLambda = sdLambda * dLambda,\n cosPhi = cos(phi),\n sinPhi = sin(phi),\n k = sinPhi0 * sinPhi,\n u = cosPhi0 * cosPhi + k * cos(adLambda),\n v = k * sdLambda * sin(adLambda);\n areaRingSum.add(atan2(v, u));\n\n // Advance the previous points.\n lambda0 = lambda, cosPhi0 = cosPhi, sinPhi0 = sinPhi;\n}\n\nexport default function(object) {\n areaSum.reset();\n stream(object, areaStream);\n return areaSum * 2;\n}\n"],"names":["adder"],"mappings":";AAKyBA,EAAA;AAEXA,EAAA;","x_google_ignoreList":[0]}
|
package/dist/index.es198.js
CHANGED
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { azimuthalInvert as a, azimuthalRaw as m } from "./index.es252.js";
|
|
3
|
-
import "./index.es193.js";
|
|
4
|
-
import "./index.es192.js";
|
|
5
|
-
import "./index.es191.js";
|
|
1
|
+
import r from "./index.es243.js";
|
|
6
2
|
import "./index.es197.js";
|
|
7
|
-
|
|
8
|
-
return t(2 / (1 + r));
|
|
9
|
-
});
|
|
10
|
-
o.invert = a(function(r) {
|
|
11
|
-
return 2 * i(r / 2);
|
|
12
|
-
});
|
|
13
|
-
export {
|
|
14
|
-
o as azimuthalEqualAreaRaw
|
|
15
|
-
};
|
|
3
|
+
r();
|
|
16
4
|
//# sourceMappingURL=index.es198.js.map
|
package/dist/index.es198.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es198.js","sources":["../../../node_modules/d3-geo/src/
|
|
1
|
+
{"version":3,"file":"index.es198.js","sources":["../../../node_modules/d3-geo/src/bounds.js"],"sourcesContent":["import adder from \"./adder\";\nimport {areaStream, areaRingSum} from \"./area\";\nimport {cartesian, cartesianCross, cartesianNormalizeInPlace, spherical} from \"./cartesian\";\nimport {abs, degrees, epsilon, radians} from \"./math\";\nimport stream from \"./stream\";\n\nvar lambda0, phi0, lambda1, phi1, // bounds\n lambda2, // previous lambda-coordinate\n lambda00, phi00, // first point\n p0, // previous 3D point\n deltaSum = adder(),\n ranges,\n range;\n\nvar boundsStream = {\n point: boundsPoint,\n lineStart: boundsLineStart,\n lineEnd: boundsLineEnd,\n polygonStart: function() {\n boundsStream.point = boundsRingPoint;\n boundsStream.lineStart = boundsRingStart;\n boundsStream.lineEnd = boundsRingEnd;\n deltaSum.reset();\n areaStream.polygonStart();\n },\n polygonEnd: function() {\n areaStream.polygonEnd();\n boundsStream.point = boundsPoint;\n boundsStream.lineStart = boundsLineStart;\n boundsStream.lineEnd = boundsLineEnd;\n if (areaRingSum < 0) lambda0 = -(lambda1 = 180), phi0 = -(phi1 = 90);\n else if (deltaSum > epsilon) phi1 = 90;\n else if (deltaSum < -epsilon) phi0 = -90;\n range[0] = lambda0, range[1] = lambda1;\n }\n};\n\nfunction boundsPoint(lambda, phi) {\n ranges.push(range = [lambda0 = lambda, lambda1 = lambda]);\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n}\n\nfunction linePoint(lambda, phi) {\n var p = cartesian([lambda * radians, phi * radians]);\n if (p0) {\n var normal = cartesianCross(p0, p),\n equatorial = [normal[1], -normal[0], 0],\n inflection = cartesianCross(equatorial, normal);\n cartesianNormalizeInPlace(inflection);\n inflection = spherical(inflection);\n var delta = lambda - lambda2,\n sign = delta > 0 ? 1 : -1,\n lambdai = inflection[0] * degrees * sign,\n phii,\n antimeridian = abs(delta) > 180;\n if (antimeridian ^ (sign * lambda2 < lambdai && lambdai < sign * lambda)) {\n phii = inflection[1] * degrees;\n if (phii > phi1) phi1 = phii;\n } else if (lambdai = (lambdai + 360) % 360 - 180, antimeridian ^ (sign * lambda2 < lambdai && lambdai < sign * lambda)) {\n phii = -inflection[1] * degrees;\n if (phii < phi0) phi0 = phii;\n } else {\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n }\n if (antimeridian) {\n if (lambda < lambda2) {\n if (angle(lambda0, lambda) > angle(lambda0, lambda1)) lambda1 = lambda;\n } else {\n if (angle(lambda, lambda1) > angle(lambda0, lambda1)) lambda0 = lambda;\n }\n } else {\n if (lambda1 >= lambda0) {\n if (lambda < lambda0) lambda0 = lambda;\n if (lambda > lambda1) lambda1 = lambda;\n } else {\n if (lambda > lambda2) {\n if (angle(lambda0, lambda) > angle(lambda0, lambda1)) lambda1 = lambda;\n } else {\n if (angle(lambda, lambda1) > angle(lambda0, lambda1)) lambda0 = lambda;\n }\n }\n }\n } else {\n ranges.push(range = [lambda0 = lambda, lambda1 = lambda]);\n }\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n p0 = p, lambda2 = lambda;\n}\n\nfunction boundsLineStart() {\n boundsStream.point = linePoint;\n}\n\nfunction boundsLineEnd() {\n range[0] = lambda0, range[1] = lambda1;\n boundsStream.point = boundsPoint;\n p0 = null;\n}\n\nfunction boundsRingPoint(lambda, phi) {\n if (p0) {\n var delta = lambda - lambda2;\n deltaSum.add(abs(delta) > 180 ? delta + (delta > 0 ? 360 : -360) : delta);\n } else {\n lambda00 = lambda, phi00 = phi;\n }\n areaStream.point(lambda, phi);\n linePoint(lambda, phi);\n}\n\nfunction boundsRingStart() {\n areaStream.lineStart();\n}\n\nfunction boundsRingEnd() {\n boundsRingPoint(lambda00, phi00);\n areaStream.lineEnd();\n if (abs(deltaSum) > epsilon) lambda0 = -(lambda1 = 180);\n range[0] = lambda0, range[1] = lambda1;\n p0 = null;\n}\n\n// Finds the left-right distance between two longitudes.\n// This is almost the same as (lambda1 - lambda0 + 360°) % 360°, except that we want\n// the distance between ±180° to be 360°.\nfunction angle(lambda0, lambda1) {\n return (lambda1 -= lambda0) < 0 ? lambda1 + 360 : lambda1;\n}\n\nfunction rangeCompare(a, b) {\n return a[0] - b[0];\n}\n\nfunction rangeContains(range, x) {\n return range[0] <= range[1] ? range[0] <= x && x <= range[1] : x < range[0] || range[1] < x;\n}\n\nexport default function(feature) {\n var i, n, a, b, merged, deltaMax, delta;\n\n phi1 = lambda1 = -(lambda0 = phi0 = Infinity);\n ranges = [];\n stream(feature, boundsStream);\n\n // First, sort ranges by their minimum longitudes.\n if (n = ranges.length) {\n ranges.sort(rangeCompare);\n\n // Then, merge any ranges that overlap.\n for (i = 1, a = ranges[0], merged = [a]; i < n; ++i) {\n b = ranges[i];\n if (rangeContains(a, b[0]) || rangeContains(a, b[1])) {\n if (angle(a[0], b[1]) > angle(a[0], a[1])) a[1] = b[1];\n if (angle(b[0], a[1]) > angle(a[0], a[1])) a[0] = b[0];\n } else {\n merged.push(a = b);\n }\n }\n\n // Finally, find the largest gap between the merged ranges.\n // The final bounding box will be the inverse of this gap.\n for (deltaMax = -Infinity, n = merged.length - 1, i = 0, a = merged[n]; i <= n; a = b, ++i) {\n b = merged[i];\n if ((delta = angle(a[1], b[0])) > deltaMax) deltaMax = delta, lambda0 = b[0], lambda1 = a[1];\n }\n }\n\n ranges = range = null;\n\n return lambda0 === Infinity || phi0 === Infinity\n ? [[NaN, NaN], [NaN, NaN]]\n : [[lambda0, phi0], [lambda1, phi1]];\n}\n"],"names":["adder"],"mappings":";;AAUeA,EAAA;","x_google_ignoreList":[0]}
|