@antv/l7-mapkit 0.1.0
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/README.md +165 -0
- package/dist/component/Control/CustomControl.d.ts +22 -0
- package/dist/component/Control/ExportImageControl.d.ts +36 -0
- package/dist/component/Control/FullscreenControl.d.ts +38 -0
- package/dist/component/Control/GeoLocateControl.d.ts +34 -0
- package/dist/component/Control/MapThemeControl.d.ts +56 -0
- package/dist/component/Control/MouseLocationControl.d.ts +30 -0
- package/dist/component/Control/ScaleControl.d.ts +36 -0
- package/dist/component/Control/ZoomControl.d.ts +34 -0
- package/dist/component/Control/types.d.ts +17 -0
- package/dist/component/Control.d.ts +44 -0
- package/dist/component/CustomControl.d.ts +32 -0
- package/dist/component/Layer.d.ts +79 -0
- package/dist/component/LayerAttribute/BaseLayer.d.ts +14 -0
- package/dist/component/LayerAttribute/index.d.ts +136 -0
- package/dist/component/LayerContext.d.ts +29 -0
- package/dist/component/Legend/LegendCategories.d.ts +26 -0
- package/dist/component/Legend/LegendIcon.d.ts +26 -0
- package/dist/component/Legend/LegendProportion.d.ts +19 -0
- package/dist/component/Legend/LegendRamp.d.ts +23 -0
- package/dist/component/LoadImage.d.ts +49 -0
- package/dist/component/MapScene/GaodeMapScene.d.ts +17 -0
- package/dist/component/MapScene/MapScene.d.ts +18 -0
- package/dist/component/MapScene/interface.d.ts +31 -0
- package/dist/component/Marker.d.ts +40 -0
- package/dist/component/MarkerLayer.d.ts +56 -0
- package/dist/component/Popup.d.ts +36 -0
- package/dist/component/SceneContext.d.ts +32 -0
- package/dist/index.d.ts +67 -0
- package/dist/l7-mapkit.js +1218 -0
- package/dist/l7-mapkit.umd.cjs +16 -0
- package/dist/utils/style.d.ts +7 -0
- package/package.json +69 -0
|
@@ -0,0 +1,1218 @@
|
|
|
1
|
+
import { CityBuildingLayer as e, Control as t, ExportImage as n, Fullscreen as r, GeoLocate as i, HeatmapLayer as a, ImageLayer as o, LayerSwitch as s, LineLayer as c, Logo as l, MapTheme as u, Marker as d, MarkerLayer as f, MouseLocation as p, PointLayer as m, PolygonLayer as h, Popup as g, RasterLayer as _, Scale as v, Scene as y, Swipe as b, Zoom as x } from "@antv/l7";
|
|
2
|
+
import { GaodeMap as S, Map as C } from "@antv/l7-maps";
|
|
3
|
+
import w, { createContext as T, useContext as E, useEffect as D, useId as O, useMemo as k, useRef as A, useState as j } from "react";
|
|
4
|
+
import { createPortal as M } from "react-dom";
|
|
5
|
+
//#region \0rolldown/runtime.js
|
|
6
|
+
var N = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), P = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
|
|
7
|
+
if (typeof require < "u") return require.apply(this, arguments);
|
|
8
|
+
throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
9
|
+
}), F = T(void 0);
|
|
10
|
+
function I() {
|
|
11
|
+
let e = E(F);
|
|
12
|
+
if (!e) throw Error("useScene must be used within a GaodeMapScene or MapScene component");
|
|
13
|
+
return e;
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region node_modules/react/cjs/react-jsx-runtime.production.min.js
|
|
17
|
+
var L = /* @__PURE__ */ N(((e) => {
|
|
18
|
+
var t = P("react"), n = Symbol.for("react.element"), r = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, a = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = {
|
|
19
|
+
key: !0,
|
|
20
|
+
ref: !0,
|
|
21
|
+
__self: !0,
|
|
22
|
+
__source: !0
|
|
23
|
+
};
|
|
24
|
+
function s(e, t, r) {
|
|
25
|
+
var s, c = {}, l = null, u = null;
|
|
26
|
+
for (s in r !== void 0 && (l = "" + r), t.key !== void 0 && (l = "" + t.key), t.ref !== void 0 && (u = t.ref), t) i.call(t, s) && !o.hasOwnProperty(s) && (c[s] = t[s]);
|
|
27
|
+
if (e && e.defaultProps) for (s in t = e.defaultProps, t) c[s] === void 0 && (c[s] = t[s]);
|
|
28
|
+
return {
|
|
29
|
+
$$typeof: n,
|
|
30
|
+
type: e,
|
|
31
|
+
key: l,
|
|
32
|
+
ref: u,
|
|
33
|
+
props: c,
|
|
34
|
+
_owner: a.current
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
e.Fragment = r, e.jsx = s, e.jsxs = s;
|
|
38
|
+
})), R = /* @__PURE__ */ N(((e) => {
|
|
39
|
+
process.env.NODE_ENV !== "production" && (function() {
|
|
40
|
+
var t = P("react"), n = Symbol.for("react.element"), r = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), s = Symbol.for("react.provider"), c = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), u = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), f = Symbol.for("react.memo"), p = Symbol.for("react.lazy"), m = Symbol.for("react.offscreen"), h = Symbol.iterator, g = "@@iterator";
|
|
41
|
+
function _(e) {
|
|
42
|
+
if (typeof e != "object" || !e) return null;
|
|
43
|
+
var t = h && e[h] || e[g];
|
|
44
|
+
return typeof t == "function" ? t : null;
|
|
45
|
+
}
|
|
46
|
+
var v = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
47
|
+
function y(e) {
|
|
48
|
+
b("error", e, [...arguments].slice(1));
|
|
49
|
+
}
|
|
50
|
+
function b(e, t, n) {
|
|
51
|
+
var r = v.ReactDebugCurrentFrame.getStackAddendum();
|
|
52
|
+
r !== "" && (t += "%s", n = n.concat([r]));
|
|
53
|
+
var i = n.map(function(e) {
|
|
54
|
+
return String(e);
|
|
55
|
+
});
|
|
56
|
+
i.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, i);
|
|
57
|
+
}
|
|
58
|
+
var x = !1, S = !1, C = !1, w = !1, T = !1, E = Symbol.for("react.module.reference");
|
|
59
|
+
function D(e) {
|
|
60
|
+
return !!(typeof e == "string" || typeof e == "function" || e === i || e === o || T || e === a || e === u || e === d || w || e === m || x || S || C || typeof e == "object" && e && (e.$$typeof === p || e.$$typeof === f || e.$$typeof === s || e.$$typeof === c || e.$$typeof === l || e.$$typeof === E || e.getModuleId !== void 0));
|
|
61
|
+
}
|
|
62
|
+
function O(e, t, n) {
|
|
63
|
+
var r = e.displayName;
|
|
64
|
+
if (r) return r;
|
|
65
|
+
var i = t.displayName || t.name || "";
|
|
66
|
+
return i === "" ? n : n + "(" + i + ")";
|
|
67
|
+
}
|
|
68
|
+
function k(e) {
|
|
69
|
+
return e.displayName || "Context";
|
|
70
|
+
}
|
|
71
|
+
function A(e) {
|
|
72
|
+
if (e == null) return null;
|
|
73
|
+
if (typeof e.tag == "number" && y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function") return e.displayName || e.name || null;
|
|
74
|
+
if (typeof e == "string") return e;
|
|
75
|
+
switch (e) {
|
|
76
|
+
case i: return "Fragment";
|
|
77
|
+
case r: return "Portal";
|
|
78
|
+
case o: return "Profiler";
|
|
79
|
+
case a: return "StrictMode";
|
|
80
|
+
case u: return "Suspense";
|
|
81
|
+
case d: return "SuspenseList";
|
|
82
|
+
}
|
|
83
|
+
if (typeof e == "object") switch (e.$$typeof) {
|
|
84
|
+
case c: return k(e) + ".Consumer";
|
|
85
|
+
case s: return k(e._context) + ".Provider";
|
|
86
|
+
case l: return O(e, e.render, "ForwardRef");
|
|
87
|
+
case f:
|
|
88
|
+
var t = e.displayName || null;
|
|
89
|
+
return t === null ? A(e.type) || "Memo" : t;
|
|
90
|
+
case p:
|
|
91
|
+
var n = e, m = n._payload, h = n._init;
|
|
92
|
+
try {
|
|
93
|
+
return A(h(m));
|
|
94
|
+
} catch {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
var j = Object.assign, M = 0, N, F, I, L, R, z, B;
|
|
101
|
+
function V() {}
|
|
102
|
+
V.__reactDisabledLog = !0;
|
|
103
|
+
function H() {
|
|
104
|
+
if (M === 0) {
|
|
105
|
+
N = console.log, F = console.info, I = console.warn, L = console.error, R = console.group, z = console.groupCollapsed, B = console.groupEnd;
|
|
106
|
+
var e = {
|
|
107
|
+
configurable: !0,
|
|
108
|
+
enumerable: !0,
|
|
109
|
+
value: V,
|
|
110
|
+
writable: !0
|
|
111
|
+
};
|
|
112
|
+
Object.defineProperties(console, {
|
|
113
|
+
info: e,
|
|
114
|
+
log: e,
|
|
115
|
+
warn: e,
|
|
116
|
+
error: e,
|
|
117
|
+
group: e,
|
|
118
|
+
groupCollapsed: e,
|
|
119
|
+
groupEnd: e
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
M++;
|
|
123
|
+
}
|
|
124
|
+
function ee() {
|
|
125
|
+
if (M--, M === 0) {
|
|
126
|
+
var e = {
|
|
127
|
+
configurable: !0,
|
|
128
|
+
enumerable: !0,
|
|
129
|
+
writable: !0
|
|
130
|
+
};
|
|
131
|
+
Object.defineProperties(console, {
|
|
132
|
+
log: j({}, e, { value: N }),
|
|
133
|
+
info: j({}, e, { value: F }),
|
|
134
|
+
warn: j({}, e, { value: I }),
|
|
135
|
+
error: j({}, e, { value: L }),
|
|
136
|
+
group: j({}, e, { value: R }),
|
|
137
|
+
groupCollapsed: j({}, e, { value: z }),
|
|
138
|
+
groupEnd: j({}, e, { value: B })
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
M < 0 && y("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
142
|
+
}
|
|
143
|
+
var U = v.ReactCurrentDispatcher, W;
|
|
144
|
+
function G(e, t, n) {
|
|
145
|
+
if (W === void 0) try {
|
|
146
|
+
throw Error();
|
|
147
|
+
} catch (e) {
|
|
148
|
+
var r = e.stack.trim().match(/\n( *(at )?)/);
|
|
149
|
+
W = r && r[1] || "";
|
|
150
|
+
}
|
|
151
|
+
return "\n" + W + e;
|
|
152
|
+
}
|
|
153
|
+
var K = !1, q = new (typeof WeakMap == "function" ? WeakMap : Map)();
|
|
154
|
+
function te(e, t) {
|
|
155
|
+
if (!e || K) return "";
|
|
156
|
+
var n = q.get(e);
|
|
157
|
+
if (n !== void 0) return n;
|
|
158
|
+
var r;
|
|
159
|
+
K = !0;
|
|
160
|
+
var i = Error.prepareStackTrace;
|
|
161
|
+
Error.prepareStackTrace = void 0;
|
|
162
|
+
var a = U.current;
|
|
163
|
+
U.current = null, H();
|
|
164
|
+
try {
|
|
165
|
+
if (t) {
|
|
166
|
+
var o = function() {
|
|
167
|
+
throw Error();
|
|
168
|
+
};
|
|
169
|
+
if (Object.defineProperty(o.prototype, "props", { set: function() {
|
|
170
|
+
throw Error();
|
|
171
|
+
} }), typeof Reflect == "object" && Reflect.construct) {
|
|
172
|
+
try {
|
|
173
|
+
Reflect.construct(o, []);
|
|
174
|
+
} catch (e) {
|
|
175
|
+
r = e;
|
|
176
|
+
}
|
|
177
|
+
Reflect.construct(e, [], o);
|
|
178
|
+
} else {
|
|
179
|
+
try {
|
|
180
|
+
o.call();
|
|
181
|
+
} catch (e) {
|
|
182
|
+
r = e;
|
|
183
|
+
}
|
|
184
|
+
e.call(o.prototype);
|
|
185
|
+
}
|
|
186
|
+
} else {
|
|
187
|
+
try {
|
|
188
|
+
throw Error();
|
|
189
|
+
} catch (e) {
|
|
190
|
+
r = e;
|
|
191
|
+
}
|
|
192
|
+
e();
|
|
193
|
+
}
|
|
194
|
+
} catch (t) {
|
|
195
|
+
if (t && r && typeof t.stack == "string") {
|
|
196
|
+
for (var s = t.stack.split("\n"), c = r.stack.split("\n"), l = s.length - 1, u = c.length - 1; l >= 1 && u >= 0 && s[l] !== c[u];) u--;
|
|
197
|
+
for (; l >= 1 && u >= 0; l--, u--) if (s[l] !== c[u]) {
|
|
198
|
+
if (l !== 1 || u !== 1) do
|
|
199
|
+
if (l--, u--, u < 0 || s[l] !== c[u]) {
|
|
200
|
+
var d = "\n" + s[l].replace(" at new ", " at ");
|
|
201
|
+
return e.displayName && d.includes("<anonymous>") && (d = d.replace("<anonymous>", e.displayName)), typeof e == "function" && q.set(e, d), d;
|
|
202
|
+
}
|
|
203
|
+
while (l >= 1 && u >= 0);
|
|
204
|
+
break;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
} finally {
|
|
208
|
+
K = !1, U.current = a, ee(), Error.prepareStackTrace = i;
|
|
209
|
+
}
|
|
210
|
+
var f = e ? e.displayName || e.name : "", p = f ? G(f) : "";
|
|
211
|
+
return typeof e == "function" && q.set(e, p), p;
|
|
212
|
+
}
|
|
213
|
+
function ne(e, t, n) {
|
|
214
|
+
return te(e, !1);
|
|
215
|
+
}
|
|
216
|
+
function re(e) {
|
|
217
|
+
var t = e.prototype;
|
|
218
|
+
return !!(t && t.isReactComponent);
|
|
219
|
+
}
|
|
220
|
+
function J(e, t, n) {
|
|
221
|
+
if (e == null) return "";
|
|
222
|
+
if (typeof e == "function") return te(e, re(e));
|
|
223
|
+
if (typeof e == "string") return G(e);
|
|
224
|
+
switch (e) {
|
|
225
|
+
case u: return G("Suspense");
|
|
226
|
+
case d: return G("SuspenseList");
|
|
227
|
+
}
|
|
228
|
+
if (typeof e == "object") switch (e.$$typeof) {
|
|
229
|
+
case l: return ne(e.render);
|
|
230
|
+
case f: return J(e.type, t, n);
|
|
231
|
+
case p:
|
|
232
|
+
var r = e, i = r._payload, a = r._init;
|
|
233
|
+
try {
|
|
234
|
+
return J(a(i), t, n);
|
|
235
|
+
} catch {}
|
|
236
|
+
}
|
|
237
|
+
return "";
|
|
238
|
+
}
|
|
239
|
+
var Y = Object.prototype.hasOwnProperty, ie = {}, ae = v.ReactDebugCurrentFrame;
|
|
240
|
+
function X(e) {
|
|
241
|
+
if (e) {
|
|
242
|
+
var t = e._owner, n = J(e.type, e._source, t ? t.type : null);
|
|
243
|
+
ae.setExtraStackFrame(n);
|
|
244
|
+
} else ae.setExtraStackFrame(null);
|
|
245
|
+
}
|
|
246
|
+
function oe(e, t, n, r, i) {
|
|
247
|
+
var a = Function.call.bind(Y);
|
|
248
|
+
for (var o in e) if (a(e, o)) {
|
|
249
|
+
var s = void 0;
|
|
250
|
+
try {
|
|
251
|
+
if (typeof e[o] != "function") {
|
|
252
|
+
var c = Error((r || "React class") + ": " + n + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
253
|
+
throw c.name = "Invariant Violation", c;
|
|
254
|
+
}
|
|
255
|
+
s = e[o](t, o, r, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
256
|
+
} catch (e) {
|
|
257
|
+
s = e;
|
|
258
|
+
}
|
|
259
|
+
s && !(s instanceof Error) && (X(i), y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", r || "React class", n, o, typeof s), X(null)), s instanceof Error && !(s.message in ie) && (ie[s.message] = !0, X(i), y("Failed %s type: %s", n, s.message), X(null));
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
var se = Array.isArray;
|
|
263
|
+
function Z(e) {
|
|
264
|
+
return se(e);
|
|
265
|
+
}
|
|
266
|
+
function ce(e) {
|
|
267
|
+
return typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
268
|
+
}
|
|
269
|
+
function le(e) {
|
|
270
|
+
try {
|
|
271
|
+
return ue(e), !1;
|
|
272
|
+
} catch {
|
|
273
|
+
return !0;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
function ue(e) {
|
|
277
|
+
return "" + e;
|
|
278
|
+
}
|
|
279
|
+
function de(e) {
|
|
280
|
+
if (le(e)) return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ce(e)), ue(e);
|
|
281
|
+
}
|
|
282
|
+
var Q = v.ReactCurrentOwner, fe = {
|
|
283
|
+
key: !0,
|
|
284
|
+
ref: !0,
|
|
285
|
+
__self: !0,
|
|
286
|
+
__source: !0
|
|
287
|
+
}, pe, me, he = {};
|
|
288
|
+
function ge(e) {
|
|
289
|
+
if (Y.call(e, "ref")) {
|
|
290
|
+
var t = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
291
|
+
if (t && t.isReactWarning) return !1;
|
|
292
|
+
}
|
|
293
|
+
return e.ref !== void 0;
|
|
294
|
+
}
|
|
295
|
+
function _e(e) {
|
|
296
|
+
if (Y.call(e, "key")) {
|
|
297
|
+
var t = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
298
|
+
if (t && t.isReactWarning) return !1;
|
|
299
|
+
}
|
|
300
|
+
return e.key !== void 0;
|
|
301
|
+
}
|
|
302
|
+
function ve(e, t) {
|
|
303
|
+
if (typeof e.ref == "string" && Q.current && t && Q.current.stateNode !== t) {
|
|
304
|
+
var n = A(Q.current.type);
|
|
305
|
+
he[n] || (y("Component \"%s\" contains the string ref \"%s\". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref", A(Q.current.type), e.ref), he[n] = !0);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
function ye(e, t) {
|
|
309
|
+
var n = function() {
|
|
310
|
+
pe || (pe = !0, y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
|
|
311
|
+
};
|
|
312
|
+
n.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
313
|
+
get: n,
|
|
314
|
+
configurable: !0
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
function be(e, t) {
|
|
318
|
+
var n = function() {
|
|
319
|
+
me || (me = !0, y("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
|
|
320
|
+
};
|
|
321
|
+
n.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
322
|
+
get: n,
|
|
323
|
+
configurable: !0
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
var xe = function(e, t, r, i, a, o, s) {
|
|
327
|
+
var c = {
|
|
328
|
+
$$typeof: n,
|
|
329
|
+
type: e,
|
|
330
|
+
key: t,
|
|
331
|
+
ref: r,
|
|
332
|
+
props: s,
|
|
333
|
+
_owner: o
|
|
334
|
+
};
|
|
335
|
+
return c._store = {}, Object.defineProperty(c._store, "validated", {
|
|
336
|
+
configurable: !1,
|
|
337
|
+
enumerable: !1,
|
|
338
|
+
writable: !0,
|
|
339
|
+
value: !1
|
|
340
|
+
}), Object.defineProperty(c, "_self", {
|
|
341
|
+
configurable: !1,
|
|
342
|
+
enumerable: !1,
|
|
343
|
+
writable: !1,
|
|
344
|
+
value: i
|
|
345
|
+
}), Object.defineProperty(c, "_source", {
|
|
346
|
+
configurable: !1,
|
|
347
|
+
enumerable: !1,
|
|
348
|
+
writable: !1,
|
|
349
|
+
value: a
|
|
350
|
+
}), Object.freeze && (Object.freeze(c.props), Object.freeze(c)), c;
|
|
351
|
+
};
|
|
352
|
+
function Se(e, t, n, r, i) {
|
|
353
|
+
var a, o = {}, s = null, c = null;
|
|
354
|
+
for (a in n !== void 0 && (de(n), s = "" + n), _e(t) && (de(t.key), s = "" + t.key), ge(t) && (c = t.ref, ve(t, i)), t) Y.call(t, a) && !fe.hasOwnProperty(a) && (o[a] = t[a]);
|
|
355
|
+
if (e && e.defaultProps) {
|
|
356
|
+
var l = e.defaultProps;
|
|
357
|
+
for (a in l) o[a] === void 0 && (o[a] = l[a]);
|
|
358
|
+
}
|
|
359
|
+
if (s || c) {
|
|
360
|
+
var u = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
361
|
+
s && ye(o, u), c && be(o, u);
|
|
362
|
+
}
|
|
363
|
+
return xe(e, s, c, i, r, Q.current, o);
|
|
364
|
+
}
|
|
365
|
+
var Ce = v.ReactCurrentOwner, we = v.ReactDebugCurrentFrame;
|
|
366
|
+
function $(e) {
|
|
367
|
+
if (e) {
|
|
368
|
+
var t = e._owner, n = J(e.type, e._source, t ? t.type : null);
|
|
369
|
+
we.setExtraStackFrame(n);
|
|
370
|
+
} else we.setExtraStackFrame(null);
|
|
371
|
+
}
|
|
372
|
+
var Te = !1;
|
|
373
|
+
function Ee(e) {
|
|
374
|
+
return typeof e == "object" && !!e && e.$$typeof === n;
|
|
375
|
+
}
|
|
376
|
+
function De() {
|
|
377
|
+
if (Ce.current) {
|
|
378
|
+
var e = A(Ce.current.type);
|
|
379
|
+
if (e) return "\n\nCheck the render method of `" + e + "`.";
|
|
380
|
+
}
|
|
381
|
+
return "";
|
|
382
|
+
}
|
|
383
|
+
function Oe(e) {
|
|
384
|
+
if (e !== void 0) {
|
|
385
|
+
var t = e.fileName.replace(/^.*[\\\/]/, ""), n = e.lineNumber;
|
|
386
|
+
return "\n\nCheck your code at " + t + ":" + n + ".";
|
|
387
|
+
}
|
|
388
|
+
return "";
|
|
389
|
+
}
|
|
390
|
+
var ke = {};
|
|
391
|
+
function Ae(e) {
|
|
392
|
+
var t = De();
|
|
393
|
+
if (!t) {
|
|
394
|
+
var n = typeof e == "string" ? e : e.displayName || e.name;
|
|
395
|
+
n && (t = "\n\nCheck the top-level render call using <" + n + ">.");
|
|
396
|
+
}
|
|
397
|
+
return t;
|
|
398
|
+
}
|
|
399
|
+
function je(e, t) {
|
|
400
|
+
if (!(!e._store || e._store.validated || e.key != null)) {
|
|
401
|
+
e._store.validated = !0;
|
|
402
|
+
var n = Ae(t);
|
|
403
|
+
if (!ke[n]) {
|
|
404
|
+
ke[n] = !0;
|
|
405
|
+
var r = "";
|
|
406
|
+
e && e._owner && e._owner !== Ce.current && (r = " It was passed a child from " + A(e._owner.type) + "."), $(e), y("Each child in a list should have a unique \"key\" prop.%s%s See https://reactjs.org/link/warning-keys for more information.", n, r), $(null);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
function Me(e, t) {
|
|
411
|
+
if (typeof e == "object") {
|
|
412
|
+
if (Z(e)) for (var n = 0; n < e.length; n++) {
|
|
413
|
+
var r = e[n];
|
|
414
|
+
Ee(r) && je(r, t);
|
|
415
|
+
}
|
|
416
|
+
else if (Ee(e)) e._store && (e._store.validated = !0);
|
|
417
|
+
else if (e) {
|
|
418
|
+
var i = _(e);
|
|
419
|
+
if (typeof i == "function" && i !== e.entries) for (var a = i.call(e), o; !(o = a.next()).done;) Ee(o.value) && je(o.value, t);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
function Ne(e) {
|
|
424
|
+
var t = e.type;
|
|
425
|
+
if (!(t == null || typeof t == "string")) {
|
|
426
|
+
var n;
|
|
427
|
+
if (typeof t == "function") n = t.propTypes;
|
|
428
|
+
else if (typeof t == "object" && (t.$$typeof === l || t.$$typeof === f)) n = t.propTypes;
|
|
429
|
+
else return;
|
|
430
|
+
if (n) {
|
|
431
|
+
var r = A(t);
|
|
432
|
+
oe(n, e.props, "prop", r, e);
|
|
433
|
+
} else t.PropTypes !== void 0 && !Te && (Te = !0, y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", A(t) || "Unknown"));
|
|
434
|
+
typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved && y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
function Pe(e) {
|
|
438
|
+
for (var t = Object.keys(e.props), n = 0; n < t.length; n++) {
|
|
439
|
+
var r = t[n];
|
|
440
|
+
if (r !== "children" && r !== "key") {
|
|
441
|
+
$(e), y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", r), $(null);
|
|
442
|
+
break;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
e.ref !== null && ($(e), y("Invalid attribute `ref` supplied to `React.Fragment`."), $(null));
|
|
446
|
+
}
|
|
447
|
+
var Fe = {};
|
|
448
|
+
function Ie(e, t, r, a, o, s) {
|
|
449
|
+
var c = D(e);
|
|
450
|
+
if (!c) {
|
|
451
|
+
var l = "";
|
|
452
|
+
(e === void 0 || typeof e == "object" && e && Object.keys(e).length === 0) && (l += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
453
|
+
var u = Oe(o);
|
|
454
|
+
u ? l += u : l += De();
|
|
455
|
+
var d;
|
|
456
|
+
e === null ? d = "null" : Z(e) ? d = "array" : e !== void 0 && e.$$typeof === n ? (d = "<" + (A(e.type) || "Unknown") + " />", l = " Did you accidentally export a JSX literal instead of a component?") : d = typeof e, y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", d, l);
|
|
457
|
+
}
|
|
458
|
+
var f = Se(e, t, r, o, s);
|
|
459
|
+
if (f == null) return f;
|
|
460
|
+
if (c) {
|
|
461
|
+
var p = t.children;
|
|
462
|
+
if (p !== void 0) if (a) if (Z(p)) {
|
|
463
|
+
for (var m = 0; m < p.length; m++) Me(p[m], e);
|
|
464
|
+
Object.freeze && Object.freeze(p);
|
|
465
|
+
} else y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
466
|
+
else Me(p, e);
|
|
467
|
+
}
|
|
468
|
+
if (Y.call(t, "key")) {
|
|
469
|
+
var h = A(e), g = Object.keys(t).filter(function(e) {
|
|
470
|
+
return e !== "key";
|
|
471
|
+
}), _ = g.length > 0 ? "{key: someKey, " + g.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
472
|
+
Fe[h + _] || (y("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", _, h, g.length > 0 ? "{" + g.join(": ..., ") + ": ...}" : "{}", h), Fe[h + _] = !0);
|
|
473
|
+
}
|
|
474
|
+
return e === i ? Pe(f) : Ne(f), f;
|
|
475
|
+
}
|
|
476
|
+
function Le(e, t, n) {
|
|
477
|
+
return Ie(e, t, n, !0);
|
|
478
|
+
}
|
|
479
|
+
function Re(e, t, n) {
|
|
480
|
+
return Ie(e, t, n, !1);
|
|
481
|
+
}
|
|
482
|
+
var ze = Re, Be = Le;
|
|
483
|
+
e.Fragment = i, e.jsx = ze, e.jsxs = Be;
|
|
484
|
+
})();
|
|
485
|
+
})), z = (/* @__PURE__ */ N(((e, t) => {
|
|
486
|
+
process.env.NODE_ENV === "production" ? t.exports = L() : t.exports = R();
|
|
487
|
+
})))();
|
|
488
|
+
function B(e) {
|
|
489
|
+
let { style: t, className: n, mapConfig: r, sceneConfig: i, onLoaded: a, onClick: o, onMouseMove: s, onZoomChange: c, children: l } = e, u = `l7-mapkit-gaode-${O().replace(/:/g, "")}`, d = A(null), f = A(null), p = A(!1), [m, h] = j(void 0);
|
|
490
|
+
return D(() => {
|
|
491
|
+
if (!d.current || p.current) return;
|
|
492
|
+
p.current = !0;
|
|
493
|
+
let e = null;
|
|
494
|
+
try {
|
|
495
|
+
e = new y({
|
|
496
|
+
id: d.current,
|
|
497
|
+
...i,
|
|
498
|
+
map: new S({
|
|
499
|
+
style: "light",
|
|
500
|
+
...r
|
|
501
|
+
})
|
|
502
|
+
}), f.current = e, e.on("loaded", () => {
|
|
503
|
+
h(e), a?.(e);
|
|
504
|
+
});
|
|
505
|
+
} catch (e) {
|
|
506
|
+
console.error("Failed to initialize GaodeMap scene:", e), p.current = !1;
|
|
507
|
+
}
|
|
508
|
+
return () => {
|
|
509
|
+
p.current = !1, f.current && (f.current.destroy(), f.current = null, h(void 0));
|
|
510
|
+
};
|
|
511
|
+
}, []), D(() => {
|
|
512
|
+
m && r?.style && m.setMapStyle(r.style);
|
|
513
|
+
}, [m, r?.style]), D(() => {
|
|
514
|
+
!m || r?.zoom === void 0 || m.setZoom(r.zoom);
|
|
515
|
+
}, [m, r?.zoom]), D(() => {
|
|
516
|
+
!m || !r?.center || m.setCenter(r.center);
|
|
517
|
+
}, [m, JSON.stringify(r?.center)]), D(() => {
|
|
518
|
+
!m || r?.pitch === void 0 || m.setPitch(r.pitch);
|
|
519
|
+
}, [m, r?.pitch]), D(() => {
|
|
520
|
+
!m || r?.rotation === void 0 || m.setRotation(r.rotation);
|
|
521
|
+
}, [m, r?.rotation]), D(() => {
|
|
522
|
+
if (!(!m || !o)) return m.on("click", o), () => m.off("click", o);
|
|
523
|
+
}, [m, o]), D(() => {
|
|
524
|
+
if (!(!m || !s)) return m.on("mousemove", s), () => m.off("mousemove", s);
|
|
525
|
+
}, [m, s]), D(() => {
|
|
526
|
+
if (!(!m || !c)) return m.on("zoomchange", c), () => m.off("zoomchange", c);
|
|
527
|
+
}, [m, c]), /* @__PURE__ */ (0, z.jsx)(F.Provider, {
|
|
528
|
+
value: m,
|
|
529
|
+
children: /* @__PURE__ */ (0, z.jsx)("div", {
|
|
530
|
+
id: u,
|
|
531
|
+
ref: d,
|
|
532
|
+
className: n,
|
|
533
|
+
style: {
|
|
534
|
+
width: "100%",
|
|
535
|
+
height: "400px",
|
|
536
|
+
...t
|
|
537
|
+
},
|
|
538
|
+
children: m && l
|
|
539
|
+
})
|
|
540
|
+
});
|
|
541
|
+
}
|
|
542
|
+
//#endregion
|
|
543
|
+
//#region src/component/MapScene/MapScene.tsx
|
|
544
|
+
function V(e) {
|
|
545
|
+
let { style: t, className: n, mapConfig: r, sceneConfig: i, onLoaded: a, onClick: o, onMouseMove: s, onZoomChange: c, children: l } = e, u = `l7-mapkit-map-${O().replace(/:/g, "")}`, d = A(null), f = A(null), [p, m] = j(void 0), h = A(!1);
|
|
546
|
+
return D(() => {
|
|
547
|
+
if (!d.current || h.current) return;
|
|
548
|
+
h.current = !0;
|
|
549
|
+
let e = new y({
|
|
550
|
+
id: d.current,
|
|
551
|
+
...i,
|
|
552
|
+
map: new C({ ...r })
|
|
553
|
+
});
|
|
554
|
+
return f.current = e, e.on("loaded", () => {
|
|
555
|
+
m(e), a?.(e);
|
|
556
|
+
}), () => {
|
|
557
|
+
e.destroy(), f.current = null, h.current = !1, m(void 0);
|
|
558
|
+
};
|
|
559
|
+
}, []), D(() => {
|
|
560
|
+
p && r?.style && p.setMapStyle(r.style);
|
|
561
|
+
}, [p, r?.style]), D(() => {
|
|
562
|
+
!p || r?.zoom === void 0 || p.setZoom(r.zoom);
|
|
563
|
+
}, [p, r?.zoom]), D(() => {
|
|
564
|
+
!p || !r?.center || p.setCenter(r.center);
|
|
565
|
+
}, [p, JSON.stringify(r?.center)]), D(() => {
|
|
566
|
+
!p || r?.pitch === void 0 || p.setPitch(r.pitch);
|
|
567
|
+
}, [p, r?.pitch]), D(() => {
|
|
568
|
+
!p || r?.rotation === void 0 || p.setRotation(r.rotation);
|
|
569
|
+
}, [p, r?.rotation]), D(() => {
|
|
570
|
+
if (!(!p || !o)) return p.on("click", o), () => p.off("click", o);
|
|
571
|
+
}, [p, o]), D(() => {
|
|
572
|
+
if (!(!p || !s)) return p.on("mousemove", s), () => p.off("mousemove", s);
|
|
573
|
+
}, [p, s]), D(() => {
|
|
574
|
+
if (!(!p || !c)) return p.on("zoomchange", c), () => p.off("zoomchange", c);
|
|
575
|
+
}, [p, c]), /* @__PURE__ */ (0, z.jsx)(F.Provider, {
|
|
576
|
+
value: p,
|
|
577
|
+
children: /* @__PURE__ */ (0, z.jsx)("div", {
|
|
578
|
+
id: u,
|
|
579
|
+
ref: d,
|
|
580
|
+
className: n,
|
|
581
|
+
style: {
|
|
582
|
+
width: "100%",
|
|
583
|
+
height: "400px",
|
|
584
|
+
...t
|
|
585
|
+
},
|
|
586
|
+
children: p && l
|
|
587
|
+
})
|
|
588
|
+
});
|
|
589
|
+
}
|
|
590
|
+
//#endregion
|
|
591
|
+
//#region src/component/LayerContext.tsx
|
|
592
|
+
var H = T(void 0);
|
|
593
|
+
function ee() {
|
|
594
|
+
let e = E(H);
|
|
595
|
+
if (!e) throw Error("useLayer must be used within a Layer component (PointLayer, LineLayer, etc.)");
|
|
596
|
+
return e;
|
|
597
|
+
}
|
|
598
|
+
//#endregion
|
|
599
|
+
//#region src/component/LayerAttribute/BaseLayer.tsx
|
|
600
|
+
var U = {
|
|
601
|
+
PolygonLayer: h,
|
|
602
|
+
LineLayer: c,
|
|
603
|
+
PointLayer: m,
|
|
604
|
+
HeatmapLayer: a,
|
|
605
|
+
RasterLayer: _,
|
|
606
|
+
ImageLayer: o,
|
|
607
|
+
CityBuildingLayer: e
|
|
608
|
+
};
|
|
609
|
+
function W(e) {
|
|
610
|
+
let { layerType: t, name: n, visible: r, zIndex: i, minZoom: a, maxZoom: o, blend: s, autoFit: c, source: l, sourceConfig: u, color: d, colorField: f, colorValues: p, size: m, sizeField: g, sizeValues: _, shape: v, shapeField: y, shapeValues: b, style: x, filterField: S, filterValues: C, animate: w, active: T, select: E, onLoaded: O, onClick: k, onDblClick: A, onMouseEnter: M, onMouseLeave: N, onMouseMove: P, onUnClick: F, onContextMenu: L, children: R } = e, B = I(), [V] = j(() => {
|
|
611
|
+
let e = U[t] || h, l = {};
|
|
612
|
+
return n !== void 0 && (l.name = n), r !== void 0 && (l.visible = r), i !== void 0 && (l.zIndex = i), a !== void 0 && (l.minZoom = a), o !== void 0 && (l.maxZoom = o), s !== void 0 && (l.blend = s), c !== void 0 && (l.autoFit = c), new e(l);
|
|
613
|
+
});
|
|
614
|
+
return D(() => (B.addLayer(V), () => {
|
|
615
|
+
B.removeLayer(V);
|
|
616
|
+
}), []), D(() => {
|
|
617
|
+
l !== void 0 && V.source(l, u);
|
|
618
|
+
}, [l, u]), D(() => {
|
|
619
|
+
if (!O) return;
|
|
620
|
+
let e = () => O(V, B);
|
|
621
|
+
return V.on("inited", e), () => V.off("inited", e);
|
|
622
|
+
}, [O]), D(() => {
|
|
623
|
+
V.inited && (f && p !== void 0 ? V.color(f, p) : f ? V.color(f) : d !== void 0 && V.color(d));
|
|
624
|
+
}, [
|
|
625
|
+
d,
|
|
626
|
+
f,
|
|
627
|
+
p
|
|
628
|
+
]), D(() => {
|
|
629
|
+
V.inited && (g && _ !== void 0 ? V.size(g, _) : g ? V.size(g) : m !== void 0 && V.size(m));
|
|
630
|
+
}, [
|
|
631
|
+
m,
|
|
632
|
+
g,
|
|
633
|
+
_
|
|
634
|
+
]), D(() => {
|
|
635
|
+
V.inited && (y && b !== void 0 ? V.shape(y, b) : y ? V.shape(y) : v !== void 0 && V.shape(v));
|
|
636
|
+
}, [
|
|
637
|
+
v,
|
|
638
|
+
y,
|
|
639
|
+
b
|
|
640
|
+
]), D(() => {
|
|
641
|
+
!V.inited || !x || V.style(x);
|
|
642
|
+
}, [x]), D(() => {
|
|
643
|
+
!V.inited || !S || C === void 0 || V.filter(S, C);
|
|
644
|
+
}, [S, C]), D(() => {
|
|
645
|
+
!V.inited || !w || V.animate(w);
|
|
646
|
+
}, [w]), D(() => {
|
|
647
|
+
!V.inited || T === void 0 || V.active(T);
|
|
648
|
+
}, [T]), D(() => {
|
|
649
|
+
!V.inited || E === void 0 || V.select(E);
|
|
650
|
+
}, [E]), D(() => {
|
|
651
|
+
if (k) return V.on("click", k), () => V.off("click", k);
|
|
652
|
+
}, [k]), D(() => {
|
|
653
|
+
if (A) return V.on("dblclick", A), () => V.off("dblclick", A);
|
|
654
|
+
}, [A]), D(() => {
|
|
655
|
+
if (M) return V.on("mouseenter", M), () => V.off("mouseenter", M);
|
|
656
|
+
}, [M]), D(() => {
|
|
657
|
+
if (N) return V.on("mouseleave", N), () => V.off("mouseleave", N);
|
|
658
|
+
}, [N]), D(() => {
|
|
659
|
+
if (P) return V.on("mousemove", P), () => V.off("mousemove", P);
|
|
660
|
+
}, [P]), D(() => {
|
|
661
|
+
if (F) return V.on("unclick", F), () => V.off("unclick", F);
|
|
662
|
+
}, [F]), D(() => {
|
|
663
|
+
if (L) return V.on("contextmenu", L), () => V.off("contextmenu", L);
|
|
664
|
+
}, [L]), D(() => {
|
|
665
|
+
V.inited && (r === !1 ? V.hide() : V.show());
|
|
666
|
+
}, [r]), D(() => {
|
|
667
|
+
!V.inited || i === void 0 || V.setIndex(i);
|
|
668
|
+
}, [i]), /* @__PURE__ */ (0, z.jsx)(H.Provider, {
|
|
669
|
+
value: V,
|
|
670
|
+
children: R
|
|
671
|
+
});
|
|
672
|
+
}
|
|
673
|
+
//#endregion
|
|
674
|
+
//#region src/component/Layer.ts
|
|
675
|
+
var G = w.memo(function(e) {
|
|
676
|
+
return w.createElement(W, {
|
|
677
|
+
...e,
|
|
678
|
+
layerType: "PointLayer"
|
|
679
|
+
});
|
|
680
|
+
}), K = w.memo(function(e) {
|
|
681
|
+
return w.createElement(W, {
|
|
682
|
+
...e,
|
|
683
|
+
layerType: "LineLayer"
|
|
684
|
+
});
|
|
685
|
+
}), q = w.memo(function(e) {
|
|
686
|
+
return w.createElement(W, {
|
|
687
|
+
...e,
|
|
688
|
+
layerType: "PolygonLayer"
|
|
689
|
+
});
|
|
690
|
+
}), te = w.memo(function(e) {
|
|
691
|
+
return w.createElement(W, {
|
|
692
|
+
...e,
|
|
693
|
+
layerType: "HeatmapLayer"
|
|
694
|
+
});
|
|
695
|
+
}), ne = w.memo(function(e) {
|
|
696
|
+
return w.createElement(W, {
|
|
697
|
+
...e,
|
|
698
|
+
layerType: "RasterLayer"
|
|
699
|
+
});
|
|
700
|
+
}), re = w.memo(function(e) {
|
|
701
|
+
return w.createElement(W, {
|
|
702
|
+
...e,
|
|
703
|
+
layerType: "ImageLayer"
|
|
704
|
+
});
|
|
705
|
+
}), J = {
|
|
706
|
+
zoom: x,
|
|
707
|
+
scale: v,
|
|
708
|
+
logo: l,
|
|
709
|
+
layerSwitch: s,
|
|
710
|
+
mouseLocation: p,
|
|
711
|
+
mapTheme: u,
|
|
712
|
+
geoLocate: i,
|
|
713
|
+
exportImage: n,
|
|
714
|
+
fullscreen: r,
|
|
715
|
+
swipe: b
|
|
716
|
+
}, Y = w.memo(function(e) {
|
|
717
|
+
let { type: t, position: n, ...r } = e, i = I(), a = A(null), o = A(!1);
|
|
718
|
+
return D(() => {
|
|
719
|
+
if (o.current) return;
|
|
720
|
+
o.current = !0;
|
|
721
|
+
let e = J[t];
|
|
722
|
+
if (!e) {
|
|
723
|
+
console.warn(`[l7-mapkit] Unknown control type: "${t}"`), o.current = !1;
|
|
724
|
+
return;
|
|
725
|
+
}
|
|
726
|
+
let s = new e({
|
|
727
|
+
position: n,
|
|
728
|
+
...r
|
|
729
|
+
});
|
|
730
|
+
return a.current = s, i.addControl(s), () => {
|
|
731
|
+
i.removeControl(s), a.current = null, o.current = !1;
|
|
732
|
+
};
|
|
733
|
+
}, [t]), D(() => {
|
|
734
|
+
a.current && n && a.current.setPosition(n);
|
|
735
|
+
}, [n]), null;
|
|
736
|
+
});
|
|
737
|
+
//#endregion
|
|
738
|
+
//#region src/component/CustomControl.tsx
|
|
739
|
+
function ie(e) {
|
|
740
|
+
let { position: n = "topright", className: r, style: i, children: a } = e, o = I(), [s] = j(() => document.createElement("div")), [, c] = j(0), l = A(!1), u = A(null);
|
|
741
|
+
return D(() => {
|
|
742
|
+
if (l.current) return;
|
|
743
|
+
l.current = !0;
|
|
744
|
+
let e = new t({ position: n });
|
|
745
|
+
return e.onAdd = () => (r && (s.className = r), i && Object.assign(s.style, i), s), e.onRemove = () => {}, u.current = e, o.addControl(e), c((e) => e + 1), () => {
|
|
746
|
+
o.removeControl(e), u.current = null, l.current = !1;
|
|
747
|
+
};
|
|
748
|
+
}, []), D(() => {
|
|
749
|
+
r && (s.className = r);
|
|
750
|
+
}, [r]), M(a, s);
|
|
751
|
+
}
|
|
752
|
+
//#endregion
|
|
753
|
+
//#region src/component/Control/ZoomControl.tsx
|
|
754
|
+
var ae = ({ position: e = "topleft", zoomInText: t = "+", zoomOutText: n = "-", zoomInTitle: r = "放大", zoomOutTitle: i = "缩小", showZoom: a = !0, className: o = "", style: s, onAdd: c, onRemove: l, onShow: u, onHide: d }) => {
|
|
755
|
+
let f = E(F), [p, m] = j(null), h = k(() => ({
|
|
756
|
+
position: e,
|
|
757
|
+
zoomInTitle: r,
|
|
758
|
+
zoomOutTitle: i,
|
|
759
|
+
showZoom: a
|
|
760
|
+
}), [
|
|
761
|
+
e,
|
|
762
|
+
r,
|
|
763
|
+
i,
|
|
764
|
+
a
|
|
765
|
+
]);
|
|
766
|
+
return D(() => {
|
|
767
|
+
if (!f) return;
|
|
768
|
+
let e = new x(h);
|
|
769
|
+
return m(e), f.addControl(e), c?.(), u?.(), () => {
|
|
770
|
+
f.removeControl(e), m(null), l?.();
|
|
771
|
+
};
|
|
772
|
+
}, []), D(() => {
|
|
773
|
+
p && p.setOptions(h);
|
|
774
|
+
}, [p, h]), D(() => {
|
|
775
|
+
if (!p) return;
|
|
776
|
+
let e = () => u?.(), t = () => d?.();
|
|
777
|
+
return p.on("show", e), p.on("hide", t), () => {
|
|
778
|
+
p.off("show", e), p.off("hide", t);
|
|
779
|
+
};
|
|
780
|
+
}, [
|
|
781
|
+
p,
|
|
782
|
+
u,
|
|
783
|
+
d
|
|
784
|
+
]), null;
|
|
785
|
+
}, X = ({ position: e = "bottomleft", className: t = "", style: n, lockWidth: r = !1, maxWidth: i = 100, metric: a = !0, imperial: o = !1, updateWhenIdle: s = !1, onAdd: c, onRemove: l, onShow: u, onHide: d }) => {
|
|
786
|
+
let f = E(F), [p, m] = j(null), h = k(() => ({
|
|
787
|
+
position: e,
|
|
788
|
+
lockWidth: r,
|
|
789
|
+
maxWidth: i,
|
|
790
|
+
metric: a,
|
|
791
|
+
imperial: o,
|
|
792
|
+
updateWhenIdle: s
|
|
793
|
+
}), [
|
|
794
|
+
e,
|
|
795
|
+
r,
|
|
796
|
+
i,
|
|
797
|
+
a,
|
|
798
|
+
o,
|
|
799
|
+
s
|
|
800
|
+
]);
|
|
801
|
+
return D(() => {
|
|
802
|
+
if (!f) return;
|
|
803
|
+
let e = new v(h);
|
|
804
|
+
return m(e), f.addControl(e), c?.(), u?.(), () => {
|
|
805
|
+
f.removeControl(e), m(null), l?.();
|
|
806
|
+
};
|
|
807
|
+
}, []), D(() => {
|
|
808
|
+
p && p.setOptions(h);
|
|
809
|
+
}, [p, h]), D(() => {
|
|
810
|
+
if (!p) return;
|
|
811
|
+
let e = () => u?.(), t = () => d?.();
|
|
812
|
+
return p.on("show", e), p.on("hide", t), () => {
|
|
813
|
+
p.off("show", e), p.off("hide", t);
|
|
814
|
+
};
|
|
815
|
+
}, [
|
|
816
|
+
p,
|
|
817
|
+
u,
|
|
818
|
+
d
|
|
819
|
+
]), null;
|
|
820
|
+
}, oe = ({ position: e = "topright", btnText: t = "全屏", title: n = "全屏查看", vertical: i = !1, exitBtnText: a = "退出全屏", exitTitle: o = "退出全屏", className: s = "", style: c, onAdd: l, onRemove: u, onShow: d, onHide: f, onFullscreenChange: p }) => {
|
|
821
|
+
let m = E(F), [h, g] = j(null), _ = k(() => ({
|
|
822
|
+
position: e,
|
|
823
|
+
btnText: t,
|
|
824
|
+
title: n,
|
|
825
|
+
vertical: i,
|
|
826
|
+
exitBtnText: a,
|
|
827
|
+
exitTitle: o
|
|
828
|
+
}), [
|
|
829
|
+
e,
|
|
830
|
+
t,
|
|
831
|
+
n,
|
|
832
|
+
i,
|
|
833
|
+
a,
|
|
834
|
+
o
|
|
835
|
+
]);
|
|
836
|
+
return D(() => {
|
|
837
|
+
if (!m) return;
|
|
838
|
+
let e = new r(_);
|
|
839
|
+
return g(e), m.addControl(e), l?.(), d?.(), () => {
|
|
840
|
+
m.removeControl(e), g(null), u?.();
|
|
841
|
+
};
|
|
842
|
+
}, []), D(() => {
|
|
843
|
+
h && h.setOptions(_);
|
|
844
|
+
}, [h, _]), D(() => {
|
|
845
|
+
if (!h) return;
|
|
846
|
+
let e = () => d?.(), t = () => f?.(), n = (e) => p?.(e?.target?.isFullscreen);
|
|
847
|
+
return h.on("show", e), h.on("hide", t), h.on("fullscreenchange", n), () => {
|
|
848
|
+
h.off("show", e), h.off("hide", t), h.off("fullscreenchange", n);
|
|
849
|
+
};
|
|
850
|
+
}, [
|
|
851
|
+
h,
|
|
852
|
+
d,
|
|
853
|
+
f,
|
|
854
|
+
p
|
|
855
|
+
]), null;
|
|
856
|
+
}, se = ({ position: e = "topright", btnText: t = "定位", title: n = "定位到当前位置", vertical: r = !1, transform: a, className: o = "", style: s, onAdd: c, onRemove: l, onShow: u, onHide: d }) => {
|
|
857
|
+
let f = E(F), [p, m] = j(null), h = k(() => ({
|
|
858
|
+
position: e,
|
|
859
|
+
btnText: t,
|
|
860
|
+
title: n,
|
|
861
|
+
vertical: r,
|
|
862
|
+
transform: a
|
|
863
|
+
}), [
|
|
864
|
+
e,
|
|
865
|
+
t,
|
|
866
|
+
n,
|
|
867
|
+
r,
|
|
868
|
+
a
|
|
869
|
+
]);
|
|
870
|
+
return D(() => {
|
|
871
|
+
if (!f) return;
|
|
872
|
+
let e = new i(h);
|
|
873
|
+
return m(e), f.addControl(e), c?.(), u?.(), () => {
|
|
874
|
+
f.removeControl(e), m(null), l?.();
|
|
875
|
+
};
|
|
876
|
+
}, []), D(() => {
|
|
877
|
+
p && p.setOptions(h);
|
|
878
|
+
}, [p, h]), D(() => {
|
|
879
|
+
if (!p) return;
|
|
880
|
+
let e = () => u?.(), t = () => d?.();
|
|
881
|
+
return p.on("show", e), p.on("hide", t), () => {
|
|
882
|
+
p.off("show", e), p.off("hide", t);
|
|
883
|
+
};
|
|
884
|
+
}, [
|
|
885
|
+
p,
|
|
886
|
+
u,
|
|
887
|
+
d
|
|
888
|
+
]), null;
|
|
889
|
+
}, Z = ({ position: e = "topright", options: t = [], btnText: n = "主题", title: r = "地图主题", vertical: i = !1, popperPlacement: a = "bottom-end", popperTrigger: o = "click", popperClassName: s = "", className: c = "", style: l, onAdd: d, onRemove: f, onShow: p, onHide: m, onPopperShow: h, onPopperHide: g, onSelectChange: _ }) => {
|
|
890
|
+
let v = E(F), [y, b] = j(null), x = k(() => ({
|
|
891
|
+
position: e,
|
|
892
|
+
options: t,
|
|
893
|
+
btnText: n,
|
|
894
|
+
title: r,
|
|
895
|
+
vertical: i,
|
|
896
|
+
popperPlacement: a,
|
|
897
|
+
popperTrigger: o,
|
|
898
|
+
popperClassName: s
|
|
899
|
+
}), [
|
|
900
|
+
e,
|
|
901
|
+
t,
|
|
902
|
+
n,
|
|
903
|
+
r,
|
|
904
|
+
i,
|
|
905
|
+
a,
|
|
906
|
+
o,
|
|
907
|
+
s
|
|
908
|
+
]);
|
|
909
|
+
return D(() => {
|
|
910
|
+
if (!v) return;
|
|
911
|
+
let e = new u(x);
|
|
912
|
+
return b(e), v.addControl(e), d?.(), p?.(), () => {
|
|
913
|
+
v.removeControl(e), b(null), f?.();
|
|
914
|
+
};
|
|
915
|
+
}, []), D(() => {
|
|
916
|
+
y && y.setOptions(x);
|
|
917
|
+
}, [y, x]), D(() => {
|
|
918
|
+
if (!y) return;
|
|
919
|
+
let e = () => p?.(), t = () => m?.(), n = () => h?.(), r = () => g?.(), i = (e) => _?.(e?.target?.value);
|
|
920
|
+
return y.on("show", e), y.on("hide", t), y.on("popperShow", n), y.on("popperHide", r), y.on("selectChange", i), () => {
|
|
921
|
+
y.off("show", e), y.off("hide", t), y.off("popperShow", n), y.off("popperHide", r), y.off("selectChange", i);
|
|
922
|
+
};
|
|
923
|
+
}, [
|
|
924
|
+
y,
|
|
925
|
+
p,
|
|
926
|
+
m,
|
|
927
|
+
h,
|
|
928
|
+
g,
|
|
929
|
+
_
|
|
930
|
+
]), null;
|
|
931
|
+
}, ce = ({ position: e = "bottomleft", className: t = "", style: n, transform: r, onAdd: i, onRemove: a, onShow: o, onHide: s, onLocationChange: c }) => {
|
|
932
|
+
let l = E(F), [u, d] = j(null), f = k(() => ({
|
|
933
|
+
position: e,
|
|
934
|
+
transform: r
|
|
935
|
+
}), [e, r]);
|
|
936
|
+
return D(() => {
|
|
937
|
+
if (!l) return;
|
|
938
|
+
let e = new p(f);
|
|
939
|
+
return d(e), l.addControl(e), i?.(), o?.(), () => {
|
|
940
|
+
l.removeControl(e), d(null), a?.();
|
|
941
|
+
};
|
|
942
|
+
}, []), D(() => {
|
|
943
|
+
u && u.setOptions(f);
|
|
944
|
+
}, [u, f]), D(() => {
|
|
945
|
+
if (!u) return;
|
|
946
|
+
let e = () => o?.(), t = () => s?.(), n = (e) => c?.(e?.target?.lnglat);
|
|
947
|
+
return u.on("show", e), u.on("hide", t), u.on("locationchange", n), () => {
|
|
948
|
+
u.off("show", e), u.off("hide", t), u.off("locationchange", n);
|
|
949
|
+
};
|
|
950
|
+
}, [
|
|
951
|
+
u,
|
|
952
|
+
o,
|
|
953
|
+
s,
|
|
954
|
+
c
|
|
955
|
+
]), null;
|
|
956
|
+
}, le = ({ position: e = "topright", imageType: t = "png", btnText: r = "导出", title: i = "导出图片", vertical: a = !1, className: o = "", style: s, onAdd: c, onRemove: l, onShow: u, onHide: d, onExport: f }) => {
|
|
957
|
+
let p = E(F), [m, h] = j(null), g = k(() => ({
|
|
958
|
+
position: e,
|
|
959
|
+
imageType: t,
|
|
960
|
+
btnText: r,
|
|
961
|
+
title: i,
|
|
962
|
+
vertical: a,
|
|
963
|
+
onExport: f
|
|
964
|
+
}), [
|
|
965
|
+
e,
|
|
966
|
+
t,
|
|
967
|
+
r,
|
|
968
|
+
i,
|
|
969
|
+
a,
|
|
970
|
+
f
|
|
971
|
+
]);
|
|
972
|
+
return D(() => {
|
|
973
|
+
if (!p) return;
|
|
974
|
+
let e = new n(g);
|
|
975
|
+
return h(e), p.addControl(e), c?.(), u?.(), () => {
|
|
976
|
+
p.removeControl(e), h(null), l?.();
|
|
977
|
+
};
|
|
978
|
+
}, []), D(() => {
|
|
979
|
+
m && m.setOptions(g);
|
|
980
|
+
}, [m, g]), D(() => {
|
|
981
|
+
if (!m) return;
|
|
982
|
+
let e = () => u?.(), t = () => d?.();
|
|
983
|
+
return m.on("show", e), m.on("hide", t), () => {
|
|
984
|
+
m.off("show", e), m.off("hide", t);
|
|
985
|
+
};
|
|
986
|
+
}, [
|
|
987
|
+
m,
|
|
988
|
+
u,
|
|
989
|
+
d
|
|
990
|
+
]), null;
|
|
991
|
+
}, ue = (e, t, n) => {
|
|
992
|
+
let r = [];
|
|
993
|
+
for (let i = 0; i < n; i++) {
|
|
994
|
+
let a = i / (n - 1), o = Math.round(parseInt(e.slice(1, 3), 16) * (1 - a) + parseInt(t.slice(1, 3), 16) * a), s = Math.round(parseInt(e.slice(3, 5), 16) * (1 - a) + parseInt(t.slice(3, 5), 16) * a), c = Math.round(parseInt(e.slice(5, 7), 16) * (1 - a) + parseInt(t.slice(5, 7), 16) * a);
|
|
995
|
+
r.push(`#${o.toString(16).padStart(2, "0")}${s.toString(16).padStart(2, "0")}${c.toString(16).padStart(2, "0")}`);
|
|
996
|
+
}
|
|
997
|
+
return r;
|
|
998
|
+
}, de = ({ labels: e, colors: t, geometryType: n = "circle", isStrokeColor: r = !1, className: i = "", style: a }) => {
|
|
999
|
+
let o = (e) => r ? { border: `2px solid ${e}` } : { backgroundColor: e }, s = Array.isArray(t) ? t : ue(t.startColor, t.endColor, e.length);
|
|
1000
|
+
return /* @__PURE__ */ (0, z.jsx)("div", {
|
|
1001
|
+
className: `l7-mapkit-component l7-mapkit-legend-categories ${i}`,
|
|
1002
|
+
style: a,
|
|
1003
|
+
children: e.map((e, t) => /* @__PURE__ */ (0, z.jsxs)("div", {
|
|
1004
|
+
className: "flex items-center mb-2",
|
|
1005
|
+
children: [/* @__PURE__ */ (0, z.jsx)("div", {
|
|
1006
|
+
className: `w-4 h-4 mr-2 ${n === "circle" ? "rounded-full" : n === "square" ? "rounded-sm" : ""}`,
|
|
1007
|
+
style: o(s[t])
|
|
1008
|
+
}), /* @__PURE__ */ (0, z.jsx)("span", {
|
|
1009
|
+
className: "text-sm",
|
|
1010
|
+
children: e
|
|
1011
|
+
})]
|
|
1012
|
+
}, `${e}__${s[t]}__${t}`))
|
|
1013
|
+
});
|
|
1014
|
+
}, Q = ({ labels: e, labelUnit: t, colors: n }) => {
|
|
1015
|
+
let r = `${e[0]}${t}`, i = `${e[e.length - 1]}${t}`;
|
|
1016
|
+
return /* @__PURE__ */ (0, z.jsxs)("div", {
|
|
1017
|
+
className: "l7-mapkit-legend-ramp",
|
|
1018
|
+
children: [/* @__PURE__ */ (0, z.jsx)("div", {
|
|
1019
|
+
className: "h-4 w-full rounded",
|
|
1020
|
+
style: { background: `linear-gradient(to right, ${n.join(", ")})` }
|
|
1021
|
+
}), /* @__PURE__ */ (0, z.jsxs)("div", {
|
|
1022
|
+
className: "flex justify-between mt-1 text-xs",
|
|
1023
|
+
children: [/* @__PURE__ */ (0, z.jsx)("span", { children: r }), /* @__PURE__ */ (0, z.jsx)("span", { children: i })]
|
|
1024
|
+
})]
|
|
1025
|
+
});
|
|
1026
|
+
}, fe = ({ labels: e, labelUnit: t, colors: n }) => /* @__PURE__ */ (0, z.jsxs)("div", {
|
|
1027
|
+
className: "l7-mapkit-legend-ramp",
|
|
1028
|
+
children: [/* @__PURE__ */ (0, z.jsx)("div", {
|
|
1029
|
+
className: "flex",
|
|
1030
|
+
children: n.map((n, r) => /* @__PURE__ */ (0, z.jsx)("div", {
|
|
1031
|
+
title: `${e[r]}${t} - ${e[r + 1]}${t}`,
|
|
1032
|
+
className: "h-4 flex-1 first:rounded-l last:rounded-r",
|
|
1033
|
+
style: { backgroundColor: n }
|
|
1034
|
+
}, n))
|
|
1035
|
+
}), /* @__PURE__ */ (0, z.jsx)("div", {
|
|
1036
|
+
className: "flex justify-between mt-1 text-xs",
|
|
1037
|
+
children: e.map((e) => /* @__PURE__ */ (0, z.jsx)("span", { children: `${e}${t}` }, e))
|
|
1038
|
+
})]
|
|
1039
|
+
}), pe = ({ labels: e, colors: t, isContinuous: n = !1, labelUnit: r = "", className: i = "", style: a }) => /* @__PURE__ */ (0, z.jsx)("div", {
|
|
1040
|
+
className: `l7-mapkit-component l7-mapkit-legend-ramp ${i}`,
|
|
1041
|
+
style: a,
|
|
1042
|
+
children: n ? /* @__PURE__ */ (0, z.jsx)(Q, {
|
|
1043
|
+
labels: e,
|
|
1044
|
+
labelUnit: r,
|
|
1045
|
+
colors: t
|
|
1046
|
+
}) : /* @__PURE__ */ (0, z.jsx)(fe, {
|
|
1047
|
+
labels: e,
|
|
1048
|
+
labelUnit: r,
|
|
1049
|
+
colors: t
|
|
1050
|
+
})
|
|
1051
|
+
}), me = (e, t) => {
|
|
1052
|
+
let n = (t - e) / 4;
|
|
1053
|
+
return [Math.floor(e + n), Math.floor(t - n)];
|
|
1054
|
+
}, he = (e, t) => {
|
|
1055
|
+
let n = Number.isFinite(e) ? e : 0, r = Number.isFinite(t) ? t : 0, i = me(n, r);
|
|
1056
|
+
return [
|
|
1057
|
+
{
|
|
1058
|
+
prefix: "MIN:",
|
|
1059
|
+
val: n
|
|
1060
|
+
},
|
|
1061
|
+
i[0],
|
|
1062
|
+
i[1],
|
|
1063
|
+
{
|
|
1064
|
+
prefix: "MAX:",
|
|
1065
|
+
val: r
|
|
1066
|
+
}
|
|
1067
|
+
];
|
|
1068
|
+
}, ge = ({ labels: e, fillColor: t = "#f9f9f9", className: n = "", style: r }) => {
|
|
1069
|
+
let [i, a] = e, o = [
|
|
1070
|
+
86,
|
|
1071
|
+
62,
|
|
1072
|
+
38,
|
|
1073
|
+
24
|
|
1074
|
+
], s = he(i, a).reverse();
|
|
1075
|
+
return /* @__PURE__ */ (0, z.jsx)("div", {
|
|
1076
|
+
className: `l7-mapkit-component l7-mapkit-legend-proportion ${n}`,
|
|
1077
|
+
style: r,
|
|
1078
|
+
children: /* @__PURE__ */ (0, z.jsxs)("div", {
|
|
1079
|
+
className: "flex items-end",
|
|
1080
|
+
children: [/* @__PURE__ */ (0, z.jsx)("div", {
|
|
1081
|
+
className: "relative flex justify-end items-end mr-4",
|
|
1082
|
+
style: { width: o[0] },
|
|
1083
|
+
children: o.map((e) => /* @__PURE__ */ (0, z.jsx)("div", {
|
|
1084
|
+
className: "absolute rounded-full border border-gray-300",
|
|
1085
|
+
style: {
|
|
1086
|
+
width: e,
|
|
1087
|
+
height: e,
|
|
1088
|
+
backgroundColor: t
|
|
1089
|
+
}
|
|
1090
|
+
}, e))
|
|
1091
|
+
}), /* @__PURE__ */ (0, z.jsx)("div", {
|
|
1092
|
+
style: { height: o[0] },
|
|
1093
|
+
children: s.map((e, t) => /* @__PURE__ */ (0, z.jsxs)("div", {
|
|
1094
|
+
className: "text-sm mb-1",
|
|
1095
|
+
children: [e?.prefix, typeof e == "number" ? e : e.val]
|
|
1096
|
+
}, t))
|
|
1097
|
+
})]
|
|
1098
|
+
})
|
|
1099
|
+
});
|
|
1100
|
+
}, _e = ({ items: e, className: t = "", style: n }) => /* @__PURE__ */ (0, z.jsx)("div", {
|
|
1101
|
+
className: `l7-mapkit-component l7-mapkit-legend-icon ${t}`,
|
|
1102
|
+
style: n,
|
|
1103
|
+
children: e.map((e, t) => /* @__PURE__ */ (0, z.jsxs)("div", {
|
|
1104
|
+
className: "flex items-center mb-2",
|
|
1105
|
+
children: [/* @__PURE__ */ (0, z.jsx)("img", {
|
|
1106
|
+
src: e.icon,
|
|
1107
|
+
alt: e.label,
|
|
1108
|
+
className: "w-6 h-6 mr-2 object-contain"
|
|
1109
|
+
}), /* @__PURE__ */ (0, z.jsx)("span", {
|
|
1110
|
+
className: "text-sm",
|
|
1111
|
+
children: e.label
|
|
1112
|
+
})]
|
|
1113
|
+
}, t))
|
|
1114
|
+
});
|
|
1115
|
+
//#endregion
|
|
1116
|
+
//#region src/component/Marker.tsx
|
|
1117
|
+
function ve(e) {
|
|
1118
|
+
let { longitude: t, latitude: n, option: r, onLoaded: i, onClick: a, onMouseEnter: o, onMouseLeave: s, children: c } = e, l = I(), u = A(null), [f] = j(() => document.createElement("div")), p = A(!1);
|
|
1119
|
+
return D(() => {
|
|
1120
|
+
if (p.current) return;
|
|
1121
|
+
p.current = !0;
|
|
1122
|
+
let e = new d(r);
|
|
1123
|
+
return e.setLnglat({
|
|
1124
|
+
lng: t,
|
|
1125
|
+
lat: n
|
|
1126
|
+
}), c && e.setElement(f), u.current = e, l.addMarker(e), i?.(e), () => {
|
|
1127
|
+
e.remove(), u.current = null, p.current = !1;
|
|
1128
|
+
};
|
|
1129
|
+
}, []), D(() => {
|
|
1130
|
+
u.current && u.current.setLnglat({
|
|
1131
|
+
lng: t,
|
|
1132
|
+
lat: n
|
|
1133
|
+
});
|
|
1134
|
+
}, [t, n]), D(() => {
|
|
1135
|
+
if (!u.current || !a) return;
|
|
1136
|
+
let e = u.current;
|
|
1137
|
+
return e.on("click", a), () => {
|
|
1138
|
+
e.off("click", a);
|
|
1139
|
+
};
|
|
1140
|
+
}, [a]), D(() => {
|
|
1141
|
+
if (!u.current || !o) return;
|
|
1142
|
+
let e = u.current;
|
|
1143
|
+
return e.on("mouseenter", o), () => {
|
|
1144
|
+
e.off("mouseenter", o);
|
|
1145
|
+
};
|
|
1146
|
+
}, [o]), D(() => {
|
|
1147
|
+
if (!u.current || !s) return;
|
|
1148
|
+
let e = u.current;
|
|
1149
|
+
return e.on("mouseleave", s), () => {
|
|
1150
|
+
e.off("mouseleave", s);
|
|
1151
|
+
};
|
|
1152
|
+
}, [s]), c ? M(c, f) : null;
|
|
1153
|
+
}
|
|
1154
|
+
//#endregion
|
|
1155
|
+
//#region src/component/MarkerLayer.tsx
|
|
1156
|
+
function ye(e) {
|
|
1157
|
+
let { data: t, cluster: n = !1, clusterOption: r, renderMarker: i, onLoaded: a } = e, o = I(), s = A(null), c = A(!1);
|
|
1158
|
+
return D(() => {
|
|
1159
|
+
if (c.current) return;
|
|
1160
|
+
c.current = !0;
|
|
1161
|
+
let e = new f({
|
|
1162
|
+
cluster: n,
|
|
1163
|
+
clusterOption: r
|
|
1164
|
+
});
|
|
1165
|
+
return t.forEach((t) => {
|
|
1166
|
+
let n = new d(i ? { element: i(t) } : void 0);
|
|
1167
|
+
n.setLnglat({
|
|
1168
|
+
lng: t.longitude,
|
|
1169
|
+
lat: t.latitude
|
|
1170
|
+
}), e.addMarker(n);
|
|
1171
|
+
}), s.current = e, o.addMarkerLayer(e), a?.(e), () => {
|
|
1172
|
+
e.destroy(), s.current = null, c.current = !1;
|
|
1173
|
+
};
|
|
1174
|
+
}, []), D(() => {
|
|
1175
|
+
s.current && (s.current.clear(), t.forEach((e) => {
|
|
1176
|
+
let t = new d(i ? { element: i(e) } : void 0);
|
|
1177
|
+
t.setLnglat({
|
|
1178
|
+
lng: e.longitude,
|
|
1179
|
+
lat: e.latitude
|
|
1180
|
+
}), s.current.addMarker(t);
|
|
1181
|
+
}));
|
|
1182
|
+
}, [t]), null;
|
|
1183
|
+
}
|
|
1184
|
+
//#endregion
|
|
1185
|
+
//#region src/component/Popup.tsx
|
|
1186
|
+
function be(e) {
|
|
1187
|
+
let { longitude: t, latitude: n, option: r, closeButton: i = !1, onClose: a, children: o } = e, s = I(), c = A(null), l = A(document.createElement("div")), u = A(!1);
|
|
1188
|
+
return D(() => {
|
|
1189
|
+
if (u.current) return;
|
|
1190
|
+
u.current = !0;
|
|
1191
|
+
let e = new g({
|
|
1192
|
+
closeButton: i,
|
|
1193
|
+
...r
|
|
1194
|
+
});
|
|
1195
|
+
return e.setLnglat([t, n]), o && e.setHTML(l.current), a && e.on("close", a), c.current = e, s.addPopup(e), () => {
|
|
1196
|
+
e.remove(), c.current = null, u.current = !1;
|
|
1197
|
+
};
|
|
1198
|
+
}, []), D(() => {
|
|
1199
|
+
c.current && c.current.setLnglat([t, n]);
|
|
1200
|
+
}, [t, n]), o ? M(o, l.current) : null;
|
|
1201
|
+
}
|
|
1202
|
+
//#endregion
|
|
1203
|
+
//#region src/component/LoadImage.tsx
|
|
1204
|
+
function xe(e) {
|
|
1205
|
+
let { name: t, url: n } = e, r = I();
|
|
1206
|
+
return D(() => (r.addImage(t, n), () => {
|
|
1207
|
+
r.removeImage(t);
|
|
1208
|
+
}), [t, n]), null;
|
|
1209
|
+
}
|
|
1210
|
+
function Se(e) {
|
|
1211
|
+
let { images: t } = e;
|
|
1212
|
+
return /* @__PURE__ */ (0, z.jsx)(z.Fragment, { children: t.map((e) => /* @__PURE__ */ (0, z.jsx)(xe, {
|
|
1213
|
+
name: e.name,
|
|
1214
|
+
url: e.url
|
|
1215
|
+
}, e.name)) });
|
|
1216
|
+
}
|
|
1217
|
+
//#endregion
|
|
1218
|
+
export { Y as Control, ie as CustomControl, le as ExportImageControl, oe as FullscreenControl, B as GaodeMapScene, se as GeoLocateControl, te as HeatmapLayer, re as ImageLayer, H as LayerContext, de as LegendCategories, _e as LegendIcon, ge as LegendProportion, pe as LegendRamp, K as LineLayer, xe as LoadImage, Se as LoadImages, V as MapScene, Z as MapThemeControl, ve as Marker, ye as MarkerLayer, ce as MouseLocationControl, G as PointLayer, q as PolygonLayer, be as Popup, ne as RasterLayer, X as ScaleControl, F as SceneContext, ae as ZoomControl, ee as useLayer, I as useScene };
|