@performant-software/geospatial 2.3.6-beta.8 → 2.3.7
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.cjs19.js +1 -1
- package/dist/index.cjs198.js +1 -1
- package/dist/index.cjs209.js +1 -1
- package/dist/index.cjs210.js +1 -1
- package/dist/index.cjs233.js +1 -1
- package/dist/index.cjs233.js.map +1 -1
- package/dist/index.cjs234.js +1 -1
- package/dist/index.cjs234.js.map +1 -1
- package/dist/index.cjs235.js +1 -1
- package/dist/index.cjs235.js.map +1 -1
- package/dist/index.cjs236.js +1 -1
- package/dist/index.cjs236.js.map +1 -1
- package/dist/index.cjs243.js +1 -1
- package/dist/index.cjs245.js +1 -1
- package/dist/index.cjs250.js +1 -1
- package/dist/index.cjs253.js +1 -1
- package/dist/index.cjs256.js +1 -1
- package/dist/index.cjs256.js.map +1 -1
- package/dist/index.cjs257.js +1 -1
- package/dist/index.cjs257.js.map +1 -1
- package/dist/index.cjs258.js +1 -1
- package/dist/index.cjs258.js.map +1 -1
- package/dist/index.cjs26.js +1 -1
- package/dist/index.cjs52.js +1 -1
- package/dist/index.cjs60.js +1 -1
- package/dist/index.cjs61.js +1 -1
- package/dist/index.cjs67.js +1 -1
- package/dist/index.cjs67.js.map +1 -1
- package/dist/index.cjs68.js +1 -1
- package/dist/index.cjs68.js.map +1 -1
- package/dist/index.cjs69.js +1 -1
- package/dist/index.cjs69.js.map +1 -1
- package/dist/index.cjs70.js +1 -1
- package/dist/index.cjs70.js.map +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.cjs72.js.map +1 -1
- package/dist/index.cjs73.js +1 -1
- package/dist/index.cjs73.js.map +1 -1
- package/dist/index.cjs74.js +1 -1
- 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 +1 -1
- package/dist/index.cjs76.js.map +1 -1
- package/dist/index.cjs77.js +1 -1
- package/dist/index.cjs77.js.map +1 -1
- package/dist/index.cjs78.js +1 -1
- package/dist/index.cjs78.js.map +1 -1
- package/dist/index.cjs79.js +1 -1
- package/dist/index.cjs79.js.map +1 -1
- package/dist/index.cjs80.js +1 -1
- package/dist/index.cjs80.js.map +1 -1
- package/dist/index.es14.js +1 -1
- package/dist/index.es15.js +9 -9
- package/dist/index.es16.js +1 -1
- package/dist/index.es19.js +1 -1
- package/dist/index.es198.js +2 -2
- package/dist/index.es209.js +1 -1
- package/dist/index.es210.js +1 -1
- package/dist/index.es233.js +3 -46
- package/dist/index.es233.js.map +1 -1
- package/dist/index.es234.js +45 -22
- package/dist/index.es234.js.map +1 -1
- package/dist/index.es235.js +22 -5
- package/dist/index.es235.js.map +1 -1
- package/dist/index.es236.js +6 -3
- package/dist/index.es236.js.map +1 -1
- package/dist/index.es243.js +1 -1
- package/dist/index.es245.js +1 -1
- package/dist/index.es250.js +1 -1
- package/dist/index.es253.js +1 -1
- package/dist/index.es256.js +15 -2
- package/dist/index.es256.js.map +1 -1
- package/dist/index.es257.js +2 -4
- package/dist/index.es257.js.map +1 -1
- package/dist/index.es258.js +4 -15
- package/dist/index.es258.js.map +1 -1
- package/dist/index.es26.js +1 -1
- package/dist/index.es52.js +6 -6
- package/dist/index.es60.js +1 -1
- package/dist/index.es61.js +1 -1
- package/dist/index.es63.js +2 -2
- package/dist/index.es64.js +2 -2
- package/dist/index.es67.js +2 -55
- package/dist/index.es67.js.map +1 -1
- package/dist/index.es68.js +4 -48
- package/dist/index.es68.js.map +1 -1
- package/dist/index.es69.js +28 -37
- package/dist/index.es69.js.map +1 -1
- package/dist/index.es70.js +56 -11
- package/dist/index.es70.js.map +1 -1
- package/dist/index.es71.js +47 -14
- package/dist/index.es71.js.map +1 -1
- package/dist/index.es72.js +38 -29
- package/dist/index.es72.js.map +1 -1
- package/dist/index.es73.js +8 -11
- package/dist/index.es73.js.map +1 -1
- package/dist/index.es74.js +14 -13
- package/dist/index.es74.js.map +1 -1
- package/dist/index.es75.js +29 -12
- package/dist/index.es75.js.map +1 -1
- package/dist/index.es76.js +13 -2
- package/dist/index.es76.js.map +1 -1
- package/dist/index.es77.js +14 -4
- package/dist/index.es77.js.map +1 -1
- package/dist/index.es78.js +49 -26
- package/dist/index.es78.js.map +1 -1
- package/dist/index.es79.js +58 -44
- package/dist/index.es79.js.map +1 -1
- package/dist/index.es80.js +10 -64
- package/dist/index.es80.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.es257.js
CHANGED
package/dist/index.es257.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es257.js","sources":["../../../node_modules/d3-geo/src/
|
|
1
|
+
{"version":3,"file":"index.es257.js","sources":["../../../node_modules/d3-geo/src/noop.js"],"sourcesContent":["export default function noop() {}\n"],"names":["noop"],"mappings":"AAAA,SAAwBA,IAAO;AAAC;","x_google_ignoreList":[0]}
|
package/dist/index.es258.js
CHANGED
|
@@ -1,19 +1,8 @@
|
|
|
1
|
-
import r from "./index.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
lineStart: r,
|
|
5
|
-
lineEnd: r,
|
|
6
|
-
polygonStart: r,
|
|
7
|
-
polygonEnd: r,
|
|
8
|
-
result: function() {
|
|
9
|
-
var n = [[o, f], [t, a]];
|
|
10
|
-
return t = a = -(f = o = 1 / 0), n;
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
function u(n, i) {
|
|
14
|
-
n < o && (o = n), n > t && (t = n), i < f && (f = i), i > a && (a = i);
|
|
1
|
+
import { abs as n, epsilon as r } from "./index.es241.js";
|
|
2
|
+
function i(o, t) {
|
|
3
|
+
return n(o[0] - t[0]) < r && n(o[1] - t[1]) < r;
|
|
15
4
|
}
|
|
16
5
|
export {
|
|
17
|
-
|
|
6
|
+
i as default
|
|
18
7
|
};
|
|
19
8
|
//# sourceMappingURL=index.es258.js.map
|
package/dist/index.es258.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es258.js","sources":["../../../node_modules/d3-geo/src/
|
|
1
|
+
{"version":3,"file":"index.es258.js","sources":["../../../node_modules/d3-geo/src/pointEqual.js"],"sourcesContent":["import {abs, epsilon} from \"./math\";\n\nexport default function(a, b) {\n return abs(a[0] - b[0]) < epsilon && abs(a[1] - b[1]) < epsilon;\n}\n"],"names":["pointEqual","a","b","abs","epsilon"],"mappings":";AAEA,SAAAA,EAAwBC,GAAGC,GAAG;AAC5B,SAAOC,EAAIF,EAAE,CAAC,IAAIC,EAAE,CAAC,CAAC,IAAIE,KAAWD,EAAIF,EAAE,CAAC,IAAIC,EAAE,CAAC,CAAC,IAAIE;AAC1D;","x_google_ignoreList":[0]}
|
package/dist/index.es26.js
CHANGED
package/dist/index.es52.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as m from "react";
|
|
2
|
-
import p from "./index.
|
|
3
|
-
import "./index.
|
|
4
|
-
import "./index.es69.js";
|
|
5
|
-
import "./index.es70.js";
|
|
6
|
-
import i from "./index.es71.js";
|
|
2
|
+
import p from "./index.es70.js";
|
|
3
|
+
import "./index.es71.js";
|
|
7
4
|
import "./index.es72.js";
|
|
8
5
|
import "./index.es73.js";
|
|
9
|
-
import "./index.es74.js";
|
|
6
|
+
import i from "./index.es74.js";
|
|
10
7
|
import "./index.es75.js";
|
|
8
|
+
import "./index.es76.js";
|
|
9
|
+
import "./index.es77.js";
|
|
10
|
+
import "./index.es80.js";
|
|
11
11
|
const n = import("./index.es19.js").then((r) => r.o);
|
|
12
12
|
m.forwardRef(function(o, t) {
|
|
13
13
|
return p(o, t, n);
|
package/dist/index.es60.js
CHANGED
package/dist/index.es61.js
CHANGED
package/dist/index.es63.js
CHANGED
package/dist/index.es64.js
CHANGED
package/dist/index.es67.js
CHANGED
|
@@ -1,58 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { useContext as b, useState as E, useRef as c, useEffect as x, useImperativeHandle as w, useMemo as y } from "react";
|
|
3
|
-
import { MountedMapsContext as L } from "./index.es75.js";
|
|
4
|
-
import m from "./index.es198.js";
|
|
5
|
-
import I from "./index.es199.js";
|
|
6
|
-
import C from "./index.es200.js";
|
|
7
|
-
import g from "./index.es201.js";
|
|
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
|
-
}), w(f, () => a.map, [i]);
|
|
40
|
-
const M = y(() => ({
|
|
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
|
-
}
|
|
1
|
+
var r = {};
|
|
54
2
|
export {
|
|
55
|
-
|
|
56
|
-
A as default
|
|
3
|
+
r as __exports
|
|
57
4
|
};
|
|
58
5
|
//# sourceMappingURL=index.es67.js.map
|
package/dist/index.es67.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es67.js","sources":[
|
|
1
|
+
{"version":3,"file":"index.es67.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/index.es68.js
CHANGED
|
@@ -1,49 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { MapContext as O } from "./index.es67.js";
|
|
6
|
-
import { arePointsEqual as S } from "./index.es203.js";
|
|
7
|
-
function q(o, E) {
|
|
8
|
-
const { map: R, mapLib: b } = C(O), i = D({ props: o });
|
|
9
|
-
i.current.props = o;
|
|
10
|
-
const t = M(() => {
|
|
11
|
-
let L = !1;
|
|
12
|
-
k.Children.forEach(o.children, (a) => {
|
|
13
|
-
a && (L = !0);
|
|
14
|
-
});
|
|
15
|
-
const _ = {
|
|
16
|
-
...o,
|
|
17
|
-
element: L ? document.createElement("div") : null
|
|
18
|
-
}, l = new b.Marker(_);
|
|
19
|
-
return l.setLngLat([o.longitude, o.latitude]), l.getElement().addEventListener("click", (a) => {
|
|
20
|
-
var n, e;
|
|
21
|
-
(e = (n = i.current.props).onClick) === null || e === void 0 || e.call(n, {
|
|
22
|
-
type: "click",
|
|
23
|
-
target: l,
|
|
24
|
-
originalEvent: a
|
|
25
|
-
});
|
|
26
|
-
}), l.on("dragstart", (a) => {
|
|
27
|
-
var n, e;
|
|
28
|
-
const r = a;
|
|
29
|
-
r.lngLat = t.getLngLat(), (e = (n = i.current.props).onDragStart) === null || e === void 0 || e.call(n, r);
|
|
30
|
-
}), l.on("drag", (a) => {
|
|
31
|
-
var n, e;
|
|
32
|
-
const r = a;
|
|
33
|
-
r.lngLat = t.getLngLat(), (e = (n = i.current.props).onDrag) === null || e === void 0 || e.call(n, r);
|
|
34
|
-
}), l.on("dragend", (a) => {
|
|
35
|
-
var n, e;
|
|
36
|
-
const r = a;
|
|
37
|
-
r.lngLat = t.getLngLat(), (e = (n = i.current.props).onDragEnd) === null || e === void 0 || e.call(n, r);
|
|
38
|
-
}), l;
|
|
39
|
-
}, []);
|
|
40
|
-
h(() => (t.addTo(R.getMap()), () => {
|
|
41
|
-
t.remove();
|
|
42
|
-
}), []);
|
|
43
|
-
const { longitude: c, latitude: s, offset: g, style: m, draggable: u = !1, popup: d = null, rotation: f = 0, rotationAlignment: v = "auto", pitchAlignment: p = "auto" } = o;
|
|
44
|
-
return h(() => {
|
|
45
|
-
x(t.getElement(), m);
|
|
46
|
-
}, [m]), y(E, () => t, []), (t.getLngLat().lng !== c || t.getLngLat().lat !== s) && t.setLngLat([c, s]), g && !S(t.getOffset(), g) && t.setOffset(g), t.isDraggable() !== u && t.setDraggable(u), t.getRotation() !== f && t.setRotation(f), t.getRotationAlignment() !== v && t.setRotationAlignment(v), t.getPitchAlignment() !== p && t.setPitchAlignment(p), t.getPopup() !== d && t.setPopup(d), w(o.children, t.getElement());
|
|
47
|
-
}
|
|
48
|
-
A(P(q));
|
|
1
|
+
var e = {};
|
|
2
|
+
export {
|
|
3
|
+
e as __exports
|
|
4
|
+
};
|
|
49
5
|
//# sourceMappingURL=index.es68.js.map
|
package/dist/index.es68.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es68.js","sources":[
|
|
1
|
+
{"version":3,"file":"index.es68.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/index.es69.js
CHANGED
|
@@ -1,40 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var s, l;
|
|
16
|
-
(l = (s = i.current.props).onOpen) === null || l === void 0 || l.call(s, n);
|
|
17
|
-
}), o;
|
|
18
|
-
}, []);
|
|
19
|
-
if (m(() => {
|
|
20
|
-
const a = (o) => {
|
|
21
|
-
var n, s;
|
|
22
|
-
(s = (n = i.current.props).onClose) === null || s === void 0 || s.call(n, o);
|
|
23
|
-
};
|
|
24
|
-
return e.on("close", a), e.setDOMContent(c).addTo(d.getMap()), () => {
|
|
25
|
-
e.off("close", a), e.isOpen() && e.remove();
|
|
26
|
-
};
|
|
27
|
-
}, []), m(() => {
|
|
28
|
-
M(e.getElement(), t.style);
|
|
29
|
-
}, [t.style]), N(u, () => e, []), e.isOpen() && ((e.getLngLat().lng !== t.longitude || e.getLngLat().lat !== t.latitude) && e.setLngLat([t.longitude, t.latitude]), t.offset && !y(e.options.offset, t.offset) && e.setOffset(t.offset), (e.options.anchor !== t.anchor || e.options.maxWidth !== t.maxWidth) && (e.options.anchor = t.anchor, e.setMaxWidth(t.maxWidth)), e.options.className !== t.className)) {
|
|
30
|
-
const a = r(e.options.className), o = r(t.className);
|
|
31
|
-
for (const n of a)
|
|
32
|
-
o.has(n) || e.removeClassName(n);
|
|
33
|
-
for (const n of o)
|
|
34
|
-
a.has(n) || e.addClassName(n);
|
|
35
|
-
e.options.className = t.className;
|
|
1
|
+
import { __exports as a } from "./index.es205.js";
|
|
2
|
+
function i(r, s) {
|
|
3
|
+
for (var o = 0; o < s.length; o++) {
|
|
4
|
+
const e = s[o];
|
|
5
|
+
if (typeof e != "string" && !Array.isArray(e)) {
|
|
6
|
+
for (const t in e)
|
|
7
|
+
if (t !== "default" && !(t in r)) {
|
|
8
|
+
const n = Object.getOwnPropertyDescriptor(e, t);
|
|
9
|
+
n && Object.defineProperty(r, t, n.get ? n : {
|
|
10
|
+
enumerable: !0,
|
|
11
|
+
get: () => e[t]
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
}
|
|
36
15
|
}
|
|
37
|
-
return
|
|
16
|
+
return Object.freeze(Object.defineProperty(r, Symbol.toStringTag, { value: "Module" }));
|
|
38
17
|
}
|
|
39
|
-
|
|
18
|
+
var f = a.printMsg = function() {
|
|
19
|
+
console.log("This is a message from the demo package");
|
|
20
|
+
};
|
|
21
|
+
const p = /* @__PURE__ */ i({
|
|
22
|
+
__proto__: null,
|
|
23
|
+
default: a,
|
|
24
|
+
printMsg: f
|
|
25
|
+
}, [a]);
|
|
26
|
+
export {
|
|
27
|
+
a as default,
|
|
28
|
+
p as i,
|
|
29
|
+
f as printMsg
|
|
30
|
+
};
|
|
40
31
|
//# sourceMappingURL=index.es69.js.map
|
package/dist/index.es69.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es69.js","sources":["../../../node_modules/
|
|
1
|
+
{"version":3,"file":"index.es69.js","sources":["../../../node_modules/mapbox-gl/index.js"],"sourcesContent":["exports.printMsg = function() {\r\n console.log(\"This is a message from the demo package\");\r\n }"],"names":["printMsg","mapboxGl"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,IAAAC,EAAA,WAAmB,WAAW;AAC1B,UAAQ,IAAI,yCAAyC;AACvD;;;;;;","x_google_ignoreList":[0]}
|
package/dist/index.es70.js
CHANGED
|
@@ -1,13 +1,58 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import * as l from "react";
|
|
2
|
+
import { useContext as b, useState as E, useRef as c, useEffect as x, useImperativeHandle as w, useMemo as y } from "react";
|
|
3
|
+
import { MountedMapsContext as L } from "./index.es80.js";
|
|
4
|
+
import m from "./index.es198.js";
|
|
5
|
+
import I from "./index.es199.js";
|
|
6
|
+
import C from "./index.es200.js";
|
|
7
|
+
import g from "./index.es201.js";
|
|
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
|
+
}), w(f, () => a.map, [i]);
|
|
40
|
+
const M = y(() => ({
|
|
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
|
+
));
|
|
11
53
|
}
|
|
12
|
-
|
|
54
|
+
export {
|
|
55
|
+
R as MapContext,
|
|
56
|
+
A as default
|
|
57
|
+
};
|
|
13
58
|
//# sourceMappingURL=index.es70.js.map
|
package/dist/index.es70.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es70.js","sources":["../../../node_modules/react-map-gl/dist/esm/components/
|
|
1
|
+
{"version":3,"file":"index.es70.js","sources":["../../../node_modules/react-map-gl/dist/esm/components/map.js"],"sourcesContent":["import * as React from 'react';\nimport { useState, useRef, useEffect, useContext, useMemo, useImperativeHandle } from 'react';\nimport { MountedMapsContext } from './use-map';\nimport Mapbox from '../mapbox/mapbox';\nimport createRef from '../mapbox/create-ref';\nimport useIsomorphicLayoutEffect from '../utils/use-isomorphic-layout-effect';\nimport setGlobals from '../utils/set-globals';\nexport const MapContext = React.createContext(null);\nexport default function Map(props, ref, defaultLib) {\n const mountedMapsContext = useContext(MountedMapsContext);\n const [mapInstance, setMapInstance] = useState(null);\n const containerRef = useRef();\n const { current: contextValue } = useRef({ mapLib: null, map: null });\n useEffect(() => {\n const mapLib = props.mapLib;\n let isMounted = true;\n let mapbox;\n Promise.resolve(mapLib || defaultLib)\n .then((module) => {\n if (!isMounted) {\n return;\n }\n if (!module) {\n throw new Error('Invalid mapLib');\n }\n const mapboxgl = 'Map' in module ? module : module.default;\n if (!mapboxgl.Map) {\n throw new Error('Invalid mapLib');\n }\n // workerUrl & workerClass may change the result of supported()\n // https://github.com/visgl/react-map-gl/discussions/2027\n setGlobals(mapboxgl, props);\n if (!mapboxgl.supported || mapboxgl.supported(props)) {\n if (props.reuseMaps) {\n mapbox = Mapbox.reuse(props, containerRef.current);\n }\n if (!mapbox) {\n mapbox = new Mapbox(mapboxgl.Map, props, containerRef.current);\n }\n contextValue.map = createRef(mapbox);\n contextValue.mapLib = mapboxgl;\n setMapInstance(mapbox);\n mountedMapsContext === null || mountedMapsContext === void 0 ? void 0 : mountedMapsContext.onMapMount(contextValue.map, props.id);\n }\n else {\n throw new Error('Map is not supported by this browser');\n }\n })\n .catch(error => {\n const { onError } = props;\n if (onError) {\n onError({\n type: 'error',\n target: null,\n originalEvent: null,\n error\n });\n }\n else {\n console.error(error); // eslint-disable-line\n }\n });\n return () => {\n isMounted = false;\n if (mapbox) {\n mountedMapsContext === null || mountedMapsContext === void 0 ? void 0 : mountedMapsContext.onMapUnmount(props.id);\n if (props.reuseMaps) {\n mapbox.recycle();\n }\n else {\n mapbox.destroy();\n }\n }\n };\n }, []);\n useIsomorphicLayoutEffect(() => {\n if (mapInstance) {\n mapInstance.setProps(props);\n }\n });\n useImperativeHandle(ref, () => contextValue.map, [mapInstance]);\n const style = useMemo(() => ({\n position: 'relative',\n width: '100%',\n height: '100%',\n ...props.style\n }), [props.style]);\n const CHILD_CONTAINER_STYLE = {\n height: '100%'\n };\n return (React.createElement(\"div\", { id: props.id, ref: containerRef, style: style }, mapInstance && (React.createElement(MapContext.Provider, { value: contextValue },\n React.createElement(\"div\", { \"mapboxgl-children\": \"\", style: CHILD_CONTAINER_STYLE }, props.children)))));\n}\n//# sourceMappingURL=map.js.map"],"names":["MapContext","React","Map","props","ref","defaultLib","mountedMapsContext","useContext","MountedMapsContext","mapInstance","setMapInstance","useState","containerRef","useRef","contextValue","useEffect","mapLib","isMounted","mapbox","module","mapboxgl","setGlobals","Mapbox","createRef","error","onError","useIsomorphicLayoutEffect","useImperativeHandle","style","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B,CACH,GACM,MAAM;AACG,MAAAP,IAAA,IACRC,MACAZ,KAAuB,QAAiDA,EAAmB,aAAaH,EAAM,EAAE,GAC5GA,EAAM,YACNe,EAAO,QAAQ,IAGfA,EAAO,QAAQ;AAAA,IAEvB;AAAA,EAER,GAAG,CAAE,CAAA,GACLQ,EAA0B,MAAM;AAC5B,IAAIjB,KACAA,EAAY,SAASN,CAAK;AAAA,EAC9B,CACH,GACDwB,EAAoBvB,GAAK,MAAMU,EAAa,KAAK,CAACL,CAAW,CAAC;AACxD,QAAAmB,IAAQC,EAAQ,OAAO;AAAA,IACzB,UAAU;AAAA,IACV,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,GAAG1B,EAAM;AAAA,EACT,IAAA,CAACA,EAAM,KAAK,CAAC,GACX2B,IAAwB;AAAA,IAC1B,QAAQ;AAAA,EAAA;AAEZ,SAAQ7B,EAAM,cAAc,OAAO,EAAE,IAAIE,EAAM,IAAI,KAAKS,GAAc,OAAAgB,EAAgB,GAAAnB,KAAgBR,EAAM;AAAA,IAAcD,EAAW;AAAA,IAAU,EAAE,OAAOc,EAAa;AAAA,IACjKb,EAAM,cAAc,OAAO,EAAE,qBAAqB,IAAI,OAAO6B,EAAA,GAAyB3B,EAAM,QAAQ;AAAA,EAAA,CAAG;AAC/G;","x_google_ignoreList":[0]}
|
package/dist/index.es71.js
CHANGED
|
@@ -1,16 +1,49 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import * as k from "react";
|
|
2
|
+
import { memo as A, forwardRef as P, useContext as C, useRef as D, useMemo as M, useEffect as h, useImperativeHandle as y } from "react";
|
|
3
|
+
import { createPortal as w } from "react-dom";
|
|
4
|
+
import { applyReactStyle as x } from "./index.es202.js";
|
|
5
|
+
import { MapContext as O } from "./index.es70.js";
|
|
6
|
+
import { arePointsEqual as S } from "./index.es203.js";
|
|
7
|
+
function q(o, E) {
|
|
8
|
+
const { map: R, mapLib: b } = C(O), i = D({ props: o });
|
|
9
|
+
i.current.props = o;
|
|
10
|
+
const t = M(() => {
|
|
11
|
+
let L = !1;
|
|
12
|
+
k.Children.forEach(o.children, (a) => {
|
|
13
|
+
a && (L = !0);
|
|
14
|
+
});
|
|
15
|
+
const _ = {
|
|
16
|
+
...o,
|
|
17
|
+
element: L ? document.createElement("div") : null
|
|
18
|
+
}, l = new b.Marker(_);
|
|
19
|
+
return l.setLngLat([o.longitude, o.latitude]), l.getElement().addEventListener("click", (a) => {
|
|
20
|
+
var n, e;
|
|
21
|
+
(e = (n = i.current.props).onClick) === null || e === void 0 || e.call(n, {
|
|
22
|
+
type: "click",
|
|
23
|
+
target: l,
|
|
24
|
+
originalEvent: a
|
|
25
|
+
});
|
|
26
|
+
}), l.on("dragstart", (a) => {
|
|
27
|
+
var n, e;
|
|
28
|
+
const r = a;
|
|
29
|
+
r.lngLat = t.getLngLat(), (e = (n = i.current.props).onDragStart) === null || e === void 0 || e.call(n, r);
|
|
30
|
+
}), l.on("drag", (a) => {
|
|
31
|
+
var n, e;
|
|
32
|
+
const r = a;
|
|
33
|
+
r.lngLat = t.getLngLat(), (e = (n = i.current.props).onDrag) === null || e === void 0 || e.call(n, r);
|
|
34
|
+
}), l.on("dragend", (a) => {
|
|
35
|
+
var n, e;
|
|
36
|
+
const r = a;
|
|
37
|
+
r.lngLat = t.getLngLat(), (e = (n = i.current.props).onDragEnd) === null || e === void 0 || e.call(n, r);
|
|
38
|
+
}), l;
|
|
39
|
+
}, []);
|
|
40
|
+
h(() => (t.addTo(R.getMap()), () => {
|
|
41
|
+
t.remove();
|
|
42
|
+
}), []);
|
|
43
|
+
const { longitude: c, latitude: s, offset: g, style: m, draggable: u = !1, popup: d = null, rotation: f = 0, rotationAlignment: v = "auto", pitchAlignment: p = "auto" } = o;
|
|
44
|
+
return h(() => {
|
|
45
|
+
x(t.getElement(), m);
|
|
46
|
+
}, [m]), y(E, () => t, []), (t.getLngLat().lng !== c || t.getLngLat().lat !== s) && t.setLngLat([c, s]), g && !S(t.getOffset(), g) && t.setOffset(g), t.isDraggable() !== u && t.setDraggable(u), t.getRotation() !== f && t.setRotation(f), t.getRotationAlignment() !== v && t.setRotationAlignment(v), t.getPitchAlignment() !== p && t.setPitchAlignment(p), t.getPopup() !== d && t.setPopup(d), w(o.children, t.getElement());
|
|
11
47
|
}
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
s as default
|
|
15
|
-
};
|
|
48
|
+
A(P(q));
|
|
16
49
|
//# sourceMappingURL=index.es71.js.map
|
package/dist/index.es71.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es71.js","sources":["../../../node_modules/react-map-gl/dist/esm/components/
|
|
1
|
+
{"version":3,"file":"index.es71.js","sources":["../../../node_modules/react-map-gl/dist/esm/components/marker.js"],"sourcesContent":["/* global document */\nimport * as React from 'react';\nimport { createPortal } from 'react-dom';\nimport { useImperativeHandle, useEffect, useMemo, useRef, useContext, forwardRef, memo } from 'react';\nimport { applyReactStyle } from '../utils/apply-react-style';\nimport { MapContext } from './map';\nimport { arePointsEqual } from '../utils/deep-equal';\n/* eslint-disable complexity,max-statements */\nfunction Marker(props, ref) {\n const { map, mapLib } = useContext(MapContext);\n const thisRef = useRef({ props });\n thisRef.current.props = props;\n const marker = useMemo(() => {\n let hasChildren = false;\n React.Children.forEach(props.children, el => {\n if (el) {\n hasChildren = true;\n }\n });\n const options = {\n ...props,\n element: hasChildren ? document.createElement('div') : null\n };\n const mk = new mapLib.Marker(options);\n mk.setLngLat([props.longitude, props.latitude]);\n mk.getElement().addEventListener('click', (e) => {\n var _a, _b;\n (_b = (_a = thisRef.current.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, {\n type: 'click',\n target: mk,\n originalEvent: e\n });\n });\n mk.on('dragstart', e => {\n var _a, _b;\n const evt = e;\n evt.lngLat = marker.getLngLat();\n (_b = (_a = thisRef.current.props).onDragStart) === null || _b === void 0 ? void 0 : _b.call(_a, evt);\n });\n mk.on('drag', e => {\n var _a, _b;\n const evt = e;\n evt.lngLat = marker.getLngLat();\n (_b = (_a = thisRef.current.props).onDrag) === null || _b === void 0 ? void 0 : _b.call(_a, evt);\n });\n mk.on('dragend', e => {\n var _a, _b;\n const evt = e;\n evt.lngLat = marker.getLngLat();\n (_b = (_a = thisRef.current.props).onDragEnd) === null || _b === void 0 ? void 0 : _b.call(_a, evt);\n });\n return mk;\n }, []);\n useEffect(() => {\n marker.addTo(map.getMap());\n return () => {\n marker.remove();\n };\n }, []);\n const { longitude, latitude, offset, style, draggable = false, popup = null, rotation = 0, rotationAlignment = 'auto', pitchAlignment = 'auto' } = props;\n useEffect(() => {\n applyReactStyle(marker.getElement(), style);\n }, [style]);\n useImperativeHandle(ref, () => marker, []);\n if (marker.getLngLat().lng !== longitude || marker.getLngLat().lat !== latitude) {\n marker.setLngLat([longitude, latitude]);\n }\n if (offset && !arePointsEqual(marker.getOffset(), offset)) {\n marker.setOffset(offset);\n }\n if (marker.isDraggable() !== draggable) {\n marker.setDraggable(draggable);\n }\n if (marker.getRotation() !== rotation) {\n marker.setRotation(rotation);\n }\n if (marker.getRotationAlignment() !== rotationAlignment) {\n marker.setRotationAlignment(rotationAlignment);\n }\n if (marker.getPitchAlignment() !== pitchAlignment) {\n marker.setPitchAlignment(pitchAlignment);\n }\n if (marker.getPopup() !== popup) {\n marker.setPopup(popup);\n }\n return createPortal(props.children, marker.getElement());\n}\nexport default memo(forwardRef(Marker));\n//# sourceMappingURL=marker.js.map"],"names":["Marker","props","ref","map","mapLib","useContext","MapContext","thisRef","useRef","marker","useMemo","hasChildren","React","el","options","mk","e","_a","_b","evt","useEffect","longitude","latitude","offset","style","draggable","popup","rotation","rotationAlignment","pitchAlignment","applyReactStyle","useImperativeHandle","arePointsEqual","createPortal","memo","forwardRef"],"mappings":";;;;;;AAQA,SAASA,EAAOC,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AAO,WAAY,CAAA;AAC3D;AACeyB,EAAKC,EAAWnC,CAAM,CAAC;","x_google_ignoreList":[0]}
|
package/dist/index.es72.js
CHANGED
|
@@ -1,31 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
n._container.hasChildNodes() || u(t);
|
|
9
|
-
}, n.on("geolocate", (t) => {
|
|
10
|
-
var r, o;
|
|
11
|
-
(o = (r = a.current.props).onGeolocate) === null || o === void 0 || o.call(r, t);
|
|
12
|
-
}), n.on("error", (t) => {
|
|
13
|
-
var r, o;
|
|
14
|
-
(o = (r = a.current.props).onError) === null || o === void 0 || o.call(r, t);
|
|
15
|
-
}), n.on("outofmaxbounds", (t) => {
|
|
16
|
-
var r, o;
|
|
17
|
-
(o = (r = a.current.props).onOutOfMaxBounds) === null || o === void 0 || o.call(r, t);
|
|
18
|
-
}), n.on("trackuserlocationstart", (t) => {
|
|
19
|
-
var r, o;
|
|
20
|
-
(o = (r = a.current.props).onTrackUserLocationStart) === null || o === void 0 || o.call(r, t);
|
|
21
|
-
}), n.on("trackuserlocationend", (t) => {
|
|
22
|
-
var r, o;
|
|
23
|
-
(o = (r = a.current.props).onTrackUserLocationEnd) === null || o === void 0 || o.call(r, t);
|
|
24
|
-
}), n;
|
|
25
|
-
}, { position: e.position });
|
|
26
|
-
return a.current.props = e, _(c, () => l, []), f(() => {
|
|
27
|
-
p(l._container, e.style);
|
|
28
|
-
}, [e.style]), null;
|
|
1
|
+
import { createPortal as h } from "react-dom";
|
|
2
|
+
import { memo as L, forwardRef as v, useContext as C, useMemo as f, useRef as x, useEffect as m, useImperativeHandle as N } from "react";
|
|
3
|
+
import { applyReactStyle as M } from "./index.es202.js";
|
|
4
|
+
import { MapContext as O } from "./index.es70.js";
|
|
5
|
+
import { deepEqual as y } from "./index.es203.js";
|
|
6
|
+
function r(t) {
|
|
7
|
+
return new Set(t ? t.trim().split(/\s+/) : []);
|
|
29
8
|
}
|
|
30
|
-
|
|
9
|
+
function E(t, u) {
|
|
10
|
+
const { map: d, mapLib: g } = C(O), c = f(() => document.createElement("div"), []), i = x({ props: t });
|
|
11
|
+
i.current.props = t;
|
|
12
|
+
const e = f(() => {
|
|
13
|
+
const a = { ...t }, o = new g.Popup(a);
|
|
14
|
+
return o.setLngLat([t.longitude, t.latitude]), o.once("open", (n) => {
|
|
15
|
+
var s, l;
|
|
16
|
+
(l = (s = i.current.props).onOpen) === null || l === void 0 || l.call(s, n);
|
|
17
|
+
}), o;
|
|
18
|
+
}, []);
|
|
19
|
+
if (m(() => {
|
|
20
|
+
const a = (o) => {
|
|
21
|
+
var n, s;
|
|
22
|
+
(s = (n = i.current.props).onClose) === null || s === void 0 || s.call(n, o);
|
|
23
|
+
};
|
|
24
|
+
return e.on("close", a), e.setDOMContent(c).addTo(d.getMap()), () => {
|
|
25
|
+
e.off("close", a), e.isOpen() && e.remove();
|
|
26
|
+
};
|
|
27
|
+
}, []), m(() => {
|
|
28
|
+
M(e.getElement(), t.style);
|
|
29
|
+
}, [t.style]), N(u, () => e, []), e.isOpen() && ((e.getLngLat().lng !== t.longitude || e.getLngLat().lat !== t.latitude) && e.setLngLat([t.longitude, t.latitude]), t.offset && !y(e.options.offset, t.offset) && e.setOffset(t.offset), (e.options.anchor !== t.anchor || e.options.maxWidth !== t.maxWidth) && (e.options.anchor = t.anchor, e.setMaxWidth(t.maxWidth)), e.options.className !== t.className)) {
|
|
30
|
+
const a = r(e.options.className), o = r(t.className);
|
|
31
|
+
for (const n of a)
|
|
32
|
+
o.has(n) || e.removeClassName(n);
|
|
33
|
+
for (const n of o)
|
|
34
|
+
a.has(n) || e.addClassName(n);
|
|
35
|
+
e.options.className = t.className;
|
|
36
|
+
}
|
|
37
|
+
return h(t.children, c);
|
|
38
|
+
}
|
|
39
|
+
L(v(E));
|
|
31
40
|
//# sourceMappingURL=index.es72.js.map
|