@performant-software/geospatial 2.3.15-beta.0 → 2.3.15-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.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 +4 -1
- package/dist/index.cjs192.js.map +1 -1
- package/dist/index.cjs193.js +1 -4
- 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.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.cjs21.js +1 -1
- package/dist/index.cjs22.js +1 -1
- package/dist/index.cjs239.js +1 -1
- package/dist/index.cjs242.js +1 -1
- package/dist/index.cjs248.js +1 -1
- package/dist/index.cjs254.js +1 -1
- package/dist/index.cjs259.js +1 -1
- package/dist/index.cjs52.js +1 -1
- package/dist/index.cjs56.js +1 -1
- package/dist/index.cjs58.js +1 -1
- package/dist/index.cjs60.js +1 -1
- package/dist/index.cjs61.js +1 -1
- package/dist/index.cjs62.js +1 -1
- package/dist/index.cjs62.js.map +1 -1
- package/dist/index.cjs63.js +1 -1
- package/dist/index.cjs63.js.map +1 -1
- package/dist/index.cjs64.js +1 -1
- package/dist/index.cjs65.js +1 -1
- package/dist/index.cjs65.js.map +1 -1
- package/dist/index.cjs66.js +1 -1
- package/dist/index.cjs66.js.map +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.cjs79.js +1 -1
- package/dist/index.cjs80.js +1 -1
- package/dist/index.es14.js +2 -2
- package/dist/index.es15.js +5 -5
- package/dist/index.es16.js +1 -1
- package/dist/index.es19.js +2 -2
- package/dist/index.es190.js +8 -2
- package/dist/index.es190.js.map +1 -1
- package/dist/index.es191.js +147 -7
- package/dist/index.es191.js.map +1 -1
- package/dist/index.es192.js +12188 -139
- package/dist/index.es192.js.map +1 -1
- package/dist/index.es193.js +3 -12199
- package/dist/index.es193.js.map +1 -1
- package/dist/index.es194.js +1 -1
- package/dist/index.es194.js.map +1 -1
- package/dist/index.es195.js +38 -3
- package/dist/index.es195.js.map +1 -1
- package/dist/index.es196.js +3 -38
- package/dist/index.es196.js.map +1 -1
- package/dist/index.es197.js +25 -3
- package/dist/index.es197.js.map +1 -1
- package/dist/index.es198.js +2 -25
- package/dist/index.es198.js.map +1 -1
- package/dist/index.es199.js +1 -0
- package/dist/index.es199.js.map +1 -1
- package/dist/index.es200.js +0 -1
- package/dist/index.es200.js.map +1 -1
- package/dist/index.es201.js +34 -2
- package/dist/index.es201.js.map +1 -1
- package/dist/index.es202.js +13 -32
- package/dist/index.es202.js.map +1 -1
- package/dist/index.es203.js +12 -11
- package/dist/index.es203.js.map +1 -1
- package/dist/index.es204.js +8 -13
- package/dist/index.es204.js.map +1 -1
- package/dist/index.es205.js +2 -9
- package/dist/index.es205.js.map +1 -1
- package/dist/index.es21.js +2 -2
- package/dist/index.es22.js +2 -2
- package/dist/index.es239.js +1 -1
- package/dist/index.es242.js +1 -1
- package/dist/index.es248.js +2 -2
- package/dist/index.es254.js +1 -1
- package/dist/index.es259.js +2 -2
- package/dist/index.es52.js +5 -5
- package/dist/index.es56.js +1 -1
- package/dist/index.es58.js +6 -6
- package/dist/index.es60.js +1 -1
- package/dist/index.es61.js +1 -1
- package/dist/index.es62.js +5 -106
- package/dist/index.es62.js.map +1 -1
- package/dist/index.es63.js +2 -10
- package/dist/index.es63.js.map +1 -1
- package/dist/index.es64.js +2 -6
- package/dist/index.es64.js.map +1 -1
- package/dist/index.es65.js +55 -2
- package/dist/index.es65.js.map +1 -1
- package/dist/index.es66.js +48 -4
- package/dist/index.es66.js.map +1 -1
- package/dist/index.es67.js +37 -55
- package/dist/index.es67.js.map +1 -1
- package/dist/index.es68.js +11 -47
- package/dist/index.es68.js.map +1 -1
- package/dist/index.es69.js +14 -38
- package/dist/index.es69.js.map +1 -1
- package/dist/index.es70.js +29 -11
- package/dist/index.es70.js.map +1 -1
- package/dist/index.es71.js +10 -10
- package/dist/index.es71.js.map +1 -1
- package/dist/index.es72.js +13 -29
- package/dist/index.es72.js.map +1 -1
- package/dist/index.es73.js +10 -12
- package/dist/index.es73.js.map +1 -1
- package/dist/index.es74.js +4 -14
- package/dist/index.es74.js.map +1 -1
- package/dist/index.es75.js +2 -11
- package/dist/index.es75.js.map +1 -1
- package/dist/index.es76.js +107 -2
- package/dist/index.es76.js.map +1 -1
- package/dist/index.es77.js +10 -2
- package/dist/index.es77.js.map +1 -1
- package/dist/index.es78.js +1 -1
- package/dist/index.es79.js +1 -1
- package/dist/index.es80.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.es52.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as m from "react";
|
|
2
|
-
import p from "./index.
|
|
2
|
+
import p from "./index.es65.js";
|
|
3
|
+
import "./index.es66.js";
|
|
4
|
+
import "./index.es67.js";
|
|
3
5
|
import "./index.es68.js";
|
|
4
|
-
import "./index.es69.js";
|
|
6
|
+
import i from "./index.es69.js";
|
|
5
7
|
import "./index.es70.js";
|
|
6
|
-
import
|
|
8
|
+
import "./index.es71.js";
|
|
7
9
|
import "./index.es72.js";
|
|
8
10
|
import "./index.es73.js";
|
|
9
|
-
import "./index.es74.js";
|
|
10
|
-
import "./index.es75.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.es56.js
CHANGED
package/dist/index.es58.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import O from "./index.
|
|
2
|
-
import { GeoJSONReader as q, BufferOp as A, GeoJSONWriter as F } from "./index.
|
|
3
|
-
import { featureEach as v, geomEach as d } from "./index.
|
|
1
|
+
import O from "./index.es190.js";
|
|
2
|
+
import { GeoJSONReader as q, BufferOp as A, GeoJSONWriter as F } from "./index.es192.js";
|
|
3
|
+
import { featureEach as v, geomEach as d } from "./index.es191.js";
|
|
4
|
+
import "./index.es193.js";
|
|
4
5
|
import "./index.es194.js";
|
|
5
6
|
import "./index.es195.js";
|
|
6
7
|
import "./index.es196.js";
|
|
@@ -10,9 +11,8 @@ import "./index.es199.js";
|
|
|
10
11
|
import "./index.es200.js";
|
|
11
12
|
import "./index.es201.js";
|
|
12
13
|
import "./index.es202.js";
|
|
13
|
-
import "./index.es203.js";
|
|
14
|
-
import
|
|
15
|
-
import "./index.es205.js";
|
|
14
|
+
import R from "./index.es203.js";
|
|
15
|
+
import "./index.es204.js";
|
|
16
16
|
import { featureCollection as c, radiansToLength as g, lengthToRadians as B, feature as J, earthRadius as S } from "./index.es54.js";
|
|
17
17
|
function Y(r, e, t) {
|
|
18
18
|
t = t || {};
|
package/dist/index.es60.js
CHANGED
package/dist/index.es61.js
CHANGED
package/dist/index.es62.js
CHANGED
|
@@ -1,110 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
function v(e, t) {
|
|
5
|
-
if (e == null)
|
|
6
|
-
return {};
|
|
7
|
-
var r = p(e, t), n, i;
|
|
8
|
-
if (Object.getOwnPropertySymbols) {
|
|
9
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
10
|
-
for (i = 0; i < o.length; i++)
|
|
11
|
-
n = o[i], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n]);
|
|
12
|
-
}
|
|
13
|
-
return r;
|
|
14
|
-
}
|
|
15
|
-
function p(e, t) {
|
|
16
|
-
if (e == null)
|
|
17
|
-
return {};
|
|
18
|
-
var r = {}, n = Object.keys(e), i, o;
|
|
19
|
-
for (o = 0; o < n.length; o++)
|
|
20
|
-
i = n[o], !(t.indexOf(i) >= 0) && (r[i] = e[i]);
|
|
21
|
-
return r;
|
|
22
|
-
}
|
|
23
|
-
function c() {
|
|
24
|
-
return c = Object.assign ? Object.assign.bind() : function(e) {
|
|
25
|
-
for (var t = 1; t < arguments.length; t++) {
|
|
26
|
-
var r = arguments[t];
|
|
27
|
-
for (var n in r)
|
|
28
|
-
Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n]);
|
|
29
|
-
}
|
|
30
|
-
return e;
|
|
31
|
-
}, c.apply(this, arguments);
|
|
32
|
-
}
|
|
33
|
-
function m(e, t) {
|
|
34
|
-
var r = Object.keys(e);
|
|
35
|
-
if (Object.getOwnPropertySymbols) {
|
|
36
|
-
var n = Object.getOwnPropertySymbols(e);
|
|
37
|
-
t && (n = n.filter(function(i) {
|
|
38
|
-
return Object.getOwnPropertyDescriptor(e, i).enumerable;
|
|
39
|
-
})), r.push.apply(r, n);
|
|
40
|
-
}
|
|
41
|
-
return r;
|
|
42
|
-
}
|
|
43
|
-
function u(e) {
|
|
44
|
-
for (var t = 1; t < arguments.length; t++) {
|
|
45
|
-
var r = arguments[t] != null ? arguments[t] : {};
|
|
46
|
-
t % 2 ? m(Object(r), !0).forEach(function(n) {
|
|
47
|
-
j(e, n, r[n]);
|
|
48
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : m(Object(r)).forEach(function(n) {
|
|
49
|
-
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
return e;
|
|
53
|
-
}
|
|
54
|
-
function j(e, t, r) {
|
|
55
|
-
return t = P(t), t in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
|
|
56
|
-
}
|
|
57
|
-
function P(e) {
|
|
58
|
-
var t = h(e, "string");
|
|
59
|
-
return typeof t == "symbol" ? t : String(t);
|
|
60
|
-
}
|
|
61
|
-
function h(e, t) {
|
|
62
|
-
if (typeof e != "object" || e === null)
|
|
63
|
-
return e;
|
|
64
|
-
var r = e[Symbol.toPrimitive];
|
|
65
|
-
if (r !== void 0) {
|
|
66
|
-
var n = r.call(e, t || "default");
|
|
67
|
-
if (typeof n != "object")
|
|
68
|
-
return n;
|
|
69
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
70
|
-
}
|
|
71
|
-
return (t === "string" ? String : Number)(e);
|
|
72
|
-
}
|
|
73
|
-
function b(e) {
|
|
74
|
-
return e && e.map((t, r) => /* @__PURE__ */ l.createElement(t.tag, u({
|
|
75
|
-
key: r
|
|
76
|
-
}, t.attr), b(t.child)));
|
|
77
|
-
}
|
|
78
|
-
function _(e) {
|
|
79
|
-
return (t) => /* @__PURE__ */ l.createElement(d, c({
|
|
80
|
-
attr: u({}, e.attr)
|
|
81
|
-
}, t), b(e.child));
|
|
82
|
-
}
|
|
83
|
-
function d(e) {
|
|
84
|
-
var t = (r) => {
|
|
85
|
-
var {
|
|
86
|
-
attr: n,
|
|
87
|
-
size: i,
|
|
88
|
-
title: o
|
|
89
|
-
} = e, g = v(e, O), f = i || r.size || "1em", a;
|
|
90
|
-
return r.className && (a = r.className), e.className && (a = (a ? a + " " : "") + e.className), /* @__PURE__ */ l.createElement("svg", c({
|
|
91
|
-
stroke: "currentColor",
|
|
92
|
-
fill: "currentColor",
|
|
93
|
-
strokeWidth: "0"
|
|
94
|
-
}, r.attr, n, g, {
|
|
95
|
-
className: a,
|
|
96
|
-
style: u(u({
|
|
97
|
-
color: e.color || r.color
|
|
98
|
-
}, r.style), e.style),
|
|
99
|
-
height: f,
|
|
100
|
-
width: f,
|
|
101
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
102
|
-
}), o && /* @__PURE__ */ l.createElement("title", null, o), e.children);
|
|
103
|
-
};
|
|
104
|
-
return s !== void 0 ? /* @__PURE__ */ l.createElement(s.Consumer, null, (r) => t(r)) : t(y);
|
|
1
|
+
var o = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
2
|
+
function l(e) {
|
|
3
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
105
4
|
}
|
|
106
5
|
export {
|
|
107
|
-
|
|
108
|
-
|
|
6
|
+
o as commonjsGlobal,
|
|
7
|
+
l as getDefaultExportFromCjs
|
|
109
8
|
};
|
|
110
9
|
//# sourceMappingURL=index.es62.js.map
|
package/dist/index.es62.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es62.js","sources":[
|
|
1
|
+
{"version":3,"file":"index.es62.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
package/dist/index.es63.js
CHANGED
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
var t = {
|
|
3
|
-
color: void 0,
|
|
4
|
-
size: void 0,
|
|
5
|
-
className: void 0,
|
|
6
|
-
style: void 0,
|
|
7
|
-
attr: void 0
|
|
8
|
-
}, d = e.createContext && /* @__PURE__ */ e.createContext(t);
|
|
1
|
+
var e = { exports: {} };
|
|
9
2
|
export {
|
|
10
|
-
|
|
11
|
-
d as IconContext
|
|
3
|
+
e as __module
|
|
12
4
|
};
|
|
13
5
|
//# sourceMappingURL=index.es63.js.map
|
package/dist/index.es63.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es63.js","sources":[
|
|
1
|
+
{"version":3,"file":"index.es63.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/index.es64.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
var
|
|
2
|
-
function l(e) {
|
|
3
|
-
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
4
|
-
}
|
|
1
|
+
var a = { exports: {} };
|
|
5
2
|
export {
|
|
6
|
-
|
|
7
|
-
l as getDefaultExportFromCjs
|
|
3
|
+
a as __module
|
|
8
4
|
};
|
|
9
5
|
//# sourceMappingURL=index.es64.js.map
|
package/dist/index.es64.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es64.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.es64.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/index.es65.js
CHANGED
|
@@ -1,5 +1,58 @@
|
|
|
1
|
-
|
|
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.es73.js";
|
|
4
|
+
import m from "./index.es183.js";
|
|
5
|
+
import I from "./index.es184.js";
|
|
6
|
+
import C from "./index.es185.js";
|
|
7
|
+
import g from "./index.es186.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
|
+
}
|
|
2
54
|
export {
|
|
3
|
-
|
|
55
|
+
R as MapContext,
|
|
56
|
+
A as default
|
|
4
57
|
};
|
|
5
58
|
//# sourceMappingURL=index.es65.js.map
|
package/dist/index.es65.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es65.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
1
|
+
{"version":3,"file":"index.es65.js","sources":["../../../node_modules/react-map-gl/dist/esm/components/map.js"],"sourcesContent":["import * as React from 'react';\nimport { useState, useRef, useEffect, useContext, useMemo, useImperativeHandle } from 'react';\nimport { MountedMapsContext } from './use-map';\nimport Mapbox from '../mapbox/mapbox';\nimport createRef from '../mapbox/create-ref';\nimport useIsomorphicLayoutEffect from '../utils/use-isomorphic-layout-effect';\nimport setGlobals from '../utils/set-globals';\nexport const MapContext = React.createContext(null);\nexport default function Map(props, ref, defaultLib) {\n const mountedMapsContext = useContext(MountedMapsContext);\n const [mapInstance, setMapInstance] = useState(null);\n const containerRef = useRef();\n const { current: contextValue } = useRef({ mapLib: null, map: null });\n useEffect(() => {\n const mapLib = props.mapLib;\n let isMounted = true;\n let mapbox;\n Promise.resolve(mapLib || defaultLib)\n .then((module) => {\n if (!isMounted) {\n return;\n }\n if (!module) {\n throw new Error('Invalid mapLib');\n }\n const mapboxgl = 'Map' in module ? module : module.default;\n if (!mapboxgl.Map) {\n throw new Error('Invalid mapLib');\n }\n // workerUrl & workerClass may change the result of supported()\n // https://github.com/visgl/react-map-gl/discussions/2027\n setGlobals(mapboxgl, props);\n if (!mapboxgl.supported || mapboxgl.supported(props)) {\n if (props.reuseMaps) {\n mapbox = Mapbox.reuse(props, containerRef.current);\n }\n if (!mapbox) {\n mapbox = new Mapbox(mapboxgl.Map, props, containerRef.current);\n }\n contextValue.map = createRef(mapbox);\n contextValue.mapLib = mapboxgl;\n setMapInstance(mapbox);\n mountedMapsContext === null || mountedMapsContext === void 0 ? void 0 : mountedMapsContext.onMapMount(contextValue.map, props.id);\n }\n else {\n throw new Error('Map is not supported by this browser');\n }\n })\n .catch(error => {\n const { onError } = props;\n if (onError) {\n onError({\n type: 'error',\n target: null,\n originalEvent: null,\n error\n });\n }\n else {\n console.error(error); // eslint-disable-line\n }\n });\n return () => {\n isMounted = false;\n if (mapbox) {\n mountedMapsContext === null || mountedMapsContext === void 0 ? void 0 : mountedMapsContext.onMapUnmount(props.id);\n if (props.reuseMaps) {\n mapbox.recycle();\n }\n else {\n mapbox.destroy();\n }\n }\n };\n }, []);\n useIsomorphicLayoutEffect(() => {\n if (mapInstance) {\n mapInstance.setProps(props);\n }\n });\n useImperativeHandle(ref, () => contextValue.map, [mapInstance]);\n const style = useMemo(() => ({\n position: 'relative',\n width: '100%',\n height: '100%',\n ...props.style\n }), [props.style]);\n const CHILD_CONTAINER_STYLE = {\n height: '100%'\n };\n return (React.createElement(\"div\", { id: props.id, ref: containerRef, style: style }, mapInstance && (React.createElement(MapContext.Provider, { value: contextValue },\n React.createElement(\"div\", { \"mapboxgl-children\": \"\", style: CHILD_CONTAINER_STYLE }, props.children)))));\n}\n//# sourceMappingURL=map.js.map"],"names":["MapContext","React","Map","props","ref","defaultLib","mountedMapsContext","useContext","MountedMapsContext","mapInstance","setMapInstance","useState","containerRef","useRef","contextValue","useEffect","mapLib","isMounted","mapbox","module","mapboxgl","setGlobals","Mapbox","createRef","error","onError","useIsomorphicLayoutEffect","useImperativeHandle","style","useMemo","CHILD_CONTAINER_STYLE"],"mappings":";;;;;;;AAOa,MAAAA,IAAaC,EAAM,cAAc,IAAI;AAC1B,SAAAC,EAAIC,GAAOC,GAAKC,GAAY;AAC1C,QAAAC,IAAqBC,EAAWC,CAAkB,GAClD,CAACC,GAAaC,CAAc,IAAIC,EAAS,IAAI,GAC7CC,IAAeC,KACf,EAAE,SAASC,EAAA,IAAiBD,EAAO,EAAE,QAAQ,MAAM,KAAK,KAAA,CAAM;AACpE,EAAAE,EAAU,MAAM;AACZ,UAAMC,IAASb,EAAM;AACrB,QAAIc,IAAY,IACZC;AACJ,mBAAQ,QAAQF,KAAUX,CAAU,EAC/B,KAAK,CAACc,MAAW;AAClB,UAAI,CAACF;AACD;AAEJ,UAAI,CAACE;AACK,cAAA,IAAI,MAAM,gBAAgB;AAEpC,YAAMC,IAAW,SAASD,IAASA,IAASA,EAAO;AAC/C,UAAA,CAACC,EAAS;AACJ,cAAA,IAAI,MAAM,gBAAgB;AAKpC,UADAC,EAAWD,GAAUjB,CAAK,GACtB,CAACiB,EAAS,aAAaA,EAAS,UAAUjB,CAAK;AAC/C,QAAIA,EAAM,cACNe,IAASI,EAAO,MAAMnB,GAAOS,EAAa,OAAO,IAEhDM,MACDA,IAAS,IAAII,EAAOF,EAAS,KAAKjB,GAAOS,EAAa,OAAO,IAEpDE,EAAA,MAAMS,EAAUL,CAAM,GACnCJ,EAAa,SAASM,GACtBV,EAAeQ,CAAM,GACEZ,KAAA,QAAiDA,EAAmB,WAAWQ,EAAa,KAAKX,EAAM,EAAE;AAAA;AAG1H,cAAA,IAAI,MAAM,sCAAsC;AAAA,IAC1D,CACH,EACI,MAAM,CAASqB,MAAA;AACV,YAAA,EAAE,SAAAC,EAAY,IAAAtB;AACpB,MAAIsB,IACQA,EAAA;AAAA,QACJ,MAAM;AAAA,QACN,QAAQ;AAAA,QACR,eAAe;AAAA,QACf,OAAAD;AAAA,MAAA,CACH,IAGD,QAAQ,MAAMA,CAAK;AAAA,IACvB,CACH,GACM,MAAM;AACG,MAAAP,IAAA,IACRC,MACAZ,KAAuB,QAAiDA,EAAmB,aAAaH,EAAM,EAAE,GAC5GA,EAAM,YACNe,EAAO,QAAQ,IAGfA,EAAO,QAAQ;AAAA,IAEvB;AAAA,EAER,GAAG,CAAE,CAAA,GACLQ,EAA0B,MAAM;AAC5B,IAAIjB,KACAA,EAAY,SAASN,CAAK;AAAA,EAC9B,CACH,GACDwB,EAAoBvB,GAAK,MAAMU,EAAa,KAAK,CAACL,CAAW,CAAC;AACxD,QAAAmB,IAAQC,EAAQ,OAAO;AAAA,IACzB,UAAU;AAAA,IACV,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,GAAG1B,EAAM;AAAA,EACT,IAAA,CAACA,EAAM,KAAK,CAAC,GACX2B,IAAwB;AAAA,IAC1B,QAAQ;AAAA,EAAA;AAEZ,SAAQ7B,EAAM,cAAc,OAAO,EAAE,IAAIE,EAAM,IAAI,KAAKS,GAAc,OAAAgB,EAAgB,GAAAnB,KAAgBR,EAAM;AAAA,IAAcD,EAAW;AAAA,IAAU,EAAE,OAAOc,EAAa;AAAA,IACjKb,EAAM,cAAc,OAAO,EAAE,qBAAqB,IAAI,OAAO6B,EAAA,GAAyB3B,EAAM,QAAQ;AAAA,EAAA,CAAG;AAC/G;","x_google_ignoreList":[0]}
|
package/dist/index.es66.js
CHANGED
|
@@ -1,5 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
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.es187.js";
|
|
5
|
+
import { MapContext as O } from "./index.es65.js";
|
|
6
|
+
import { arePointsEqual as S } from "./index.es188.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));
|
|
5
49
|
//# sourceMappingURL=index.es66.js.map
|
package/dist/index.es66.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es66.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
1
|
+
{"version":3,"file":"index.es66.js","sources":["../../../node_modules/react-map-gl/dist/esm/components/marker.js"],"sourcesContent":["/* global document */\nimport * as React from 'react';\nimport { createPortal } from 'react-dom';\nimport { useImperativeHandle, useEffect, useMemo, useRef, useContext, forwardRef, memo } from 'react';\nimport { applyReactStyle } from '../utils/apply-react-style';\nimport { MapContext } from './map';\nimport { arePointsEqual } from '../utils/deep-equal';\n/* eslint-disable complexity,max-statements */\nfunction Marker(props, ref) {\n const { map, mapLib } = useContext(MapContext);\n const thisRef = useRef({ props });\n thisRef.current.props = props;\n const marker = useMemo(() => {\n let hasChildren = false;\n React.Children.forEach(props.children, el => {\n if (el) {\n hasChildren = true;\n }\n });\n const options = {\n ...props,\n element: hasChildren ? document.createElement('div') : null\n };\n const mk = new mapLib.Marker(options);\n mk.setLngLat([props.longitude, props.latitude]);\n mk.getElement().addEventListener('click', (e) => {\n var _a, _b;\n (_b = (_a = thisRef.current.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, {\n type: 'click',\n target: mk,\n originalEvent: e\n });\n });\n mk.on('dragstart', e => {\n var _a, _b;\n const evt = e;\n evt.lngLat = marker.getLngLat();\n (_b = (_a = thisRef.current.props).onDragStart) === null || _b === void 0 ? void 0 : _b.call(_a, evt);\n });\n mk.on('drag', e => {\n var _a, _b;\n const evt = e;\n evt.lngLat = marker.getLngLat();\n (_b = (_a = thisRef.current.props).onDrag) === null || _b === void 0 ? void 0 : _b.call(_a, evt);\n });\n mk.on('dragend', e => {\n var _a, _b;\n const evt = e;\n evt.lngLat = marker.getLngLat();\n (_b = (_a = thisRef.current.props).onDragEnd) === null || _b === void 0 ? void 0 : _b.call(_a, evt);\n });\n return mk;\n }, []);\n useEffect(() => {\n marker.addTo(map.getMap());\n return () => {\n marker.remove();\n };\n }, []);\n const { longitude, latitude, offset, style, draggable = false, popup = null, rotation = 0, rotationAlignment = 'auto', pitchAlignment = 'auto' } = props;\n useEffect(() => {\n applyReactStyle(marker.getElement(), style);\n }, [style]);\n useImperativeHandle(ref, () => marker, []);\n if (marker.getLngLat().lng !== longitude || marker.getLngLat().lat !== latitude) {\n marker.setLngLat([longitude, latitude]);\n }\n if (offset && !arePointsEqual(marker.getOffset(), offset)) {\n marker.setOffset(offset);\n }\n if (marker.isDraggable() !== draggable) {\n marker.setDraggable(draggable);\n }\n if (marker.getRotation() !== rotation) {\n marker.setRotation(rotation);\n }\n if (marker.getRotationAlignment() !== rotationAlignment) {\n marker.setRotationAlignment(rotationAlignment);\n }\n if (marker.getPitchAlignment() !== pitchAlignment) {\n marker.setPitchAlignment(pitchAlignment);\n }\n if (marker.getPopup() !== popup) {\n marker.setPopup(popup);\n }\n return createPortal(props.children, marker.getElement());\n}\nexport default memo(forwardRef(Marker));\n//# sourceMappingURL=marker.js.map"],"names":["Marker","props","ref","map","mapLib","useContext","MapContext","thisRef","useRef","marker","useMemo","hasChildren","React","el","options","mk","e","_a","_b","evt","useEffect","longitude","latitude","offset","style","draggable","popup","rotation","rotationAlignment","pitchAlignment","applyReactStyle","useImperativeHandle","arePointsEqual","createPortal","memo","forwardRef"],"mappings":";;;;;;AAQA,SAASA,EAAOC,GAAOC,GAAK;AACxB,QAAM,EAAE,KAAAC,GAAK,QAAAC,EAAO,IAAIC,EAAWC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":[0]}
|
package/dist/index.es67.js
CHANGED
|
@@ -1,58 +1,40 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
function
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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());
|
|
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.es187.js";
|
|
4
|
+
import { MapContext as O } from "./index.es65.js";
|
|
5
|
+
import { deepEqual as y } from "./index.es188.js";
|
|
6
|
+
function r(t) {
|
|
7
|
+
return new Set(t ? t.trim().split(/\s+/) : []);
|
|
8
|
+
}
|
|
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();
|
|
36
26
|
};
|
|
37
|
-
}, []),
|
|
38
|
-
|
|
39
|
-
}),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
));
|
|
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);
|
|
53
38
|
}
|
|
54
|
-
|
|
55
|
-
R as MapContext,
|
|
56
|
-
A as default
|
|
57
|
-
};
|
|
39
|
+
L(v(E));
|
|
58
40
|
//# sourceMappingURL=index.es67.js.map
|
package/dist/index.es67.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es67.js","sources":["../../../node_modules/react-map-gl/dist/esm/components/
|
|
1
|
+
{"version":3,"file":"index.es67.js","sources":["../../../node_modules/react-map-gl/dist/esm/components/popup.js"],"sourcesContent":["import { createPortal } from 'react-dom';\nimport { useImperativeHandle, useEffect, useMemo, useRef, useContext, forwardRef, memo } from 'react';\nimport { applyReactStyle } from '../utils/apply-react-style';\nimport { MapContext } from './map';\nimport { deepEqual } from '../utils/deep-equal';\n// Adapted from https://github.com/mapbox/mapbox-gl-js/blob/v1.13.0/src/ui/popup.js\nfunction getClassList(className) {\n return new Set(className ? className.trim().split(/\\s+/) : []);\n}\n/* eslint-disable complexity,max-statements */\nfunction Popup(props, ref) {\n const { map, mapLib } = useContext(MapContext);\n const container = useMemo(() => {\n return document.createElement('div');\n }, []);\n const thisRef = useRef({ props });\n thisRef.current.props = props;\n const popup = useMemo(() => {\n const options = { ...props };\n const pp = new mapLib.Popup(options);\n pp.setLngLat([props.longitude, props.latitude]);\n pp.once('open', e => {\n var _a, _b;\n (_b = (_a = thisRef.current.props).onOpen) === null || _b === void 0 ? void 0 : _b.call(_a, e);\n });\n return pp;\n }, []);\n useEffect(() => {\n const onClose = e => {\n var _a, _b;\n (_b = (_a = thisRef.current.props).onClose) === null || _b === void 0 ? void 0 : _b.call(_a, e);\n };\n popup.on('close', onClose);\n popup.setDOMContent(container).addTo(map.getMap());\n return () => {\n // https://github.com/visgl/react-map-gl/issues/1825\n // onClose should not be fired if the popup is removed by unmounting\n // When using React strict mode, the component is mounted twice.\n // Firing the onClose callback here would be a false signal to remove the component.\n popup.off('close', onClose);\n if (popup.isOpen()) {\n popup.remove();\n }\n };\n }, []);\n useEffect(() => {\n applyReactStyle(popup.getElement(), props.style);\n }, [props.style]);\n useImperativeHandle(ref, () => popup, []);\n if (popup.isOpen()) {\n if (popup.getLngLat().lng !== props.longitude || popup.getLngLat().lat !== props.latitude) {\n popup.setLngLat([props.longitude, props.latitude]);\n }\n if (props.offset && !deepEqual(popup.options.offset, props.offset)) {\n popup.setOffset(props.offset);\n }\n if (popup.options.anchor !== props.anchor || popup.options.maxWidth !== props.maxWidth) {\n popup.options.anchor = props.anchor;\n popup.setMaxWidth(props.maxWidth);\n }\n if (popup.options.className !== props.className) {\n const prevClassList = getClassList(popup.options.className);\n const nextClassList = getClassList(props.className);\n for (const c of prevClassList) {\n if (!nextClassList.has(c)) {\n popup.removeClassName(c);\n }\n }\n for (const c of nextClassList) {\n if (!prevClassList.has(c)) {\n popup.addClassName(c);\n }\n }\n popup.options.className = props.className;\n }\n }\n return createPortal(props.children, container);\n}\nexport default memo(forwardRef(Popup));\n//# sourceMappingURL=popup.js.map"],"names":["getClassList","className","Popup","props","ref","map","mapLib","useContext","MapContext","container","useMemo","thisRef","useRef","popup","options","pp","e","_a","_b","useEffect","onClose","applyReactStyle","useImperativeHandle","deepEqual","prevClassList","nextClassList","c","createPortal","memo","forwardRef"],"mappings":";;;;;AAMA,SAASA,EAAaC,GAAW;AACtB,SAAA,IAAI,IAAIA,IAAYA,EAAU,OAAO,MAAM,KAAK,IAAI,CAAA,CAAE;AACjE;AAEA,SAASC,EAAMC,GAAOC,GAAK;AACvB,QAAM,EAAE,KAAAC,GAAK,QAAAC,EAAO,IAAIC,EAAWC,CAAU,GACvCC,IAAYC,EAAQ,MACf,SAAS,cAAc,KAAK,GACpC,CAAE,CAAA,GACCC,IAAUC,EAAO,EAAE,OAAAT,EAAO,CAAA;AAChC,EAAAQ,EAAQ,QAAQ,QAAQR;AAClB,QAAAU,IAAQH,EAAQ,MAAM;AAClB,UAAAI,IAAU,EAAE,GAAGX,KACfY,IAAK,IAAIT,EAAO,MAAMQ,CAAO;AACnC,WAAAC,EAAG,UAAU,CAACZ,EAAM,WAAWA,EAAM,QAAQ,CAAC,GAC3CY,EAAA,KAAK,QAAQ,CAAKC,MAAA;AACjB,UAAIC,GAAIC;AACR,O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AWuB,KAAKF;AACZ,MAAKC,EAAc,IAAIC,CAAC,KACpBb,EAAM,gBAAgBa,CAAC;AAG/B,eAAWA,KAAKD;AACZ,MAAKD,EAAc,IAAIE,CAAC,KACpBb,EAAM,aAAaa,CAAC;AAGtB,IAAAb,EAAA,QAAQ,YAAYV,EAAM;AAAA,EACpC;AAEG,SAAAwB,EAAaxB,EAAM,UAAUM,CAAS;AACjD;AACemB,EAAKC,EAAW3B,CAAK,CAAC;","x_google_ignoreList":[0]}
|
package/dist/index.es68.js
CHANGED
|
@@ -1,49 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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());
|
|
1
|
+
import { memo as i, useEffect as r } from "react";
|
|
2
|
+
import { applyReactStyle as e } from "./index.es187.js";
|
|
3
|
+
import l from "./index.es16.js";
|
|
4
|
+
function m(t) {
|
|
5
|
+
const o = l(({ mapLib: n }) => new n.AttributionControl(t), {
|
|
6
|
+
position: t.position
|
|
7
|
+
});
|
|
8
|
+
return r(() => {
|
|
9
|
+
e(o._container, t.style);
|
|
10
|
+
}, [t.style]), null;
|
|
47
11
|
}
|
|
48
|
-
|
|
12
|
+
i(m);
|
|
49
13
|
//# sourceMappingURL=index.es68.js.map
|