tg-map-vue3 3.5.7 → 3.6.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/CHANGELOG.md +6 -0
- package/dist/src/components/index.d.ts +1 -0
- package/dist/src/map/lat-lng.d.ts +6 -0
- package/dist/src/map/map/baidu-map.d.ts +4 -2
- package/dist/src/map/map/extra/map-urls.d.ts +35 -0
- package/dist/src/map/map/extra/places-service.d.ts +7 -7
- package/dist/src/map/map/extra/search-box.d.ts +1 -1
- package/dist/src/map/map/google-map.d.ts +4 -2
- package/dist/src/map/map/here-map.d.ts +4 -2
- package/dist/src/map/map/map.d.ts +4 -2
- package/dist/src/utils/utils.d.ts +7 -0
- package/dist/tg-map.js +882 -805
- package/dist/tg-map.js.map +1 -1
- package/dist/tg-map.umd.cjs +5 -5
- package/dist/tg-map.umd.cjs.map +1 -1
- package/package.json +3 -3
package/dist/tg-map.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode('.baidu-info-box-container{transform:translateY(-11px);font-size:13px;font-weight:300;width:100vw}.baidu-info-box-container__border{position:absolute;padding:12px;background-color:#fff;box-shadow:0 2px 7px 1px #0000004d;border-radius:8px;transform:translate(-50%,-100%)}.baidu-info-box-container__inner{overflow:auto}.baidu-info-box-container__close{position:absolute;right:-6px;top:-6px;width:14px;height:14px;margin:8px;opacity:.6;cursor:pointer}.baidu-info-box-container__close:hover{opacity:1}.baidu-info-box-container:after{position:absolute;background-color:#fff;content:"";width:15px;height:15px;left:0px;top:0px;box-shadow:-2px 2px 2px #b2b2b266;transform:translate(-50%,-50%) rotate(-45deg)}.element-overlay{position:absolute}.tg-map{height:100%;position:relative}.tg-map__map{width:100%;height:100%}.tg-map__map--hide-logo-google .gm-style a[target=_blank]:has(> div > img){display:none!important}.tg-map__map--hide-logo-google .gm-style>div:last-child>div:last-child>div{display:none}.tg-map__map--hide-logo-baidu div.anchorBL>a[target=_blank]>img{display:none}.tg-map__map--hide-logo-baidu div.BMap_cpyCtrl{display:none}.tg-map-widget{position:absolute}.tg-map>.tg-custom-control{display:none}.tg-map .tg-element-overlay{display:none}.tg-map__map .tg-element-overlay{display:block}.tg-map .tg-info-box{display:none}.tg-map__map .tg-info-box{display:block}.tg-map .tg-label{display:none}.tg-map__map .tg-label{display:block}')),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var c = (i, t, e) => (
|
|
5
|
-
import { createCommentVNode as
|
|
6
|
-
function
|
|
2
|
+
var Pr = Object.defineProperty;
|
|
3
|
+
var kr = (i, t, e) => t in i ? Pr(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
4
|
+
var c = (i, t, e) => (kr(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
5
|
+
import { createCommentVNode as Ke, computed as jt, defineComponent as w, markRaw as Sr, watch as Vt, openBlock as j, createElementBlock as V, mergeProps as de, createElementVNode as Br, normalizeClass as Ne, renderSlot as Z, normalizeStyle as Ir, getCurrentInstance as Ar, inject as Rr, onMounted as $r, onBeforeUnmount as Dr, toRaw as Ge, withDirectives as zr, vShow as Nr } from "vue";
|
|
6
|
+
function F(i, t, e) {
|
|
7
7
|
Object.keys(i).forEach((r) => {
|
|
8
8
|
r.startsWith("update:") || e != null && e.includes(r) || t.addEventListener(r, i[r]);
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
|
-
let
|
|
12
|
-
function
|
|
13
|
-
return
|
|
11
|
+
let Gr = 1;
|
|
12
|
+
function Zr() {
|
|
13
|
+
return Gr++;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
return t.__id__ || (t.__id__ =
|
|
15
|
+
function Be(i, t) {
|
|
16
|
+
return t.__id__ || (t.__id__ = Zr()), `${i}::${t.__id__}`;
|
|
17
17
|
}
|
|
18
|
-
var
|
|
19
|
-
function
|
|
18
|
+
var Ft = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
19
|
+
function rt(i) {
|
|
20
20
|
return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
|
|
21
21
|
}
|
|
22
|
-
var
|
|
22
|
+
var Ut = { exports: {} };
|
|
23
23
|
(function(i) {
|
|
24
24
|
(function(t, e) {
|
|
25
25
|
i.exports ? i.exports = e() : t.coordtransform = e();
|
|
26
|
-
})(
|
|
26
|
+
})(Ft, function() {
|
|
27
27
|
var t = 52.35987755982988, e = 3.141592653589793, r = 6378245, s = 0.006693421622965943;
|
|
28
28
|
function n(g, f, v, O) {
|
|
29
29
|
this.west = Math.min(g, v), this.north = Math.max(f, O), this.east = Math.max(g, v), this.south = Math.min(f, O);
|
|
@@ -58,12 +58,12 @@ var Wt = { exports: {} };
|
|
|
58
58
|
return !1;
|
|
59
59
|
}
|
|
60
60
|
function l(g, f) {
|
|
61
|
-
var v = g - 65e-4, O = f - 6e-3, x = Math.sqrt(v * v + O * O) - 2e-5 * Math.sin(O * t),
|
|
62
|
-
return [
|
|
61
|
+
var v = g - 65e-4, O = f - 6e-3, x = Math.sqrt(v * v + O * O) - 2e-5 * Math.sin(O * t), E = Math.atan2(O, v) - 3e-6 * Math.cos(v * t), J = x * Math.cos(E), re = x * Math.sin(E);
|
|
62
|
+
return [J, re];
|
|
63
63
|
}
|
|
64
64
|
function d(g, f) {
|
|
65
|
-
var v = Math.sqrt(g * g + f * f) + 2e-5 * Math.sin(f * t), O = Math.atan2(f, g) + 3e-6 * Math.cos(g * t), x = v * Math.cos(O) + 65e-4,
|
|
66
|
-
return [x,
|
|
65
|
+
var v = Math.sqrt(g * g + f * f) + 2e-5 * Math.sin(f * t), O = Math.atan2(f, g) + 3e-6 * Math.cos(g * t), x = v * Math.cos(O) + 65e-4, E = v * Math.sin(O) + 6e-3;
|
|
66
|
+
return [x, E];
|
|
67
67
|
}
|
|
68
68
|
function u(g, f) {
|
|
69
69
|
return o(g, f) ? b(g, f) : [g, f];
|
|
@@ -75,12 +75,12 @@ var Wt = { exports: {} };
|
|
|
75
75
|
return [g * 2 - v[0], f * 2 - v[1]];
|
|
76
76
|
}
|
|
77
77
|
function b(g, f) {
|
|
78
|
-
var v = _(g - 105, f - 35), O = M(g - 105, f - 35), x = f / 180 * e,
|
|
79
|
-
|
|
80
|
-
var
|
|
81
|
-
v = v * 180 / (r * (1 - s) / (
|
|
82
|
-
var
|
|
83
|
-
return [
|
|
78
|
+
var v = _(g - 105, f - 35), O = M(g - 105, f - 35), x = f / 180 * e, E = Math.sin(x);
|
|
79
|
+
E = 1 - s * E * E;
|
|
80
|
+
var J = Math.sqrt(E);
|
|
81
|
+
v = v * 180 / (r * (1 - s) / (E * J) * e), O = O * 180 / (r / J * Math.cos(x) * e);
|
|
82
|
+
var re = f + v, Ve = g + O;
|
|
83
|
+
return [Ve, re];
|
|
84
84
|
}
|
|
85
85
|
function _(g, f) {
|
|
86
86
|
var v = -100 + 2 * g + 3 * f + 0.2 * f * f + 0.1 * g * f + 0.2 * Math.sqrt(Math.abs(g));
|
|
@@ -115,54 +115,57 @@ var Wt = { exports: {} };
|
|
|
115
115
|
}
|
|
116
116
|
};
|
|
117
117
|
});
|
|
118
|
-
})(
|
|
119
|
-
var
|
|
120
|
-
const
|
|
121
|
-
function
|
|
118
|
+
})(Ut);
|
|
119
|
+
var Wr = Ut.exports;
|
|
120
|
+
const ie = /* @__PURE__ */ rt(Wr);
|
|
121
|
+
function ne(i, t) {
|
|
122
122
|
if (!i)
|
|
123
123
|
throw new Error(`AssertionError: ${t}`);
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function Xe(i) {
|
|
126
126
|
throw new Error(`Unexpected object: ${i}`);
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function Ss() {
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function Je(i) {
|
|
131
131
|
return i;
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function Bs(i, t) {
|
|
134
134
|
return i instanceof t;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function Is(i, t) {
|
|
137
137
|
if (i instanceof t)
|
|
138
138
|
return i;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function Ee(i, t) {
|
|
141
141
|
if ((i == null ? void 0 : i.$options.name) === t.name)
|
|
142
142
|
return i;
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function As(i) {
|
|
145
145
|
return i;
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function C(i) {
|
|
148
148
|
throw new Error(i);
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function it(i) {
|
|
151
151
|
throw new Error(`Unsupported: ${i}`);
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function Rs(i) {
|
|
154
154
|
throw new Error(`todo: ${i}`);
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function $s(i) {
|
|
157
157
|
return i;
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function ye(...i) {
|
|
160
160
|
}
|
|
161
|
-
function
|
|
161
|
+
function Ds(i) {
|
|
162
162
|
return i != null;
|
|
163
163
|
}
|
|
164
|
-
|
|
165
|
-
|
|
164
|
+
function qt(i) {
|
|
165
|
+
return i[1] != null;
|
|
166
|
+
}
|
|
167
|
+
var S = /* @__PURE__ */ ((i) => (i.wgs84 = "wgs84", i.gcj02 = "gcj02", i.bd09 = "bd09", i))(S || {});
|
|
168
|
+
const Ue = "wgs84", z = class {
|
|
166
169
|
constructor(t, e, r) {
|
|
167
170
|
this.lat = t, this.lng = e, this.coord = r;
|
|
168
171
|
}
|
|
@@ -178,12 +181,12 @@ const He = "wgs84", z = class {
|
|
|
178
181
|
return new z(t.lat, t.lng, e);
|
|
179
182
|
}
|
|
180
183
|
static fromLiteral(t) {
|
|
181
|
-
return new z(t.lat, t.lng, t.coord ||
|
|
184
|
+
return new z(t.lat, t.lng, t.coord || Ue);
|
|
182
185
|
}
|
|
183
|
-
static fromLngLat(t, e, r =
|
|
186
|
+
static fromLngLat(t, e, r = Ue) {
|
|
184
187
|
return new z(e, t, r);
|
|
185
188
|
}
|
|
186
|
-
static create(t, e, r =
|
|
189
|
+
static create(t, e, r = Ue) {
|
|
187
190
|
return new z(t, e, r);
|
|
188
191
|
}
|
|
189
192
|
/** 转换坐标到指定坐标系 */
|
|
@@ -218,11 +221,11 @@ const He = "wgs84", z = class {
|
|
|
218
221
|
_convert(t) {
|
|
219
222
|
switch (this.coord) {
|
|
220
223
|
case "bd09":
|
|
221
|
-
return t === "gcj02" ?
|
|
224
|
+
return t === "gcj02" ? ie.bd09ToGcj02(this.lng, this.lat) : ie.bd09ToWgs84(this.lng, this.lat);
|
|
222
225
|
case "gcj02":
|
|
223
|
-
return t === "wgs84" ?
|
|
226
|
+
return t === "wgs84" ? ie.gcj02ToWgs84(this.lng, this.lat) : ie.gcj02ToBd09(this.lng, this.lat);
|
|
224
227
|
case "wgs84":
|
|
225
|
-
return t === "bd09" ?
|
|
228
|
+
return t === "bd09" ? ie.wgs84ToBd09(this.lng, this.lat) : ie.wgs84ToGcj02(this.lng, this.lat);
|
|
226
229
|
}
|
|
227
230
|
throw new Error(`不支持的坐标转换: ${this.coord}=>${t}`);
|
|
228
231
|
}
|
|
@@ -235,7 +238,7 @@ const He = "wgs84", z = class {
|
|
|
235
238
|
};
|
|
236
239
|
let y = z;
|
|
237
240
|
c(y, "ZERO", z.create(0, 0));
|
|
238
|
-
const
|
|
241
|
+
const ee = class {
|
|
239
242
|
/**
|
|
240
243
|
* 不推荐直接创建LatLngBounds, sw和ne的大小关系可能没法保证, 推荐用LatLngBounds.Builder或者LatLngBounds.from等静态方法来创建
|
|
241
244
|
* @param sw 西南, lat/lng更小
|
|
@@ -243,7 +246,7 @@ const J = class {
|
|
|
243
246
|
*/
|
|
244
247
|
constructor(t, e) {
|
|
245
248
|
c(this, "coord");
|
|
246
|
-
this.sw = t, this.ne = e,
|
|
249
|
+
this.sw = t, this.ne = e, ne(t.coord === e.coord, "sw和ne的coord应该相同"), ne(Number.isFinite(t.lat) && Number.isFinite(t.lng) && Number.isFinite(e.lat) && Number.isFinite(e.lng), `sw(${t})和ne(${e})不能包含NaN或Infinite`), ne(t.lat <= e.lat, `sw.lat(${t.lat})应该比ne.lat(${e.lat})小`), this.coord = t.coord;
|
|
247
250
|
}
|
|
248
251
|
static isBetweenLng(t, e, r) {
|
|
249
252
|
return t <= e ? t <= r && r <= e : t <= r || r <= e;
|
|
@@ -251,22 +254,22 @@ const J = class {
|
|
|
251
254
|
static fromArray(t) {
|
|
252
255
|
if (t.length === 0)
|
|
253
256
|
return;
|
|
254
|
-
const e = new
|
|
257
|
+
const e = new ee.Builder(t[0]);
|
|
255
258
|
for (let r = 1; r < t.length; r++)
|
|
256
259
|
e.include(t[r]);
|
|
257
260
|
return e.build();
|
|
258
261
|
}
|
|
259
262
|
static from(...t) {
|
|
260
|
-
return this.fromArray(t) ??
|
|
263
|
+
return this.fromArray(t) ?? C("positions中没有点");
|
|
261
264
|
}
|
|
262
265
|
static fromGoogle(t, e) {
|
|
263
|
-
return new
|
|
266
|
+
return new ee(
|
|
264
267
|
y.fromGoogle(t.getSouthWest(), e),
|
|
265
268
|
y.fromGoogle(t.getNorthEast(), e)
|
|
266
269
|
);
|
|
267
270
|
}
|
|
268
271
|
static fromBaidu(t, e) {
|
|
269
|
-
return new
|
|
272
|
+
return new ee(
|
|
270
273
|
y.fromBaidu(t.getSouthWest(), e),
|
|
271
274
|
y.fromBaidu(t.getNorthEast(), e)
|
|
272
275
|
);
|
|
@@ -279,7 +282,7 @@ const J = class {
|
|
|
279
282
|
}
|
|
280
283
|
contains(t) {
|
|
281
284
|
const { lat: e, lng: r } = t.to(this.coord);
|
|
282
|
-
return this.sw.lat <= e && e <= this.ne.lat &&
|
|
285
|
+
return this.sw.lat <= e && e <= this.ne.lat && ee.isBetweenLng(this.sw.lng, this.ne.lng, r);
|
|
283
286
|
}
|
|
284
287
|
getCenter() {
|
|
285
288
|
if (this.sw.equals(this.ne))
|
|
@@ -316,8 +319,8 @@ const J = class {
|
|
|
316
319
|
return [this.sw.toBaidu(t), this.ne.toBaidu(t)];
|
|
317
320
|
}
|
|
318
321
|
};
|
|
319
|
-
let I =
|
|
320
|
-
c(I, "EMPTY", new
|
|
322
|
+
let I = ee;
|
|
323
|
+
c(I, "EMPTY", new ee(y.ZERO, y.ZERO));
|
|
321
324
|
((i) => {
|
|
322
325
|
class t {
|
|
323
326
|
constructor(r) {
|
|
@@ -346,77 +349,93 @@ c(I, "EMPTY", new J(y.ZERO, y.ZERO));
|
|
|
346
349
|
}
|
|
347
350
|
i.Builder = t;
|
|
348
351
|
})(I || (I = {}));
|
|
349
|
-
var
|
|
350
|
-
|
|
352
|
+
var Y;
|
|
353
|
+
((i) => {
|
|
354
|
+
function t(r, s) {
|
|
355
|
+
if (r == null)
|
|
356
|
+
return;
|
|
357
|
+
if (typeof r == "string")
|
|
358
|
+
return r;
|
|
359
|
+
const n = r.to(s);
|
|
360
|
+
return `${n.lat},${n.lng}`;
|
|
361
|
+
}
|
|
362
|
+
i.toString = t;
|
|
363
|
+
function e(r) {
|
|
364
|
+
return typeof r == "string" || r == null ? void 0 : r.coord;
|
|
365
|
+
}
|
|
366
|
+
i.getCoordType = e;
|
|
367
|
+
})(Y || (Y = {}));
|
|
368
|
+
var Hr = function(t) {
|
|
369
|
+
return jr(t) && !Vr(t);
|
|
351
370
|
};
|
|
352
|
-
function
|
|
371
|
+
function jr(i) {
|
|
353
372
|
return !!i && typeof i == "object";
|
|
354
373
|
}
|
|
355
|
-
function
|
|
374
|
+
function Vr(i) {
|
|
356
375
|
var t = Object.prototype.toString.call(i);
|
|
357
|
-
return t === "[object RegExp]" || t === "[object Date]" ||
|
|
376
|
+
return t === "[object RegExp]" || t === "[object Date]" || qr(i);
|
|
358
377
|
}
|
|
359
|
-
var
|
|
360
|
-
function
|
|
361
|
-
return i.$$typeof ===
|
|
378
|
+
var Fr = typeof Symbol == "function" && Symbol.for, Ur = Fr ? Symbol.for("react.element") : 60103;
|
|
379
|
+
function qr(i) {
|
|
380
|
+
return i.$$typeof === Ur;
|
|
362
381
|
}
|
|
363
|
-
function
|
|
382
|
+
function Yr(i) {
|
|
364
383
|
return Array.isArray(i) ? [] : {};
|
|
365
384
|
}
|
|
366
|
-
function
|
|
367
|
-
return t.clone !== !1 && t.isMergeableObject(i) ?
|
|
385
|
+
function ve(i, t) {
|
|
386
|
+
return t.clone !== !1 && t.isMergeableObject(i) ? ae(Yr(i), i, t) : i;
|
|
368
387
|
}
|
|
369
|
-
function
|
|
388
|
+
function Kr(i, t, e) {
|
|
370
389
|
return i.concat(t).map(function(r) {
|
|
371
|
-
return
|
|
390
|
+
return ve(r, e);
|
|
372
391
|
});
|
|
373
392
|
}
|
|
374
|
-
function
|
|
393
|
+
function Xr(i, t) {
|
|
375
394
|
if (!t.customMerge)
|
|
376
|
-
return
|
|
395
|
+
return ae;
|
|
377
396
|
var e = t.customMerge(i);
|
|
378
|
-
return typeof e == "function" ? e :
|
|
397
|
+
return typeof e == "function" ? e : ae;
|
|
379
398
|
}
|
|
380
|
-
function
|
|
399
|
+
function Jr(i) {
|
|
381
400
|
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(i).filter(function(t) {
|
|
382
401
|
return Object.propertyIsEnumerable.call(i, t);
|
|
383
402
|
}) : [];
|
|
384
403
|
}
|
|
385
|
-
function
|
|
386
|
-
return Object.keys(i).concat(
|
|
404
|
+
function Rt(i) {
|
|
405
|
+
return Object.keys(i).concat(Jr(i));
|
|
387
406
|
}
|
|
388
|
-
function
|
|
407
|
+
function Yt(i, t) {
|
|
389
408
|
try {
|
|
390
409
|
return t in i;
|
|
391
410
|
} catch {
|
|
392
411
|
return !1;
|
|
393
412
|
}
|
|
394
413
|
}
|
|
395
|
-
function
|
|
396
|
-
return
|
|
414
|
+
function Qr(i, t) {
|
|
415
|
+
return Yt(i, t) && !(Object.hasOwnProperty.call(i, t) && Object.propertyIsEnumerable.call(i, t));
|
|
397
416
|
}
|
|
398
|
-
function
|
|
417
|
+
function ei(i, t, e) {
|
|
399
418
|
var r = {};
|
|
400
|
-
return e.isMergeableObject(i) &&
|
|
401
|
-
r[s] =
|
|
402
|
-
}),
|
|
403
|
-
|
|
419
|
+
return e.isMergeableObject(i) && Rt(i).forEach(function(s) {
|
|
420
|
+
r[s] = ve(i[s], e);
|
|
421
|
+
}), Rt(t).forEach(function(s) {
|
|
422
|
+
Qr(i, s) || (Yt(i, s) && e.isMergeableObject(t[s]) ? r[s] = Xr(s, e)(i[s], t[s], e) : r[s] = ve(t[s], e));
|
|
404
423
|
}), r;
|
|
405
424
|
}
|
|
406
|
-
function
|
|
407
|
-
e = e || {}, e.arrayMerge = e.arrayMerge ||
|
|
425
|
+
function ae(i, t, e) {
|
|
426
|
+
e = e || {}, e.arrayMerge = e.arrayMerge || Kr, e.isMergeableObject = e.isMergeableObject || Hr, e.cloneUnlessOtherwiseSpecified = ve;
|
|
408
427
|
var r = Array.isArray(t), s = Array.isArray(i), n = r === s;
|
|
409
|
-
return n ? r ? e.arrayMerge(i, t, e) :
|
|
428
|
+
return n ? r ? e.arrayMerge(i, t, e) : ei(i, t, e) : ve(t, e);
|
|
410
429
|
}
|
|
411
|
-
|
|
430
|
+
ae.all = function(t, e) {
|
|
412
431
|
if (!Array.isArray(t))
|
|
413
432
|
throw new Error("first argument should be an array");
|
|
414
433
|
return t.reduce(function(r, s) {
|
|
415
|
-
return
|
|
434
|
+
return ae(r, s, e);
|
|
416
435
|
}, {});
|
|
417
436
|
};
|
|
418
|
-
var
|
|
419
|
-
const
|
|
437
|
+
var ti = ae, ri = ti;
|
|
438
|
+
const Kt = /* @__PURE__ */ rt(ri), Ie = ["3.0"], ii = {
|
|
420
439
|
baidu: {
|
|
421
440
|
version: "3.0",
|
|
422
441
|
// 在build时会被静态替换, 导致使用者不能无法设置它
|
|
@@ -431,25 +450,25 @@ const jt = /* @__PURE__ */ Je(Ur), ke = ["3.0"], qr = {
|
|
|
431
450
|
libraries: ["places"]
|
|
432
451
|
},
|
|
433
452
|
here: {
|
|
434
|
-
version:
|
|
453
|
+
version: Ie[0],
|
|
435
454
|
key: ""
|
|
436
455
|
}
|
|
437
456
|
};
|
|
438
|
-
let
|
|
439
|
-
function
|
|
440
|
-
return
|
|
457
|
+
let Xt;
|
|
458
|
+
function Jt() {
|
|
459
|
+
return Xt || C("请先安装: Vue<PartialTgMapConfig>.use(TgMap, {})");
|
|
441
460
|
}
|
|
442
|
-
function
|
|
443
|
-
i != null && (
|
|
461
|
+
function si(i) {
|
|
462
|
+
i != null && (Xt = Kt(ii, i));
|
|
444
463
|
}
|
|
445
|
-
var
|
|
464
|
+
var Qe;
|
|
446
465
|
((i) => {
|
|
447
466
|
function t(e) {
|
|
448
467
|
return e.scrollWidth > e.clientWidth || e.scrollHeight > e.clientHeight;
|
|
449
468
|
}
|
|
450
469
|
i.isScrollable = t;
|
|
451
|
-
})(
|
|
452
|
-
var
|
|
470
|
+
})(Qe || (Qe = {}));
|
|
471
|
+
var le;
|
|
453
472
|
((i) => {
|
|
454
473
|
function t(h, o) {
|
|
455
474
|
return h.length === o.length && h.every((l, d) => l === o[d]);
|
|
@@ -482,8 +501,8 @@ var ae;
|
|
|
482
501
|
return h.length > 0;
|
|
483
502
|
}
|
|
484
503
|
i.isNotEmpty = a;
|
|
485
|
-
})(
|
|
486
|
-
var
|
|
504
|
+
})(le || (le = {}));
|
|
505
|
+
var he;
|
|
487
506
|
((i) => {
|
|
488
507
|
function t(s, n) {
|
|
489
508
|
const a = s.getLength();
|
|
@@ -507,20 +526,20 @@ var le;
|
|
|
507
526
|
];
|
|
508
527
|
}
|
|
509
528
|
i.listenChanged = r;
|
|
510
|
-
})(
|
|
511
|
-
function
|
|
529
|
+
})(he || (he = {}));
|
|
530
|
+
function Qt(i, t, e) {
|
|
512
531
|
return i.addListener(t, e).remove;
|
|
513
532
|
}
|
|
514
|
-
function
|
|
533
|
+
function ni(i, t, e) {
|
|
515
534
|
return i.addEventListener(t, e), () => i.removeEventListener(t, e);
|
|
516
535
|
}
|
|
517
|
-
function
|
|
536
|
+
function oi(i, t, e, r) {
|
|
518
537
|
return i.addEventListener(t, e, r), () => i.removeEventListener(t, e, r);
|
|
519
538
|
}
|
|
520
|
-
function
|
|
539
|
+
function $t(i, t, e) {
|
|
521
540
|
return i.addEventListener(t, e), () => i.removeEventListener(t, e);
|
|
522
541
|
}
|
|
523
|
-
class
|
|
542
|
+
class er {
|
|
524
543
|
constructor(t, e) {
|
|
525
544
|
c(this, "eventMap", /* @__PURE__ */ new Map());
|
|
526
545
|
c(this, "target", void 0);
|
|
@@ -530,9 +549,9 @@ class qt {
|
|
|
530
549
|
return this.target = t, this;
|
|
531
550
|
}
|
|
532
551
|
}
|
|
533
|
-
class
|
|
552
|
+
class Ze {
|
|
534
553
|
constructor(t, e) {
|
|
535
|
-
c(this, "eventHub", new
|
|
554
|
+
c(this, "eventHub", new tr());
|
|
536
555
|
this.delegate = t, this.options = e;
|
|
537
556
|
}
|
|
538
557
|
notify(t) {
|
|
@@ -545,28 +564,28 @@ class De {
|
|
|
545
564
|
return this.delegate.setTarget(t), this;
|
|
546
565
|
}
|
|
547
566
|
addEventListener(t, e) {
|
|
548
|
-
if (
|
|
567
|
+
if (le.includesTyped(this.options.types, t)) {
|
|
549
568
|
this.eventHub.hasListener(t) || this.options.onListen(t), this.eventHub.addEventListener(t, e);
|
|
550
569
|
return;
|
|
551
570
|
}
|
|
552
571
|
this.delegate.addEventListener(t, e);
|
|
553
572
|
}
|
|
554
573
|
removeEventListener(t, e) {
|
|
555
|
-
if (
|
|
574
|
+
if (le.includesTyped(this.options.types, t)) {
|
|
556
575
|
this.eventHub.removeEventListener(t, e), this.eventHub.hasListener(t) || this.options.onCancel(t);
|
|
557
576
|
return;
|
|
558
577
|
}
|
|
559
578
|
this.delegate.removeEventListener(t, e);
|
|
560
579
|
}
|
|
561
580
|
}
|
|
562
|
-
const
|
|
581
|
+
const Bt = class extends er {
|
|
563
582
|
addEventListener(t, e) {
|
|
564
|
-
const r =
|
|
583
|
+
const r = Be(t, e);
|
|
565
584
|
if (this.eventMap.get(r)) {
|
|
566
585
|
console.warn("listener已经添加过了", r, e);
|
|
567
586
|
return;
|
|
568
587
|
}
|
|
569
|
-
const s = this.inner.addListener(
|
|
588
|
+
const s = this.inner.addListener(Bt.EVENT_TYPE_MAP[t] || t, (n) => {
|
|
570
589
|
const a = {
|
|
571
590
|
type: t,
|
|
572
591
|
target: this.target,
|
|
@@ -577,13 +596,13 @@ const Pt = class extends qt {
|
|
|
577
596
|
this.eventMap.set(r, s);
|
|
578
597
|
}
|
|
579
598
|
removeEventListener(t, e) {
|
|
580
|
-
const r =
|
|
599
|
+
const r = Be(t, e), s = this.eventMap.get(r);
|
|
581
600
|
s ? (s.remove(), this.eventMap.delete(r)) : console.warn("移除失败, 不存在该listener", r, e);
|
|
582
601
|
}
|
|
583
602
|
};
|
|
584
|
-
let
|
|
603
|
+
let te = Bt;
|
|
585
604
|
// 事件类型映射: tg => google
|
|
586
|
-
c(
|
|
605
|
+
c(te, "EVENT_TYPE_MAP", {
|
|
587
606
|
"center-changed": "center_changed",
|
|
588
607
|
"zoom-changed": "zoom_changed",
|
|
589
608
|
"radius-changed": "radius_changed",
|
|
@@ -599,9 +618,9 @@ c(ee, "EVENT_TYPE_MAP", {
|
|
|
599
618
|
"map-mouseup": "mouseup",
|
|
600
619
|
"map-dblclick": "dblclick"
|
|
601
620
|
});
|
|
602
|
-
const
|
|
621
|
+
const ze = class extends er {
|
|
603
622
|
addEventListener(t, e) {
|
|
604
|
-
const r =
|
|
623
|
+
const r = Be(t, e);
|
|
605
624
|
if (this.eventMap.get(r)) {
|
|
606
625
|
console.warn("listener已经添加过了", r, e);
|
|
607
626
|
return;
|
|
@@ -614,17 +633,17 @@ const Re = class extends qt {
|
|
|
614
633
|
};
|
|
615
634
|
n.point && (a.position = y.fromBaidu(n.point, this.coordTypeSupplier.coordType)), e.call(this.target, a);
|
|
616
635
|
};
|
|
617
|
-
this.inner.addEventListener(
|
|
636
|
+
this.inner.addEventListener(ze.EVENT_TYPE_MAP[t] || t, s), this.eventMap.set(r, s);
|
|
618
637
|
}
|
|
619
638
|
removeEventListener(t, e) {
|
|
620
|
-
const r =
|
|
621
|
-
s ? (this.inner.removeEventListener(
|
|
639
|
+
const r = Be(t, e), s = this.eventMap.get(r);
|
|
640
|
+
s ? (this.inner.removeEventListener(ze.EVENT_TYPE_MAP[t] || t, s), this.eventMap.delete(r)) : console.warn("移除失败, 不存在该listener", r, e);
|
|
622
641
|
}
|
|
623
642
|
};
|
|
624
|
-
let
|
|
643
|
+
let oe = ze;
|
|
625
644
|
// cSpell:words clickclose
|
|
626
645
|
// 事件类型映射, tg => baidu
|
|
627
|
-
c(
|
|
646
|
+
c(oe, "EVENT_TYPE_MAP", {
|
|
628
647
|
drag: "dragging",
|
|
629
648
|
closeclick: "clickclose",
|
|
630
649
|
// baidu不支持contextmenu事件, 将其映射为rightclick
|
|
@@ -632,7 +651,7 @@ c(ne, "EVENT_TYPE_MAP", {
|
|
|
632
651
|
"zoom-changed": "zoomend",
|
|
633
652
|
"map-type-changed": "maptypechange"
|
|
634
653
|
});
|
|
635
|
-
class
|
|
654
|
+
class tr {
|
|
636
655
|
constructor() {
|
|
637
656
|
c(this, "typeMap", /* @__PURE__ */ new Map());
|
|
638
657
|
}
|
|
@@ -642,7 +661,7 @@ class Yt {
|
|
|
642
661
|
}
|
|
643
662
|
removeEventListener(t, e) {
|
|
644
663
|
const r = this.typeMap.get(t);
|
|
645
|
-
r &&
|
|
664
|
+
r && le.remove(r, e);
|
|
646
665
|
}
|
|
647
666
|
hasListener(t) {
|
|
648
667
|
const e = this.typeMap.get(t);
|
|
@@ -653,25 +672,25 @@ class Yt {
|
|
|
653
672
|
e && e.forEach((r) => r.call(t.target, t));
|
|
654
673
|
}
|
|
655
674
|
}
|
|
656
|
-
class
|
|
675
|
+
class Dt {
|
|
657
676
|
/**
|
|
658
677
|
* `keys`和`values`数组中可以有相同的值, 若存在相同值, 则index越小的优先级越高
|
|
659
678
|
*/
|
|
660
679
|
constructor(t, e) {
|
|
661
680
|
c(this, "keyToValue", /* @__PURE__ */ new Map());
|
|
662
681
|
c(this, "valueToKey", /* @__PURE__ */ new Map());
|
|
663
|
-
|
|
682
|
+
ne(t.length === e.length);
|
|
664
683
|
for (let r = t.length - 1; r >= 0; r--)
|
|
665
684
|
this.keyToValue.set(t[r], e[r]), this.valueToKey.set(e[r], t[r]);
|
|
666
685
|
}
|
|
667
686
|
toKey(t) {
|
|
668
|
-
return this.valueToKey.get(t) ??
|
|
687
|
+
return this.valueToKey.get(t) ?? C();
|
|
669
688
|
}
|
|
670
689
|
toValue(t) {
|
|
671
|
-
return this.keyToValue.get(t) ??
|
|
690
|
+
return this.keyToValue.get(t) ?? C();
|
|
672
691
|
}
|
|
673
692
|
}
|
|
674
|
-
class
|
|
693
|
+
class ai {
|
|
675
694
|
constructor(t, e = 10) {
|
|
676
695
|
c(this, "map", /* @__PURE__ */ new Map());
|
|
677
696
|
this.values = t, this.maxSize4Debug = e;
|
|
@@ -697,10 +716,10 @@ class Jr {
|
|
|
697
716
|
return this.getValueMap(t).get(e);
|
|
698
717
|
}
|
|
699
718
|
get(t, e) {
|
|
700
|
-
return this.getOrNull(t, e) ??
|
|
719
|
+
return this.getOrNull(t, e) ?? C(`key(${e})不存在与valueMap(${this.getValueMap(t)})中`);
|
|
701
720
|
}
|
|
702
721
|
}
|
|
703
|
-
class
|
|
722
|
+
class me {
|
|
704
723
|
constructor(t) {
|
|
705
724
|
c(this, "value");
|
|
706
725
|
this.creator = t;
|
|
@@ -709,7 +728,7 @@ class ge {
|
|
|
709
728
|
return this.value === void 0 && (this.value = this.creator()), this.value;
|
|
710
729
|
}
|
|
711
730
|
}
|
|
712
|
-
var k = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-center", i.TOP_RIGHT = "top-right", i.BOTTOM_LEFT = "bottom-left", i.BOTTOM_CENTER = "bottom-center", i.BOTTOM_RIGHT = "bottom-right", i.LEFT_TOP = "left-top", i.LEFT_CENTER = "left-center", i.LEFT_BOTTOM = "left-bottom", i.RIGHT_TOP = "right-top", i.RIGHT_CENTER = "right-center", i.RIGHT_BOTTOM = "right-bottom", i))(k || {}),
|
|
731
|
+
var k = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-center", i.TOP_RIGHT = "top-right", i.BOTTOM_LEFT = "bottom-left", i.BOTTOM_CENTER = "bottom-center", i.BOTTOM_RIGHT = "bottom-right", i.LEFT_TOP = "left-top", i.LEFT_CENTER = "left-center", i.LEFT_BOTTOM = "left-bottom", i.RIGHT_TOP = "right-top", i.RIGHT_CENTER = "right-center", i.RIGHT_BOTTOM = "right-bottom", i))(k || {}), R;
|
|
713
732
|
((i) => {
|
|
714
733
|
let t, e;
|
|
715
734
|
const r = [
|
|
@@ -728,7 +747,7 @@ var k = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
|
|
|
728
747
|
/* RIGHT_BOTTOM */
|
|
729
748
|
];
|
|
730
749
|
function s() {
|
|
731
|
-
return t || (t = new
|
|
750
|
+
return t || (t = new Dt(r, [
|
|
732
751
|
/* | @tg/map |名字相同| baidu | */
|
|
733
752
|
/* TOP_LEFT = */
|
|
734
753
|
BMAP_ANCHOR_TOP_LEFT,
|
|
@@ -758,7 +777,7 @@ var k = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
|
|
|
758
777
|
}
|
|
759
778
|
i.getBaidu = s;
|
|
760
779
|
function n() {
|
|
761
|
-
return e || (e = new
|
|
780
|
+
return e || (e = new Dt(r, [
|
|
762
781
|
google.maps.ControlPosition.TOP_LEFT,
|
|
763
782
|
google.maps.ControlPosition.TOP_CENTER,
|
|
764
783
|
google.maps.ControlPosition.TOP_RIGHT,
|
|
@@ -774,17 +793,17 @@ var k = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
|
|
|
774
793
|
])), e;
|
|
775
794
|
}
|
|
776
795
|
i.getGoogle = n;
|
|
777
|
-
})(
|
|
778
|
-
class
|
|
796
|
+
})(R || (R = {}));
|
|
797
|
+
class li {
|
|
779
798
|
constructor(t) {
|
|
780
799
|
/** 实际添加到地图中的control对象 */
|
|
781
800
|
c(this, "inner");
|
|
782
801
|
this.position = t;
|
|
783
802
|
}
|
|
784
803
|
}
|
|
785
|
-
class
|
|
804
|
+
class rr {
|
|
786
805
|
}
|
|
787
|
-
class
|
|
806
|
+
class st extends rr {
|
|
788
807
|
constructor(t, e) {
|
|
789
808
|
super(), this.inner = t, this.position = e;
|
|
790
809
|
}
|
|
@@ -795,10 +814,10 @@ class et extends Kt {
|
|
|
795
814
|
t ? this.inner.show() : this.inner.hide();
|
|
796
815
|
}
|
|
797
816
|
getPosition() {
|
|
798
|
-
return this.position ??
|
|
817
|
+
return this.position ?? R.getBaidu().toKey(this.inner.getAnchor());
|
|
799
818
|
}
|
|
800
819
|
setPosition(t) {
|
|
801
|
-
this.position = t, this.inner.setAnchor(
|
|
820
|
+
this.position = t, this.inner.setAnchor(R.getBaidu().toValue(t));
|
|
802
821
|
}
|
|
803
822
|
addTo(t) {
|
|
804
823
|
t.innerMap.addControl(this.inner);
|
|
@@ -807,7 +826,7 @@ class et extends Kt {
|
|
|
807
826
|
t.innerMap.removeControl(this.inner);
|
|
808
827
|
}
|
|
809
828
|
}
|
|
810
|
-
class
|
|
829
|
+
class nt extends rr {
|
|
811
830
|
constructor(e, r) {
|
|
812
831
|
super();
|
|
813
832
|
c(this, "visible", !1);
|
|
@@ -834,7 +853,7 @@ class tt extends Kt {
|
|
|
834
853
|
}
|
|
835
854
|
onCreateOptions() {
|
|
836
855
|
return {
|
|
837
|
-
position:
|
|
856
|
+
position: R.getGoogle().toValue(this.position)
|
|
838
857
|
};
|
|
839
858
|
}
|
|
840
859
|
tryUpdateOptions() {
|
|
@@ -844,7 +863,7 @@ class tt extends Kt {
|
|
|
844
863
|
});
|
|
845
864
|
}
|
|
846
865
|
}
|
|
847
|
-
var
|
|
866
|
+
var ir = /* @__PURE__ */ ((i) => (i.normal = "normal", i.satellite = "satellite", i.hybrid = "hybrid", i))(ir || {});
|
|
848
867
|
class B {
|
|
849
868
|
constructor(t, e, r, s) {
|
|
850
869
|
this.id = t, this.baidu = e, this.google = r, this.googleCoordType = s;
|
|
@@ -853,7 +872,7 @@ class B {
|
|
|
853
872
|
return this.id;
|
|
854
873
|
}
|
|
855
874
|
getBaiduCoordType() {
|
|
856
|
-
return
|
|
875
|
+
return S.bd09;
|
|
857
876
|
}
|
|
858
877
|
asBaiduMapType() {
|
|
859
878
|
return this.baidu();
|
|
@@ -866,19 +885,19 @@ class B {
|
|
|
866
885
|
return this.google();
|
|
867
886
|
}
|
|
868
887
|
asGoogleMapType() {
|
|
869
|
-
|
|
888
|
+
it("google的内置地图没有对应的实例");
|
|
870
889
|
}
|
|
871
890
|
}
|
|
872
|
-
class
|
|
891
|
+
class zs {
|
|
873
892
|
constructor(t, e) {
|
|
874
|
-
c(this, "baiduLayerCached", new
|
|
893
|
+
c(this, "baiduLayerCached", new me(() => {
|
|
875
894
|
const t = new BMap.TileLayer({});
|
|
876
895
|
return t.getTilesUrl = (e, r) => {
|
|
877
896
|
const s = Math.pow(2, r - 1), n = e.x + s, a = s - 1 - e.y;
|
|
878
897
|
return this.options.getTileUrl({ x: n, y: a }, r);
|
|
879
898
|
}, t;
|
|
880
899
|
}));
|
|
881
|
-
c(this, "baiduMapTypeCached", new
|
|
900
|
+
c(this, "baiduMapTypeCached", new me(() => {
|
|
882
901
|
const t = new BMap.MapType(this.options.name, this.baiduLayerCached.get(), {
|
|
883
902
|
maxZoom: this.options.maxZoom,
|
|
884
903
|
minZoom: this.options.minZoom,
|
|
@@ -886,7 +905,7 @@ class ys {
|
|
|
886
905
|
});
|
|
887
906
|
return t.__baidu_map_type__ = this, t;
|
|
888
907
|
}));
|
|
889
|
-
c(this, "googleCached", new
|
|
908
|
+
c(this, "googleCached", new me(() => {
|
|
890
909
|
const t = new google.maps.ImageMapType({
|
|
891
910
|
getTileUrl: (e, r) => this.options.getTileUrl(e, r),
|
|
892
911
|
tileSize: new google.maps.Size(256, 256),
|
|
@@ -918,13 +937,13 @@ class ys {
|
|
|
918
937
|
return this.googleCached.get();
|
|
919
938
|
}
|
|
920
939
|
asGoogleLayer() {
|
|
921
|
-
|
|
940
|
+
it("这个方法不会被调用");
|
|
922
941
|
}
|
|
923
942
|
}
|
|
924
|
-
class
|
|
943
|
+
class hi {
|
|
925
944
|
constructor() {
|
|
926
|
-
c(this, "baiduCache", new
|
|
927
|
-
c(this, "googleCache", new
|
|
945
|
+
c(this, "baiduCache", new me(() => new BMap.TrafficLayer()));
|
|
946
|
+
c(this, "googleCache", new me(() => new google.maps.TrafficLayer()));
|
|
928
947
|
}
|
|
929
948
|
asBaiduLayer() {
|
|
930
949
|
return this.baiduCache.get();
|
|
@@ -933,21 +952,21 @@ class ei {
|
|
|
933
952
|
return this.googleCache.get();
|
|
934
953
|
}
|
|
935
954
|
}
|
|
936
|
-
var
|
|
955
|
+
var A;
|
|
937
956
|
((i) => {
|
|
938
|
-
i.NORMAL = new B("normal", () => BMAP_NORMAL_MAP, () => google.maps.MapTypeId.ROADMAP,
|
|
957
|
+
i.NORMAL = new B("normal", () => BMAP_NORMAL_MAP, () => google.maps.MapTypeId.ROADMAP, S.gcj02), i.SATELLITE = new B("satellite", () => BMAP_SATELLITE_MAP, () => google.maps.MapTypeId.SATELLITE, S.wgs84), i.HYBRID = new B("hybrid", () => BMAP_HYBRID_MAP, () => google.maps.MapTypeId.HYBRID, S.gcj02), i.TERRAIN = new B("terrain", () => (
|
|
939
958
|
/* 三维 */
|
|
940
959
|
BMAP_PERSPECTIVE_MAP
|
|
941
960
|
), () => (
|
|
942
961
|
/* 地形 */
|
|
943
962
|
google.maps.MapTypeId.TERRAIN
|
|
944
|
-
),
|
|
945
|
-
})(
|
|
946
|
-
var
|
|
947
|
-
const
|
|
948
|
-
class
|
|
963
|
+
), S.wgs84), i.BUILD_IN_MAP_TYPES = new ai([i.NORMAL, i.SATELLITE, i.HYBRID, i.TERRAIN]);
|
|
964
|
+
})(A || (A = {}));
|
|
965
|
+
var sr = /* @__PURE__ */ ((i) => (i.DEFAULT = "default", i.HORIZONTAL = "horizontal", i.DROPDOWN = "dropdown", i))(sr || {});
|
|
966
|
+
const nr = [A.NORMAL, A.SATELLITE, A.HYBRID];
|
|
967
|
+
class ot extends st {
|
|
949
968
|
static create(t) {
|
|
950
|
-
const e = t.mapTypes ??
|
|
969
|
+
const e = t.mapTypes ?? nr, r = {
|
|
951
970
|
default: BMAP_MAPTYPE_CONTROL_HORIZONTAL,
|
|
952
971
|
horizontal: BMAP_MAPTYPE_CONTROL_HORIZONTAL,
|
|
953
972
|
dropdown: BMAP_MAPTYPE_CONTROL_DROPDOWN
|
|
@@ -955,23 +974,23 @@ class rt extends et {
|
|
|
955
974
|
type: t.type && r[t.type],
|
|
956
975
|
mapTypes: e.map((n) => n.asBaiduMapType())
|
|
957
976
|
});
|
|
958
|
-
return t.position && s.setAnchor(
|
|
977
|
+
return t.position && s.setAnchor(R.getBaidu().toValue(t.position)), new ot(s, t.position);
|
|
959
978
|
}
|
|
960
979
|
}
|
|
961
|
-
const
|
|
962
|
-
constructor(t = "default", e = k.TOP_LEFT, r =
|
|
963
|
-
super("mapType", e), this.type = t, this.mapTypes = r,
|
|
980
|
+
const se = class extends nt {
|
|
981
|
+
constructor(t = "default", e = k.TOP_LEFT, r = nr) {
|
|
982
|
+
super("mapType", e), this.type = t, this.mapTypes = r, se.type2google || (se.type2google = {
|
|
964
983
|
default: google.maps.MapTypeControlStyle.DEFAULT,
|
|
965
984
|
horizontal: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
|
|
966
985
|
dropdown: google.maps.MapTypeControlStyle.DROPDOWN_MENU
|
|
967
986
|
});
|
|
968
987
|
}
|
|
969
988
|
static create(t) {
|
|
970
|
-
return new
|
|
989
|
+
return new se(t.type, t.position, t.mapTypes);
|
|
971
990
|
}
|
|
972
991
|
onCreateOptions() {
|
|
973
992
|
const t = super.onCreateOptions();
|
|
974
|
-
return t.style =
|
|
993
|
+
return t.style = se.type2google[this.type], t.mapTypeIds = this.mapTypes.map((e) => e instanceof B ? e.getGoogleMapTypeId() : e.id), t;
|
|
975
994
|
}
|
|
976
995
|
addTo(t) {
|
|
977
996
|
super.addTo(t), this.mapTypes.forEach((e) => {
|
|
@@ -979,43 +998,43 @@ const ie = class extends tt {
|
|
|
979
998
|
});
|
|
980
999
|
}
|
|
981
1000
|
};
|
|
982
|
-
let
|
|
983
|
-
c(
|
|
984
|
-
class
|
|
1001
|
+
let Pe = se;
|
|
1002
|
+
c(Pe, "type2google");
|
|
1003
|
+
class at extends st {
|
|
985
1004
|
static create(t) {
|
|
986
1005
|
const e = new BMap.ScaleControl({
|
|
987
|
-
anchor: t.position &&
|
|
1006
|
+
anchor: t.position && R.getBaidu().toValue(t.position)
|
|
988
1007
|
});
|
|
989
|
-
return new
|
|
1008
|
+
return new at(e, t.position);
|
|
990
1009
|
}
|
|
991
1010
|
}
|
|
992
|
-
class
|
|
1011
|
+
class lt extends nt {
|
|
993
1012
|
static create(t) {
|
|
994
|
-
return new
|
|
1013
|
+
return new lt(t.position);
|
|
995
1014
|
}
|
|
996
1015
|
constructor(t = k.BOTTOM_RIGHT) {
|
|
997
1016
|
super("scale", t);
|
|
998
1017
|
}
|
|
999
1018
|
}
|
|
1000
|
-
class
|
|
1019
|
+
class ht extends st {
|
|
1001
1020
|
static create(t) {
|
|
1002
1021
|
const e = new BMap.NavigationControl({
|
|
1003
1022
|
type: BMAP_NAVIGATION_CONTROL_ZOOM,
|
|
1004
1023
|
// enableGeolocation: true,
|
|
1005
|
-
anchor: t.position &&
|
|
1024
|
+
anchor: t.position && R.getBaidu().toValue(t.position)
|
|
1006
1025
|
});
|
|
1007
|
-
return new
|
|
1026
|
+
return new ht(e, t.position);
|
|
1008
1027
|
}
|
|
1009
1028
|
}
|
|
1010
|
-
class
|
|
1029
|
+
class ct extends nt {
|
|
1011
1030
|
static create(t) {
|
|
1012
|
-
return new
|
|
1031
|
+
return new ct(t.position);
|
|
1013
1032
|
}
|
|
1014
1033
|
constructor(t = k.RIGHT_BOTTOM) {
|
|
1015
1034
|
super("zoom", t);
|
|
1016
1035
|
}
|
|
1017
1036
|
}
|
|
1018
|
-
function
|
|
1037
|
+
function ci(i) {
|
|
1019
1038
|
let t, e, r;
|
|
1020
1039
|
const s = "The Google Maps JavaScript API", n = "google", a = "importLibrary", h = "__ib__", o = document, l = window, d = l[n] || (l[n] = {}), u = d.maps || (d.maps = {}), p = /* @__PURE__ */ new Set(), b = new URLSearchParams(), _ = () => t || (t = new Promise(async (M, g) => {
|
|
1021
1040
|
var f;
|
|
@@ -1026,17 +1045,17 @@ function ti(i) {
|
|
|
1026
1045
|
}));
|
|
1027
1046
|
u[a] ? console.warn(s + " only loads once. Ignoring:", i) : u[a] = (M, ...g) => p.add(M) && _().then(() => u[a](M, ...g));
|
|
1028
1047
|
}
|
|
1029
|
-
let
|
|
1030
|
-
const
|
|
1048
|
+
let di, ui;
|
|
1049
|
+
const X = {
|
|
1031
1050
|
/** Google的坐标0点 */
|
|
1032
1051
|
get LATLNG_ZERO() {
|
|
1033
|
-
return
|
|
1052
|
+
return di ?? (di = new google.maps.LatLng({ lat: 0, lng: 0 }));
|
|
1034
1053
|
},
|
|
1035
1054
|
get BOUNDS_ZERO() {
|
|
1036
|
-
return
|
|
1055
|
+
return ui ?? (ui = new google.maps.LatLngBounds(this.LATLNG_ZERO, this.LATLNG_ZERO));
|
|
1037
1056
|
}
|
|
1038
1057
|
};
|
|
1039
|
-
function
|
|
1058
|
+
function or(i, t = { country: "", province: "", city: "", district: "", street: "", streetNumber: "" }) {
|
|
1040
1059
|
for (const e of i)
|
|
1041
1060
|
for (const r of e.types)
|
|
1042
1061
|
switch (r) {
|
|
@@ -1061,22 +1080,22 @@ function er(i, t = { country: "", province: "", city: "", district: "", street:
|
|
|
1061
1080
|
}
|
|
1062
1081
|
return t;
|
|
1063
1082
|
}
|
|
1064
|
-
function
|
|
1083
|
+
function ar(i, t) {
|
|
1065
1084
|
var r;
|
|
1066
|
-
const e = i.address_components &&
|
|
1085
|
+
const e = i.address_components && or(i.address_components);
|
|
1067
1086
|
return {
|
|
1068
1087
|
country: (e == null ? void 0 : e.country) ?? "",
|
|
1069
1088
|
province: (e == null ? void 0 : e.province) ?? "",
|
|
1070
1089
|
city: (e == null ? void 0 : e.city) ?? "",
|
|
1071
1090
|
id: i.place_id ?? "",
|
|
1072
1091
|
address: i.formatted_address ?? "",
|
|
1073
|
-
position: y.fromGoogle(((r = i.geometry) == null ? void 0 : r.location) ??
|
|
1092
|
+
position: y.fromGoogle(((r = i.geometry) == null ? void 0 : r.location) ?? X.LATLNG_ZERO, t.coordType),
|
|
1074
1093
|
title: i.name ?? ""
|
|
1075
1094
|
};
|
|
1076
1095
|
}
|
|
1077
|
-
class
|
|
1096
|
+
class lr {
|
|
1078
1097
|
}
|
|
1079
|
-
class
|
|
1098
|
+
class pi extends lr {
|
|
1080
1099
|
constructor(e, r) {
|
|
1081
1100
|
super();
|
|
1082
1101
|
c(this, "inner");
|
|
@@ -1092,7 +1111,7 @@ class si extends rr {
|
|
|
1092
1111
|
this.inner.setBounds(e.toGoogle(this.map.coordType));
|
|
1093
1112
|
}
|
|
1094
1113
|
addResultListener(e) {
|
|
1095
|
-
return
|
|
1114
|
+
return Qt(this.inner, "place_changed", () => {
|
|
1096
1115
|
const r = this.inner.getPlace(), s = {
|
|
1097
1116
|
title: r.name ?? "",
|
|
1098
1117
|
province: "",
|
|
@@ -1102,11 +1121,11 @@ class si extends rr {
|
|
|
1102
1121
|
streetNumber: "",
|
|
1103
1122
|
country: ""
|
|
1104
1123
|
};
|
|
1105
|
-
r.address_components &&
|
|
1124
|
+
r.address_components && or(r.address_components, s), e(s);
|
|
1106
1125
|
});
|
|
1107
1126
|
}
|
|
1108
1127
|
}
|
|
1109
|
-
class
|
|
1128
|
+
class gi extends lr {
|
|
1110
1129
|
constructor(e, r) {
|
|
1111
1130
|
super();
|
|
1112
1131
|
c(this, "inner");
|
|
@@ -1120,7 +1139,7 @@ class ni extends rr {
|
|
|
1120
1139
|
const s = () => {
|
|
1121
1140
|
this.inner.setLocation(this.map.innerMap);
|
|
1122
1141
|
};
|
|
1123
|
-
this.removeableArray.push(
|
|
1142
|
+
this.removeableArray.push($t(this.map, "center-changed", s)), this.removeableArray.push($t(this.map, "zoom-changed", s));
|
|
1124
1143
|
}
|
|
1125
1144
|
}
|
|
1126
1145
|
setBounds(e) {
|
|
@@ -1128,14 +1147,14 @@ class ni extends rr {
|
|
|
1128
1147
|
}
|
|
1129
1148
|
addResultListener(e) {
|
|
1130
1149
|
let r = 0;
|
|
1131
|
-
const s =
|
|
1150
|
+
const s = ni(this.inner, "confirm", (a) => {
|
|
1132
1151
|
const h = a.item.value;
|
|
1133
1152
|
r = Date.now(), e(Object.assign({
|
|
1134
1153
|
title: h.business,
|
|
1135
1154
|
country: ""
|
|
1136
1155
|
// Baidu的自动完成只支持中国
|
|
1137
1156
|
}, h));
|
|
1138
|
-
}), n =
|
|
1157
|
+
}), n = oi(this.input, "keyup", (a) => {
|
|
1139
1158
|
a.key === "Enter" && Date.now() - r > 100 && e({
|
|
1140
1159
|
title: this.input.value,
|
|
1141
1160
|
country: "",
|
|
@@ -1151,9 +1170,47 @@ class ni extends rr {
|
|
|
1151
1170
|
};
|
|
1152
1171
|
}
|
|
1153
1172
|
}
|
|
1154
|
-
|
|
1173
|
+
class hr {
|
|
1174
|
+
constructor(t) {
|
|
1175
|
+
this.options = t;
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
const It = class extends hr {
|
|
1179
|
+
/** @see https://developers.google.com/maps/documentation/urls/get-started#directions-action */
|
|
1180
|
+
directions(t, e, r) {
|
|
1181
|
+
const s = new URL("dir/", It.BASE_URL), n = new URLSearchParams(Object.entries({
|
|
1182
|
+
api: "1",
|
|
1183
|
+
origin: Y.toString(t, S.wgs84),
|
|
1184
|
+
destination: Y.toString(e, S.wgs84),
|
|
1185
|
+
travelmode: r
|
|
1186
|
+
}).filter(qt));
|
|
1187
|
+
return s.search = "?" + n.toString(), s;
|
|
1188
|
+
}
|
|
1189
|
+
};
|
|
1190
|
+
let ke = It;
|
|
1191
|
+
c(ke, "BASE_URL", "https://www.google.com/maps/");
|
|
1192
|
+
const At = class extends hr {
|
|
1193
|
+
/** @see https://lbsyun.baidu.com/faq/api?title=webapi/uri/web#:~:text=%E6%9C%8D%E5%8A%A1%E5%9C%B0%E5%9D%80-,http%3A//api.map.baidu.com/direction,-//PC%26Webapp%E6%9C%8D%E5%8A%A1 */
|
|
1194
|
+
directions(t, e, r = "driving") {
|
|
1195
|
+
const s = new URL("direction", At.BASE_URL), n = Y.getCoordType(e) ?? Y.getCoordType(t) ?? S.bd09, a = Y.toString(e, n), h = new URLSearchParams(Object.entries({
|
|
1196
|
+
// baidu地图, 一定要有起点, 故这里用终点当起点, 防止导航失败
|
|
1197
|
+
origin: Y.toString(t, n) ?? (typeof e != "string" ? `name:请选择起点|latlng:${a}` : a),
|
|
1198
|
+
destination: a,
|
|
1199
|
+
// 默认就是bd09
|
|
1200
|
+
coord_type: n === S.bd09 ? void 0 : n,
|
|
1201
|
+
mode: r,
|
|
1202
|
+
output: "html",
|
|
1203
|
+
region: "中国",
|
|
1204
|
+
src: window.location.hostname
|
|
1205
|
+
}).filter(qt));
|
|
1206
|
+
return s.search = "?" + h.toString(), s;
|
|
1207
|
+
}
|
|
1208
|
+
};
|
|
1209
|
+
let Se = At;
|
|
1210
|
+
c(Se, "BASE_URL", "https://api.map.baidu.com/");
|
|
1211
|
+
let mi = class cr {
|
|
1155
1212
|
constructor(t, e, r) {
|
|
1156
|
-
this.extend(
|
|
1213
|
+
this.extend(cr, google.maps.OverlayView), this.map_ = t, this.MARKER_CLUSTER_IMAGE_PATH_ = "../images/m", this.MARKER_CLUSTER_IMAGE_EXTENSION_ = "png", this.markers_ = [], this.clusters_ = [], this.sizes = [53, 56, 66, 78, 90], this.styles_ = [], this.ready_ = !1;
|
|
1157
1214
|
var s = r || {};
|
|
1158
1215
|
this.zIndex_ = s.zIndex || google.maps.Marker.MAX_ZINDEX + 1, this.gridSize_ = s.gridSize || 60, this.minClusterSize_ = s.minimumClusterSize || 2, this.maxZoom_ = s.maxZoom || null, this.styles_ = s.styles || [], this.imagePath_ = s.imagePath || this.MARKER_CLUSTER_IMAGE_PATH_, this.imageExtension_ = s.imageExtension || this.MARKER_CLUSTER_IMAGE_EXTENSION_, this.zoomOnClick_ = !0, s.zoomOnClick != null && (this.zoomOnClick_ = s.zoomOnClick), this.averageCenter_ = !1, s.averageCenter != null && (this.averageCenter_ = s.averageCenter), this.setupStyles_(), this.setMap(t), this.prevZoom_ = this.map_.getZoom();
|
|
1159
1216
|
var n = this;
|
|
@@ -1572,7 +1629,7 @@ let oi = class ir {
|
|
|
1572
1629
|
if (r && r.isMarkerInClusterBounds(t))
|
|
1573
1630
|
r.addMarker(t);
|
|
1574
1631
|
else {
|
|
1575
|
-
var o = new
|
|
1632
|
+
var o = new fi(this);
|
|
1576
1633
|
o.addMarker(t), this.clusters_.push(o);
|
|
1577
1634
|
}
|
|
1578
1635
|
}
|
|
@@ -1589,9 +1646,9 @@ let oi = class ir {
|
|
|
1589
1646
|
), e = this.getExtendedBounds(t), r = 0, s; s = this.markers_[r]; r++)
|
|
1590
1647
|
!s.isAdded && this.isMarkerInBounds_(s, e) && this.addToClosestCluster_(s);
|
|
1591
1648
|
}
|
|
1592
|
-
},
|
|
1649
|
+
}, fi = class {
|
|
1593
1650
|
constructor(t) {
|
|
1594
|
-
this.markerClusterer_ = t, this.map_ = t.getMap(), this.gridSize_ = t.getGridSize(), this.minClusterSize_ = t.getMinClusterSize(), this.averageCenter_ = t.isAverageCenter(), this.center_ = null, this.markers_ = [], this.bounds_ = null, this.clusterIcon_ = new
|
|
1651
|
+
this.markerClusterer_ = t, this.map_ = t.getMap(), this.gridSize_ = t.getGridSize(), this.minClusterSize_ = t.getMinClusterSize(), this.averageCenter_ = t.isAverageCenter(), this.center_ = null, this.markers_ = [], this.bounds_ = null, this.clusterIcon_ = new dt(
|
|
1595
1652
|
this,
|
|
1596
1653
|
t.getStyles(),
|
|
1597
1654
|
t.getGridSize()
|
|
@@ -1725,9 +1782,9 @@ let oi = class ir {
|
|
|
1725
1782
|
this.clusterIcon_.setCenter(this.center_), this.clusterIcon_.setSums(a), this.clusterIcon_.show();
|
|
1726
1783
|
}
|
|
1727
1784
|
};
|
|
1728
|
-
class
|
|
1785
|
+
class dt {
|
|
1729
1786
|
constructor(t, e, r) {
|
|
1730
|
-
t.getMarkerClusterer().extend(
|
|
1787
|
+
t.getMarkerClusterer().extend(dt, google.maps.OverlayView), this.styles_ = e, this.padding_ = r || 0, this.cluster_ = t, this.center_ = null, this.map_ = t.getMap(), this.div_ = null, this.sums_ = null, this.visible_ = !1, this.setMap(this.map_);
|
|
1731
1788
|
}
|
|
1732
1789
|
/**
|
|
1733
1790
|
* Triggers the clusterclick event and zoom's if the option is set.
|
|
@@ -1858,11 +1915,11 @@ class at {
|
|
|
1858
1915
|
), e.join("");
|
|
1859
1916
|
}
|
|
1860
1917
|
}
|
|
1861
|
-
var
|
|
1918
|
+
var dr = { exports: {} };
|
|
1862
1919
|
(function(i, t) {
|
|
1863
1920
|
(function(e, r) {
|
|
1864
1921
|
i.exports = r();
|
|
1865
|
-
})(
|
|
1922
|
+
})(Ft, function() {
|
|
1866
1923
|
var e, r = e = r || { version: "1.3.8" }, s = {};
|
|
1867
1924
|
r.guid = "$BAIDU$", s[r.guid] = s[r.guid] || {}, r.dom = r.dom || {}, r.dom.g = function(o) {
|
|
1868
1925
|
return typeof o == "string" || o instanceof String ? document.getElementById(o) : o && o.nodeName && (o.nodeType == 1 || o.nodeType == 9) ? o : null;
|
|
@@ -2051,25 +2108,25 @@ var sr = { exports: {} };
|
|
|
2051
2108
|
});
|
|
2052
2109
|
}, h;
|
|
2053
2110
|
});
|
|
2054
|
-
})(
|
|
2055
|
-
var
|
|
2056
|
-
const
|
|
2057
|
-
var
|
|
2058
|
-
t =
|
|
2111
|
+
})(dr);
|
|
2112
|
+
var yi = dr.exports;
|
|
2113
|
+
const zt = /* @__PURE__ */ rt(yi);
|
|
2114
|
+
var ur = function(i, t, e) {
|
|
2115
|
+
t = vi(t);
|
|
2059
2116
|
var r = i.pointToPixel(t.getNorthEast()), s = i.pointToPixel(t.getSouthWest());
|
|
2060
2117
|
r.x += e, r.y -= e, s.x -= e, s.y += e;
|
|
2061
2118
|
var n = i.pixelToPoint(r), a = i.pixelToPoint(s);
|
|
2062
2119
|
return new BMap.Bounds(a, n);
|
|
2063
|
-
},
|
|
2064
|
-
var t =
|
|
2120
|
+
}, vi = function(i) {
|
|
2121
|
+
var t = Le(i.getNorthEast().lng, -180, 180), e = Le(i.getSouthWest().lng, -180, 180), r = Le(i.getNorthEast().lat, -74, 74), s = Le(i.getSouthWest().lat, -74, 74);
|
|
2065
2122
|
return new BMap.Bounds(new BMap.Point(e, s), new BMap.Point(t, r));
|
|
2066
|
-
},
|
|
2123
|
+
}, Le = function(i, t, e) {
|
|
2067
2124
|
return t && (i = Math.max(i, t)), e && (i = Math.min(i, e)), i;
|
|
2068
|
-
},
|
|
2125
|
+
}, pr = function(i) {
|
|
2069
2126
|
return Object.prototype.toString.call(i) === "[object Array]";
|
|
2070
|
-
},
|
|
2127
|
+
}, gr = function(i, t) {
|
|
2071
2128
|
var e = -1;
|
|
2072
|
-
if (
|
|
2129
|
+
if (pr(t)) {
|
|
2073
2130
|
if (t.indexOf)
|
|
2074
2131
|
e = t.indexOf(i);
|
|
2075
2132
|
else
|
|
@@ -2097,7 +2154,7 @@ var nr = function(i, t, e) {
|
|
|
2097
2154
|
r._redraw();
|
|
2098
2155
|
});
|
|
2099
2156
|
var s = e.markers;
|
|
2100
|
-
|
|
2157
|
+
pr(s) && this.addMarkers(s);
|
|
2101
2158
|
}
|
|
2102
2159
|
};
|
|
2103
2160
|
T.prototype.addMarkers = function(i) {
|
|
@@ -2108,7 +2165,7 @@ T.prototype.addMarkers = function(i) {
|
|
|
2108
2165
|
}
|
|
2109
2166
|
};
|
|
2110
2167
|
T.prototype._pushMarkerTo = function(i) {
|
|
2111
|
-
var t =
|
|
2168
|
+
var t = gr(i, this._markers);
|
|
2112
2169
|
t === -1 && (i.isInCluster = !1, this._markers.push(i));
|
|
2113
2170
|
};
|
|
2114
2171
|
T.prototype.addMarker = function(i) {
|
|
@@ -2117,7 +2174,7 @@ T.prototype.addMarker = function(i) {
|
|
|
2117
2174
|
T.prototype._createClusters = function() {
|
|
2118
2175
|
var i = this._map.getBounds();
|
|
2119
2176
|
if (i.getCenter()) {
|
|
2120
|
-
for (var t =
|
|
2177
|
+
for (var t = ur(this._map, i, this._gridSize), e = 0, r; r = this._markers[e]; e++)
|
|
2121
2178
|
!r.isInCluster && t.containsPoint(r.getPosition()) && this._addToClosestCluster(r);
|
|
2122
2179
|
for (var s = this._markers.length, e = 0; e < s; e++)
|
|
2123
2180
|
this._clusters[e] && this._clusters[e].render();
|
|
@@ -2136,7 +2193,7 @@ T.prototype._addToClosestCluster = function(i) {
|
|
|
2136
2193
|
if (e && e.isMarkerInClusterBounds(i))
|
|
2137
2194
|
e.addMarker(i);
|
|
2138
2195
|
else {
|
|
2139
|
-
var s = new
|
|
2196
|
+
var s = new D(this);
|
|
2140
2197
|
s.addMarker(i), this._clusters.push(s);
|
|
2141
2198
|
}
|
|
2142
2199
|
};
|
|
@@ -2157,7 +2214,7 @@ T.prototype._removeMarkersFromMap = function() {
|
|
|
2157
2214
|
}
|
|
2158
2215
|
};
|
|
2159
2216
|
T.prototype._removeMarker = function(i) {
|
|
2160
|
-
var t =
|
|
2217
|
+
var t = gr(i, this._markers);
|
|
2161
2218
|
return t === -1 ? !1 : (this._map.removeOverlay(i), this._markers.splice(t, 1), !0);
|
|
2162
2219
|
};
|
|
2163
2220
|
T.prototype.removeMarker = function(i) {
|
|
@@ -2231,9 +2288,9 @@ T.prototype.setTextCalculator = function(i) {
|
|
|
2231
2288
|
T.prototype.setStylesIndexCalculator = function(i) {
|
|
2232
2289
|
this._stylesIndexCalculator = i;
|
|
2233
2290
|
};
|
|
2234
|
-
function
|
|
2291
|
+
function D(i) {
|
|
2235
2292
|
var t = this;
|
|
2236
|
-
this._markerClusterer = i, this._map = i.getMap(), this._minClusterSize = i.getMinClusterSize(), this._isAverageCenter = i.isAverageCenter(), this._center = null, this._markers = [], this._gridBounds = null, this._isReal = !1, this._clusterMarker = new
|
|
2293
|
+
this._markerClusterer = i, this._map = i.getMap(), this._minClusterSize = i.getMinClusterSize(), this._isAverageCenter = i.isAverageCenter(), this._center = null, this._markers = [], this._gridBounds = null, this._isReal = !1, this._clusterMarker = new zt(this._center, this._markers.length, {
|
|
2237
2294
|
styles: this._markerClusterer.getStyles(),
|
|
2238
2295
|
zIndex: i._zIndex
|
|
2239
2296
|
}), this._clusterMarker.getStyleByText = function(e, r) {
|
|
@@ -2241,12 +2298,12 @@ function $(i) {
|
|
|
2241
2298
|
var s = t._markerClusterer._stylesIndexCalculator(t._markers, r.length);
|
|
2242
2299
|
return r[s];
|
|
2243
2300
|
}
|
|
2244
|
-
return
|
|
2301
|
+
return zt.prototype.getStyleByText.call(this, e, r);
|
|
2245
2302
|
}, this._clusterMarker.addEventListener && this._clusterMarker.addEventListener("click", function(e) {
|
|
2246
2303
|
t._map.setViewport(t.getBounds());
|
|
2247
2304
|
});
|
|
2248
2305
|
}
|
|
2249
|
-
|
|
2306
|
+
D.prototype.addMarker = function(i) {
|
|
2250
2307
|
if (this.isMarkerInCluster(i))
|
|
2251
2308
|
return !1;
|
|
2252
2309
|
if (!this._center)
|
|
@@ -2257,7 +2314,7 @@ $.prototype.addMarker = function(i) {
|
|
|
2257
2314
|
}
|
|
2258
2315
|
return i.isInCluster = !0, this._markers.push(i), !0;
|
|
2259
2316
|
};
|
|
2260
|
-
|
|
2317
|
+
D.prototype.render = function() {
|
|
2261
2318
|
var i = this._markers.length;
|
|
2262
2319
|
if (i < this._minClusterSize)
|
|
2263
2320
|
for (var t = 0; t < i; t++)
|
|
@@ -2265,7 +2322,7 @@ $.prototype.render = function() {
|
|
|
2265
2322
|
else
|
|
2266
2323
|
this._map.addOverlay(this._clusterMarker), this._isReal = !0, this.updateClusterMarker();
|
|
2267
2324
|
};
|
|
2268
|
-
|
|
2325
|
+
D.prototype.isMarkerInCluster = function(i) {
|
|
2269
2326
|
if (this._markers.indexOf)
|
|
2270
2327
|
return this._markers.indexOf(i) != -1;
|
|
2271
2328
|
for (var t = 0, e; e = this._markers[t]; t++)
|
|
@@ -2273,17 +2330,17 @@ $.prototype.isMarkerInCluster = function(i) {
|
|
|
2273
2330
|
return !0;
|
|
2274
2331
|
return !1;
|
|
2275
2332
|
};
|
|
2276
|
-
|
|
2333
|
+
D.prototype.isMarkerInClusterBounds = function(i) {
|
|
2277
2334
|
return this._gridBounds.containsPoint(i.getPosition());
|
|
2278
2335
|
};
|
|
2279
|
-
|
|
2336
|
+
D.prototype.isReal = function(i) {
|
|
2280
2337
|
return this._isReal;
|
|
2281
2338
|
};
|
|
2282
|
-
|
|
2339
|
+
D.prototype.updateGridBounds = function() {
|
|
2283
2340
|
var i = new BMap.Bounds(this._center, this._center);
|
|
2284
|
-
this._gridBounds =
|
|
2341
|
+
this._gridBounds = ur(this._map, i, this._markerClusterer.getGridSize());
|
|
2285
2342
|
};
|
|
2286
|
-
|
|
2343
|
+
D.prototype.updateClusterMarker = function() {
|
|
2287
2344
|
if (this._map.getZoom() > this._markerClusterer.getMaxZoom()) {
|
|
2288
2345
|
this._clusterMarker && this._map.removeOverlay(this._clusterMarker);
|
|
2289
2346
|
for (var i = 0, t; t = this._markers[i]; i++)
|
|
@@ -2296,22 +2353,22 @@ $.prototype.updateClusterMarker = function() {
|
|
|
2296
2353
|
}
|
|
2297
2354
|
this._clusterMarker.setPosition(this._center), this._clusterMarker.setText(this._markerClusterer._textCalculator(this._markers));
|
|
2298
2355
|
};
|
|
2299
|
-
|
|
2356
|
+
D.prototype.remove = function() {
|
|
2300
2357
|
for (var i = 0, t; t = this._markers[i]; i++) {
|
|
2301
2358
|
var e = this._markers[i].getLabel();
|
|
2302
2359
|
this._markers[i].getMap() && this._map.removeOverlay(this._markers[i]), this._markers[i].setLabel(e);
|
|
2303
2360
|
}
|
|
2304
2361
|
this._map.removeOverlay(this._clusterMarker), this._markers.length = 0, delete this._markers;
|
|
2305
2362
|
};
|
|
2306
|
-
|
|
2363
|
+
D.prototype.getBounds = function() {
|
|
2307
2364
|
for (var i = new BMap.Bounds(this._center, this._center), t = 0, e; e = this._markers[t]; t++)
|
|
2308
2365
|
i.extend(e.getPosition());
|
|
2309
2366
|
return i;
|
|
2310
2367
|
};
|
|
2311
|
-
|
|
2368
|
+
D.prototype.getCenter = function() {
|
|
2312
2369
|
return this._center;
|
|
2313
2370
|
};
|
|
2314
|
-
var
|
|
2371
|
+
var Ae;
|
|
2315
2372
|
((i) => {
|
|
2316
2373
|
function t(r) {
|
|
2317
2374
|
return {
|
|
@@ -2336,8 +2393,8 @@ var Be;
|
|
|
2336
2393
|
};
|
|
2337
2394
|
}
|
|
2338
2395
|
i.toGoogle = e;
|
|
2339
|
-
})(
|
|
2340
|
-
class
|
|
2396
|
+
})(Ae || (Ae = {}));
|
|
2397
|
+
class mr {
|
|
2341
2398
|
constructor(t) {
|
|
2342
2399
|
c(this, "inner");
|
|
2343
2400
|
this.map = t;
|
|
@@ -2363,7 +2420,7 @@ class lr {
|
|
|
2363
2420
|
return this.inner.removeMarkers(t.map((e) => e.innerOverlay));
|
|
2364
2421
|
}
|
|
2365
2422
|
}
|
|
2366
|
-
class
|
|
2423
|
+
class _i extends mr {
|
|
2367
2424
|
constructor(t, e) {
|
|
2368
2425
|
var s;
|
|
2369
2426
|
super(t), this.inner = new T(t.innerMap, {
|
|
@@ -2373,7 +2430,7 @@ class ci extends lr {
|
|
|
2373
2430
|
maxZoom: e.maxZoom,
|
|
2374
2431
|
minClusterSize: e.minClusterSize,
|
|
2375
2432
|
isAverageCenter: e.averageCenter,
|
|
2376
|
-
styles: (s = e.styles) == null ? void 0 : s.map((n) =>
|
|
2433
|
+
styles: (s = e.styles) == null ? void 0 : s.map((n) => Ae.toBaidu(n)),
|
|
2377
2434
|
zIndex: e.zIndex
|
|
2378
2435
|
});
|
|
2379
2436
|
const r = e.stylesIndexCalculator;
|
|
@@ -2383,10 +2440,10 @@ class ci extends lr {
|
|
|
2383
2440
|
this.inner._redraw();
|
|
2384
2441
|
}
|
|
2385
2442
|
}
|
|
2386
|
-
class
|
|
2443
|
+
class bi extends mr {
|
|
2387
2444
|
constructor(t, e) {
|
|
2388
2445
|
var s, n;
|
|
2389
|
-
super(t), this.inner = new
|
|
2446
|
+
super(t), this.inner = new mi(
|
|
2390
2447
|
t.innerMap,
|
|
2391
2448
|
// google的构造器中的markers,不会触发重绘, 第一次绘制通过监听地图的'idle'事件触发, 可以直接设置
|
|
2392
2449
|
(s = e.markers) == null ? void 0 : s.map((a) => a.innerOverlay),
|
|
@@ -2395,7 +2452,7 @@ class di extends lr {
|
|
|
2395
2452
|
maxZoom: e.maxZoom,
|
|
2396
2453
|
minimumClusterSize: e.minClusterSize,
|
|
2397
2454
|
averageCenter: e.averageCenter,
|
|
2398
|
-
styles: (n = e.styles) == null ? void 0 : n.map((a) =>
|
|
2455
|
+
styles: (n = e.styles) == null ? void 0 : n.map((a) => Ae.toGoogle(a)),
|
|
2399
2456
|
zIndex: e.zIndex
|
|
2400
2457
|
}
|
|
2401
2458
|
);
|
|
@@ -2410,11 +2467,11 @@ class di extends lr {
|
|
|
2410
2467
|
this.inner.repaint();
|
|
2411
2468
|
}
|
|
2412
2469
|
}
|
|
2413
|
-
class
|
|
2470
|
+
class fr {
|
|
2414
2471
|
constructor() {
|
|
2415
2472
|
}
|
|
2416
2473
|
}
|
|
2417
|
-
class
|
|
2474
|
+
class Mi extends fr {
|
|
2418
2475
|
constructor(e, r) {
|
|
2419
2476
|
super();
|
|
2420
2477
|
c(this, "inner");
|
|
@@ -2448,7 +2505,7 @@ class ui extends hr {
|
|
|
2448
2505
|
switch (h) {
|
|
2449
2506
|
case google.maps.places.PlacesServiceStatus.ZERO_RESULTS:
|
|
2450
2507
|
case google.maps.places.PlacesServiceStatus.OK: {
|
|
2451
|
-
const o = (a ?? []).map((l) =>
|
|
2508
|
+
const o = (a ?? []).map((l) => ar(l, this.map));
|
|
2452
2509
|
s(o);
|
|
2453
2510
|
break;
|
|
2454
2511
|
}
|
|
@@ -2460,7 +2517,7 @@ class ui extends hr {
|
|
|
2460
2517
|
});
|
|
2461
2518
|
}
|
|
2462
2519
|
}
|
|
2463
|
-
class
|
|
2520
|
+
class Ti extends fr {
|
|
2464
2521
|
constructor(e, r) {
|
|
2465
2522
|
super();
|
|
2466
2523
|
c(this, "searchRequestMap", /* @__PURE__ */ new Map());
|
|
@@ -2492,7 +2549,7 @@ class pi extends hr {
|
|
|
2492
2549
|
return new Promise((s, n) => {
|
|
2493
2550
|
const a = new BMap.LocalSearch(e ?? this.map.innerMap, {
|
|
2494
2551
|
onSearchComplete: (h) => {
|
|
2495
|
-
Array.isArray(h) &&
|
|
2552
|
+
Array.isArray(h) && it("当前只支持一次搜索一条数据");
|
|
2496
2553
|
const o = a.getStatus();
|
|
2497
2554
|
switch (o) {
|
|
2498
2555
|
case BMAP_STATUS_SUCCESS: {
|
|
@@ -2526,7 +2583,7 @@ class pi extends hr {
|
|
|
2526
2583
|
});
|
|
2527
2584
|
}
|
|
2528
2585
|
}
|
|
2529
|
-
class
|
|
2586
|
+
class yr {
|
|
2530
2587
|
constructor(t, e) {
|
|
2531
2588
|
c(this, "onData");
|
|
2532
2589
|
c(this, "onError");
|
|
@@ -2538,31 +2595,31 @@ class cr {
|
|
|
2538
2595
|
* @mustCallSuper 子类必须调用一次`super.setSearchListener`, 用来保存{@link onData}和{@link onError}
|
|
2539
2596
|
* */
|
|
2540
2597
|
setSearchListener(t, e) {
|
|
2541
|
-
return this.onData &&
|
|
2598
|
+
return this.onData && C("setSearchListener只能调用一次"), this.onData = t, this.onError = e, ye;
|
|
2542
2599
|
}
|
|
2543
2600
|
}
|
|
2544
|
-
class
|
|
2601
|
+
class Oi extends yr {
|
|
2545
2602
|
constructor(e, r) {
|
|
2546
2603
|
super(e, r.input);
|
|
2547
2604
|
c(this, "searchBox");
|
|
2548
2605
|
this.searchBox = new google.maps.places.SearchBox(r.input), this.searchBox.bindTo("bounds", e.innerMap);
|
|
2549
2606
|
}
|
|
2550
2607
|
setSearchListener(e, r) {
|
|
2551
|
-
return super.setSearchListener(e, r),
|
|
2608
|
+
return super.setSearchListener(e, r), Qt(this.searchBox, "places_changed", () => {
|
|
2552
2609
|
const s = this.searchBox.getPlaces();
|
|
2553
|
-
e((s ?? []).map((n) =>
|
|
2610
|
+
e((s ?? []).map((n) => ar(n, this.map)));
|
|
2554
2611
|
});
|
|
2555
2612
|
}
|
|
2556
2613
|
search() {
|
|
2557
2614
|
this.input.value && (google.maps.event.trigger(this.input, "focus", {}), google.maps.event.trigger(this.input, "keydown", { keyCode: 13 }));
|
|
2558
2615
|
}
|
|
2559
2616
|
}
|
|
2560
|
-
class
|
|
2617
|
+
class Ci extends yr {
|
|
2561
2618
|
constructor(e, r) {
|
|
2562
2619
|
super(e, r.input);
|
|
2563
2620
|
c(this, "autocomplete");
|
|
2564
|
-
c(this, "
|
|
2565
|
-
this.autocomplete = e.createAutocomplete({ input: r.input, bindToMap: !0 }), this.
|
|
2621
|
+
c(this, "placesService");
|
|
2622
|
+
this.autocomplete = e.createAutocomplete({ input: r.input, bindToMap: !0 }), this.placesService = e.createPlacesService({});
|
|
2566
2623
|
}
|
|
2567
2624
|
setSearchListener(e, r) {
|
|
2568
2625
|
return super.setSearchListener(e, r), this.autocomplete.addResultListener((s) => {
|
|
@@ -2573,11 +2630,11 @@ class mi extends cr {
|
|
|
2573
2630
|
this.input.value && this.searchImpl(this.input.value);
|
|
2574
2631
|
}
|
|
2575
2632
|
searchImpl(e) {
|
|
2576
|
-
this.
|
|
2633
|
+
this.placesService.search(e).then(this.onData, this.onError);
|
|
2577
2634
|
}
|
|
2578
2635
|
}
|
|
2579
|
-
var
|
|
2580
|
-
class
|
|
2636
|
+
var wi = /* @__PURE__ */ ((i) => (i[i.WORLD = 1] = "WORLD", i[i.STATE = 5] = "STATE", i[i.CITY = 10] = "CITY", i[i.STREET = 15] = "STREET", i[i.BUILDING = 20] = "BUILDING", i))(wi || {});
|
|
2637
|
+
class ut {
|
|
2581
2638
|
constructor(t) {
|
|
2582
2639
|
c(this, "latestInfoWindow");
|
|
2583
2640
|
/** 使用{@link setEventTargetDelegate}初始化 */
|
|
@@ -2630,7 +2687,7 @@ class lt {
|
|
|
2630
2687
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
2631
2688
|
* Released under the MIT License.
|
|
2632
2689
|
*/
|
|
2633
|
-
function
|
|
2690
|
+
function Ei(i) {
|
|
2634
2691
|
return i != null && typeof i == "object" && Array.isArray(i) === !1;
|
|
2635
2692
|
}
|
|
2636
2693
|
/*!
|
|
@@ -2639,14 +2696,14 @@ function yi(i) {
|
|
|
2639
2696
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
2640
2697
|
* Released under the MIT License.
|
|
2641
2698
|
*/
|
|
2642
|
-
function
|
|
2643
|
-
return
|
|
2699
|
+
function Nt(i) {
|
|
2700
|
+
return Ei(i) === !0 && Object.prototype.toString.call(i) === "[object Object]";
|
|
2644
2701
|
}
|
|
2645
|
-
function
|
|
2702
|
+
function vr(i) {
|
|
2646
2703
|
var t, e;
|
|
2647
|
-
return !(
|
|
2704
|
+
return !(Nt(i) === !1 || (t = i.constructor, typeof t != "function") || (e = t.prototype, Nt(e) === !1) || e.hasOwnProperty("isPrototypeOf") === !1);
|
|
2648
2705
|
}
|
|
2649
|
-
var
|
|
2706
|
+
var _e;
|
|
2650
2707
|
((i) => {
|
|
2651
2708
|
function t(h, o) {
|
|
2652
2709
|
return h.reduce((l, d) => (l[o(d)] = d, l), {});
|
|
@@ -2661,27 +2718,27 @@ var ve;
|
|
|
2661
2718
|
}
|
|
2662
2719
|
i.toJsonSafely = r;
|
|
2663
2720
|
function s(h) {
|
|
2664
|
-
|
|
2721
|
+
vr(h) && Object.keys(h).forEach((o) => {
|
|
2665
2722
|
h[o] === void 0 ? delete h[o] : s(h[o]);
|
|
2666
2723
|
});
|
|
2667
2724
|
}
|
|
2668
2725
|
i.deleteUndefinedPropertyOnPlainObjectDeeply = s;
|
|
2669
2726
|
function n(h, ...o) {
|
|
2670
|
-
const l =
|
|
2727
|
+
const l = Gt(o), d = {};
|
|
2671
2728
|
for (const u in h)
|
|
2672
2729
|
l(u) || (d[u] = h[u]);
|
|
2673
2730
|
return d;
|
|
2674
2731
|
}
|
|
2675
2732
|
i.omit = n;
|
|
2676
2733
|
function a(h, ...o) {
|
|
2677
|
-
const l =
|
|
2734
|
+
const l = Gt(o), d = {};
|
|
2678
2735
|
for (const u in h)
|
|
2679
2736
|
l(u) && (d[u] = h[u]);
|
|
2680
2737
|
return d;
|
|
2681
2738
|
}
|
|
2682
2739
|
i.pick = a;
|
|
2683
|
-
})(
|
|
2684
|
-
function
|
|
2740
|
+
})(_e || (_e = {}));
|
|
2741
|
+
function Gt(i) {
|
|
2685
2742
|
if (i.length <= 4)
|
|
2686
2743
|
return i.includes.bind(i);
|
|
2687
2744
|
{
|
|
@@ -2689,20 +2746,20 @@ function Rt(i) {
|
|
|
2689
2746
|
return t.has.bind(t);
|
|
2690
2747
|
}
|
|
2691
2748
|
}
|
|
2692
|
-
|
|
2693
|
-
const
|
|
2694
|
-
var
|
|
2749
|
+
_e.toJsonSafely;
|
|
2750
|
+
const Li = ["single", "multi"];
|
|
2751
|
+
var W = /* @__PURE__ */ ((i) => (i.auto = "auto", i.none = "none", i.greedy = "greedy", i.cooperative = "cooperative", i))(W || {}), et;
|
|
2695
2752
|
((i) => {
|
|
2696
2753
|
function t(e) {
|
|
2697
|
-
|
|
2754
|
+
_e.deleteUndefinedPropertyOnPlainObjectDeeply(e);
|
|
2698
2755
|
const r = { center: y.ZERO, zoom: 5 };
|
|
2699
|
-
return
|
|
2700
|
-
isMergeableObject:
|
|
2756
|
+
return Kt(r, e || {}, {
|
|
2757
|
+
isMergeableObject: vr
|
|
2701
2758
|
});
|
|
2702
2759
|
}
|
|
2703
2760
|
i.create = t;
|
|
2704
|
-
})(
|
|
2705
|
-
class
|
|
2761
|
+
})(et || (et = {}));
|
|
2762
|
+
class _r {
|
|
2706
2763
|
constructor(t, e, r) {
|
|
2707
2764
|
c(this, "_delegate");
|
|
2708
2765
|
this.innerOverlay = t, this.coordType = e, this.map = r;
|
|
@@ -2720,12 +2777,12 @@ class ur {
|
|
|
2720
2777
|
this.map.removeOverlay(this);
|
|
2721
2778
|
}
|
|
2722
2779
|
}
|
|
2723
|
-
class
|
|
2780
|
+
class pt extends _r {
|
|
2724
2781
|
constructor(t, e, r) {
|
|
2725
2782
|
super(t, e, r);
|
|
2726
2783
|
}
|
|
2727
2784
|
createDelegate() {
|
|
2728
|
-
return new
|
|
2785
|
+
return new te(this.innerOverlay, this.map);
|
|
2729
2786
|
}
|
|
2730
2787
|
isVisible() {
|
|
2731
2788
|
return this.innerOverlay.getVisible();
|
|
@@ -2734,12 +2791,12 @@ class ht extends ur {
|
|
|
2734
2791
|
this.innerOverlay.setVisible(t);
|
|
2735
2792
|
}
|
|
2736
2793
|
}
|
|
2737
|
-
class
|
|
2794
|
+
class We extends _r {
|
|
2738
2795
|
constructor(t, e, r) {
|
|
2739
2796
|
super(t, e, r);
|
|
2740
2797
|
}
|
|
2741
2798
|
createDelegate() {
|
|
2742
|
-
return new
|
|
2799
|
+
return new oe(this.innerOverlay, this.map);
|
|
2743
2800
|
}
|
|
2744
2801
|
/** 仅限内部使用; 设为private时, 生成的d.ts文件中, 方法返回值会变成any, 故改成了public */
|
|
2745
2802
|
get overlay() {
|
|
@@ -2756,7 +2813,7 @@ class Ne extends ur {
|
|
|
2756
2813
|
return t !== void 0 && (t || this.setVisible(!1)), this;
|
|
2757
2814
|
}
|
|
2758
2815
|
}
|
|
2759
|
-
class
|
|
2816
|
+
class br extends We {
|
|
2760
2817
|
constructor(t, e, r, s) {
|
|
2761
2818
|
super(t, e, r), this.state = s;
|
|
2762
2819
|
}
|
|
@@ -2782,7 +2839,7 @@ class pr extends Ne {
|
|
|
2782
2839
|
this.innerOverlay.setFillOpacity(t);
|
|
2783
2840
|
}
|
|
2784
2841
|
}
|
|
2785
|
-
class
|
|
2842
|
+
class He extends pt {
|
|
2786
2843
|
isEditable() {
|
|
2787
2844
|
return this.innerOverlay.getEditable();
|
|
2788
2845
|
}
|
|
@@ -2805,7 +2862,7 @@ class Ge extends ht {
|
|
|
2805
2862
|
this.innerOverlay.setOptions({ fillOpacity: t });
|
|
2806
2863
|
}
|
|
2807
2864
|
}
|
|
2808
|
-
class
|
|
2865
|
+
class gt extends br {
|
|
2809
2866
|
constructor() {
|
|
2810
2867
|
super(...arguments);
|
|
2811
2868
|
c(this, "prevCenter");
|
|
@@ -2836,13 +2893,13 @@ class ct extends pr {
|
|
|
2836
2893
|
strokeWeight: e.strokeWeight,
|
|
2837
2894
|
fillColor: e.fillColor,
|
|
2838
2895
|
fillOpacity: e.fillOpacity
|
|
2839
|
-
}), n = new
|
|
2896
|
+
}), n = new gt(s, r, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
2840
2897
|
return n.state.editable && setTimeout(() => {
|
|
2841
2898
|
n.state.editable && s.enableEditing();
|
|
2842
2899
|
}, 0), n;
|
|
2843
2900
|
}
|
|
2844
2901
|
createDelegate() {
|
|
2845
|
-
return this.eventHubDelegate = new
|
|
2902
|
+
return this.eventHubDelegate = new Ze(super.createDelegate(), {
|
|
2846
2903
|
types: ["radius-changed", "center-changed"],
|
|
2847
2904
|
onListen: (e) => {
|
|
2848
2905
|
e === "radius-changed" ? (this.prevRadius = this.innerOverlay.getRadius(), this.innerOverlay.addEventListener("lineupdate", this.onRadiusChanged)) : (this.prevCenter = this.innerOverlay.getCenter(), this.innerOverlay.addEventListener("lineupdate", this.onCenterChanged));
|
|
@@ -2867,7 +2924,7 @@ class ct extends pr {
|
|
|
2867
2924
|
return this.innerOverlay.getRadius();
|
|
2868
2925
|
}
|
|
2869
2926
|
}
|
|
2870
|
-
class
|
|
2927
|
+
class mt extends He {
|
|
2871
2928
|
static create(t) {
|
|
2872
2929
|
const e = this.coordType, r = new google.maps.Circle({
|
|
2873
2930
|
center: t.center.toGoogle(e),
|
|
@@ -2881,13 +2938,13 @@ class dt extends Ge {
|
|
|
2881
2938
|
fillOpacity: t.fillOpacity,
|
|
2882
2939
|
visible: t.visible
|
|
2883
2940
|
});
|
|
2884
|
-
return new
|
|
2941
|
+
return new mt(r, e, this);
|
|
2885
2942
|
}
|
|
2886
2943
|
setCenter(t) {
|
|
2887
2944
|
this.coordType = this.map.coordType, this.innerOverlay.setCenter(t.toGoogle(this.coordType));
|
|
2888
2945
|
}
|
|
2889
2946
|
getCenter() {
|
|
2890
|
-
return y.fromGoogle(this.innerOverlay.getCenter() ??
|
|
2947
|
+
return y.fromGoogle(this.innerOverlay.getCenter() ?? X.LATLNG_ZERO, this.coordType);
|
|
2891
2948
|
}
|
|
2892
2949
|
setRadius(t) {
|
|
2893
2950
|
this.innerOverlay.setRadius(t);
|
|
@@ -2896,28 +2953,28 @@ class dt extends Ge {
|
|
|
2896
2953
|
return this.innerOverlay.getRadius();
|
|
2897
2954
|
}
|
|
2898
2955
|
}
|
|
2899
|
-
function
|
|
2956
|
+
function Mr() {
|
|
2900
2957
|
BMap.OverlayV3 || (BMap.OverlayV3 = BMap.Overlay);
|
|
2901
2958
|
}
|
|
2902
|
-
const
|
|
2959
|
+
const Zt = {
|
|
2903
2960
|
/** {@link BMap.Point.equals} 无效, 故需要自己写一个 */
|
|
2904
2961
|
equals(i, t) {
|
|
2905
2962
|
return i.lat === t.lat && i.lng === t.lng;
|
|
2906
2963
|
}
|
|
2907
2964
|
};
|
|
2908
|
-
var
|
|
2965
|
+
var K;
|
|
2909
2966
|
((i) => {
|
|
2910
2967
|
i.ZERO = { x: 0, y: 0 };
|
|
2911
|
-
})(
|
|
2912
|
-
let
|
|
2913
|
-
function
|
|
2914
|
-
return
|
|
2968
|
+
})(K || (K = {}));
|
|
2969
|
+
let qe;
|
|
2970
|
+
function xi(i, t, e, r, s, n) {
|
|
2971
|
+
return qe || (qe = Pi()), new qe(i, t, e, r, s, n);
|
|
2915
2972
|
}
|
|
2916
|
-
function
|
|
2917
|
-
|
|
2973
|
+
function Pi() {
|
|
2974
|
+
Mr();
|
|
2918
2975
|
const i = new BMap.Point(0, 0);
|
|
2919
2976
|
return class extends BMap.OverlayV3 {
|
|
2920
|
-
constructor(r, s = i, n =
|
|
2977
|
+
constructor(r, s = i, n = K.ZERO, a, h = 654, o = "") {
|
|
2921
2978
|
super();
|
|
2922
2979
|
// 类表达式不能有私有成员, 故改成public
|
|
2923
2980
|
c(this, "container");
|
|
@@ -2980,7 +3037,7 @@ function bi() {
|
|
|
2980
3037
|
}
|
|
2981
3038
|
};
|
|
2982
3039
|
}
|
|
2983
|
-
class
|
|
3040
|
+
class ft {
|
|
2984
3041
|
constructor(t) {
|
|
2985
3042
|
this.delegate = t, this.delegate.setTarget(this);
|
|
2986
3043
|
}
|
|
@@ -2991,9 +3048,9 @@ class ut {
|
|
|
2991
3048
|
this.delegate.removeEventListener(t, e);
|
|
2992
3049
|
}
|
|
2993
3050
|
}
|
|
2994
|
-
class
|
|
3051
|
+
class yt extends ft {
|
|
2995
3052
|
constructor(t, e, r) {
|
|
2996
|
-
super(new
|
|
3053
|
+
super(new oe(t, e)), this.inner = t, this.map = e, this.state = r;
|
|
2997
3054
|
}
|
|
2998
3055
|
static create(t) {
|
|
2999
3056
|
const e = t.position || y.ZERO, r = new BMap.InfoWindow(t.content, {
|
|
@@ -3001,7 +3058,7 @@ class pt extends ut {
|
|
|
3001
3058
|
offset: t.offset && new BMap.Size(t.offset.x, t.offset.y),
|
|
3002
3059
|
enableAutoPan: !t.disableAutoPan
|
|
3003
3060
|
});
|
|
3004
|
-
return new
|
|
3061
|
+
return new yt(r, this, { position: e });
|
|
3005
3062
|
}
|
|
3006
3063
|
isOpen() {
|
|
3007
3064
|
return this.inner.isOpen();
|
|
@@ -3020,10 +3077,10 @@ class pt extends ut {
|
|
|
3020
3077
|
this.state.position = t, this.inner.isOpen() && this.open();
|
|
3021
3078
|
}
|
|
3022
3079
|
}
|
|
3023
|
-
class
|
|
3080
|
+
class vt extends ft {
|
|
3024
3081
|
constructor(e, r) {
|
|
3025
|
-
super(new
|
|
3026
|
-
c(this, "eventHub", new
|
|
3082
|
+
super(new te(e, r));
|
|
3083
|
+
c(this, "eventHub", new tr());
|
|
3027
3084
|
c(this, "isOpened", !1);
|
|
3028
3085
|
this.inner = e, this.map = r, e.addListener("closeclick", () => {
|
|
3029
3086
|
this.isOpened = !1, this.eventHub.hasListener("close") && this.eventHub.notify({ type: "close", target: this });
|
|
@@ -3040,7 +3097,7 @@ class gt extends ut {
|
|
|
3040
3097
|
position: r.toGoogle(this.coordType),
|
|
3041
3098
|
disableAutoPan: e.disableAutoPan
|
|
3042
3099
|
});
|
|
3043
|
-
return new
|
|
3100
|
+
return new vt(s, this);
|
|
3044
3101
|
}
|
|
3045
3102
|
isOpen() {
|
|
3046
3103
|
return this.isOpened;
|
|
@@ -3072,19 +3129,19 @@ class gt extends ut {
|
|
|
3072
3129
|
this.isOpened && (this.isOpened = !1, this.inner.close(), this.eventHub.notify({ type: "close", target: this }));
|
|
3073
3130
|
}
|
|
3074
3131
|
getPosition() {
|
|
3075
|
-
return y.fromGoogle(this.inner.getPosition() ??
|
|
3132
|
+
return y.fromGoogle(this.inner.getPosition() ?? X.LATLNG_ZERO, this.map.coordType);
|
|
3076
3133
|
}
|
|
3077
3134
|
setPosition(e) {
|
|
3078
3135
|
this.inner.setPosition(e.toGoogle(this.map.coordType));
|
|
3079
3136
|
}
|
|
3080
3137
|
}
|
|
3081
|
-
class
|
|
3138
|
+
class _t extends We {
|
|
3082
3139
|
constructor(t, e, r) {
|
|
3083
3140
|
super(t, e, r), this.baiduMap = r;
|
|
3084
3141
|
}
|
|
3085
3142
|
static create(t) {
|
|
3086
3143
|
var s;
|
|
3087
|
-
const e = this.coordType, r =
|
|
3144
|
+
const e = this.coordType, r = xi(
|
|
3088
3145
|
t.content,
|
|
3089
3146
|
(s = t.position) == null ? void 0 : s.toBaidu(e),
|
|
3090
3147
|
t.offset,
|
|
@@ -3092,7 +3149,7 @@ class mt extends Ne {
|
|
|
3092
3149
|
t.maxWidth,
|
|
3093
3150
|
t.borderClass
|
|
3094
3151
|
);
|
|
3095
|
-
return new
|
|
3152
|
+
return new _t(r, e, this);
|
|
3096
3153
|
}
|
|
3097
3154
|
open(t) {
|
|
3098
3155
|
this.innerOverlay.open(this.baiduMap.innerMap, t == null ? void 0 : t.innerOverlay);
|
|
@@ -3113,9 +3170,9 @@ class mt extends Ne {
|
|
|
3113
3170
|
this.innerOverlay.setZIndex(t);
|
|
3114
3171
|
}
|
|
3115
3172
|
}
|
|
3116
|
-
class
|
|
3173
|
+
class bt extends ft {
|
|
3117
3174
|
constructor(t, e, r) {
|
|
3118
|
-
super(new
|
|
3175
|
+
super(new te(t, r)), this.inner = t, this.coordType = e, this.map = r;
|
|
3119
3176
|
}
|
|
3120
3177
|
static create(t) {
|
|
3121
3178
|
var n;
|
|
@@ -3130,7 +3187,7 @@ class ft extends ut {
|
|
|
3130
3187
|
var h;
|
|
3131
3188
|
const a = (h = t.content.parentElement) == null ? void 0 : h.parentElement;
|
|
3132
3189
|
a && a.className.includes("gm-style-iw-c") && !a.className.includes(s) && (a.className += ` ${s}`);
|
|
3133
|
-
}), new
|
|
3190
|
+
}), new bt(r, e, this);
|
|
3134
3191
|
}
|
|
3135
3192
|
open(t) {
|
|
3136
3193
|
this.inner.open(this.map.innerMap, t == null ? void 0 : t.innerOverlay);
|
|
@@ -3139,7 +3196,7 @@ class ft extends ut {
|
|
|
3139
3196
|
this.inner.close();
|
|
3140
3197
|
}
|
|
3141
3198
|
getPosition() {
|
|
3142
|
-
return y.fromGoogle(this.inner.getPosition() ??
|
|
3199
|
+
return y.fromGoogle(this.inner.getPosition() ?? X.LATLNG_ZERO, this.coordType);
|
|
3143
3200
|
}
|
|
3144
3201
|
setPosition(t) {
|
|
3145
3202
|
this.coordType = this.map.coordType, this.inner.setPosition(t.toGoogle(this.coordType));
|
|
@@ -3158,7 +3215,7 @@ class ft extends ut {
|
|
|
3158
3215
|
this.inner.setZIndex(t);
|
|
3159
3216
|
}
|
|
3160
3217
|
}
|
|
3161
|
-
var
|
|
3218
|
+
var be;
|
|
3162
3219
|
((i) => {
|
|
3163
3220
|
function t(s, n) {
|
|
3164
3221
|
if (s !== void 0)
|
|
@@ -3175,15 +3232,15 @@ var _e;
|
|
|
3175
3232
|
return s.replace(/([^A-Z]?)([A-Z])/g, (n, a, h) => a ? `${a}-${h.toLowerCase()}` : h.toLowerCase());
|
|
3176
3233
|
}
|
|
3177
3234
|
i.pascal2kebab = r;
|
|
3178
|
-
})(
|
|
3179
|
-
const
|
|
3235
|
+
})(be || (be = {}));
|
|
3236
|
+
const ki = {
|
|
3180
3237
|
/** @see https://nodejs.org/docs/v10.3.0/api/path.html#path_path_basename_path_ext */
|
|
3181
3238
|
basename(i, t) {
|
|
3182
3239
|
const e = i.endsWith("/") ? i.slice(0, -1) : i, r = e.lastIndexOf("/"), s = r >= 0 ? e.substring(r + 1) : e;
|
|
3183
3240
|
return t && s.endsWith(t) ? s.slice(0, -t.length) : s;
|
|
3184
3241
|
}
|
|
3185
3242
|
};
|
|
3186
|
-
var
|
|
3243
|
+
var Me = /* @__PURE__ */ ((i) => (i.map = "map", i.overlay = "overlay", i.overlayMouseTarget = "overlayMouseTarget", i.float = "float", i))(Me || {}), Te;
|
|
3187
3244
|
((i) => {
|
|
3188
3245
|
function t(r, s) {
|
|
3189
3246
|
switch (r) {
|
|
@@ -3196,7 +3253,7 @@ var be = /* @__PURE__ */ ((i) => (i.map = "map", i.overlay = "overlay", i.overla
|
|
|
3196
3253
|
case "map":
|
|
3197
3254
|
return s.mapPane;
|
|
3198
3255
|
default:
|
|
3199
|
-
|
|
3256
|
+
Xe(r);
|
|
3200
3257
|
}
|
|
3201
3258
|
}
|
|
3202
3259
|
i.toGoogle = t;
|
|
@@ -3211,12 +3268,12 @@ var be = /* @__PURE__ */ ((i) => (i.map = "map", i.overlay = "overlay", i.overla
|
|
|
3211
3268
|
case "map":
|
|
3212
3269
|
return s.mapPane;
|
|
3213
3270
|
default:
|
|
3214
|
-
|
|
3271
|
+
Xe(r);
|
|
3215
3272
|
}
|
|
3216
3273
|
}
|
|
3217
3274
|
i.toBaidu = e;
|
|
3218
|
-
})(
|
|
3219
|
-
class
|
|
3275
|
+
})(Te || (Te = {}));
|
|
3276
|
+
class Si {
|
|
3220
3277
|
constructor(t, e) {
|
|
3221
3278
|
c(this, "baidu");
|
|
3222
3279
|
c(this, "google");
|
|
@@ -3237,12 +3294,12 @@ class Ti {
|
|
|
3237
3294
|
asBaidu() {
|
|
3238
3295
|
if (!this.baidu) {
|
|
3239
3296
|
const t = this;
|
|
3240
|
-
|
|
3297
|
+
Mr();
|
|
3241
3298
|
class e extends BMap.OverlayV3 {
|
|
3242
3299
|
initialize(n) {
|
|
3243
3300
|
var o;
|
|
3244
3301
|
const a = t.create(), h = n.getPanes();
|
|
3245
|
-
return (o =
|
|
3302
|
+
return (o = Te.toBaidu(t.mapPane, h)) == null || o.appendChild(a), a;
|
|
3246
3303
|
}
|
|
3247
3304
|
draw() {
|
|
3248
3305
|
t.draw();
|
|
@@ -3266,8 +3323,8 @@ class Ti {
|
|
|
3266
3323
|
const t = this;
|
|
3267
3324
|
class e extends google.maps.OverlayView {
|
|
3268
3325
|
onAdd() {
|
|
3269
|
-
const s = t.create(), n = this.getPanes() ??
|
|
3270
|
-
|
|
3326
|
+
const s = t.create(), n = this.getPanes() ?? C("onAdd回调中一定会有panes");
|
|
3327
|
+
Te.toGoogle(t.mapPane, n).appendChild(s);
|
|
3271
3328
|
}
|
|
3272
3329
|
draw() {
|
|
3273
3330
|
t.draw();
|
|
@@ -3279,23 +3336,23 @@ class Ti {
|
|
|
3279
3336
|
}
|
|
3280
3337
|
this.google = new e(), this.projection = {
|
|
3281
3338
|
fromLatLngToOverlayPoint(r) {
|
|
3282
|
-
return t.google.getProjection().fromLatLngToDivPixel(r.toGoogle(t.map.coordType)) ??
|
|
3339
|
+
return t.google.getProjection().fromLatLngToDivPixel(r.toGoogle(t.map.coordType)) ?? K.ZERO;
|
|
3283
3340
|
},
|
|
3284
3341
|
fromOverlayPointToLatLng(r) {
|
|
3285
|
-
return y.fromGoogle(t.google.getProjection().fromDivPixelToLatLng(new google.maps.Point(r.x, r.y)) ??
|
|
3342
|
+
return y.fromGoogle(t.google.getProjection().fromDivPixelToLatLng(new google.maps.Point(r.x, r.y)) ?? X.LATLNG_ZERO, t.map.coordType);
|
|
3286
3343
|
}
|
|
3287
3344
|
};
|
|
3288
3345
|
}
|
|
3289
3346
|
return this.google;
|
|
3290
3347
|
}
|
|
3291
3348
|
}
|
|
3292
|
-
let
|
|
3293
|
-
function
|
|
3294
|
-
return
|
|
3349
|
+
let Ye;
|
|
3350
|
+
function Bi(i, t, e, r, s) {
|
|
3351
|
+
return Ye || (Ye = Ii()), new Ye(i, t, e, r, s);
|
|
3295
3352
|
}
|
|
3296
|
-
function
|
|
3353
|
+
function Ii() {
|
|
3297
3354
|
return class extends google.maps.OverlayView {
|
|
3298
|
-
constructor(e, r, s, n =
|
|
3355
|
+
constructor(e, r, s, n = Me.overlayMouseTarget, a) {
|
|
3299
3356
|
super();
|
|
3300
3357
|
c(this, "container");
|
|
3301
3358
|
this.position = r, this.offset = s, this._mapPane = n, this.container = document.createElement("div"), this.container.className = "label-container", this.container.style.position = "absolute", a && this.setZIndex(a), this.container.addEventListener("click", () => {
|
|
@@ -3310,8 +3367,8 @@ function Ci() {
|
|
|
3310
3367
|
r !== e && (r ? this.container.replaceChild(r, e) : this.container.appendChild(e));
|
|
3311
3368
|
}
|
|
3312
3369
|
onAdd() {
|
|
3313
|
-
const e = this.getPanes() ??
|
|
3314
|
-
|
|
3370
|
+
const e = this.getPanes() ?? C("onAdd回调中一定能够获取panes");
|
|
3371
|
+
Te.toGoogle(this._mapPane, e).appendChild(this.container);
|
|
3315
3372
|
}
|
|
3316
3373
|
draw() {
|
|
3317
3374
|
var e, r;
|
|
@@ -3347,7 +3404,7 @@ function Ci() {
|
|
|
3347
3404
|
}
|
|
3348
3405
|
};
|
|
3349
3406
|
}
|
|
3350
|
-
var
|
|
3407
|
+
var ce;
|
|
3351
3408
|
((i) => {
|
|
3352
3409
|
function t(r) {
|
|
3353
3410
|
return typeof r == "string" ? r : r.outerHTML;
|
|
@@ -3361,8 +3418,8 @@ var he;
|
|
|
3361
3418
|
return r;
|
|
3362
3419
|
}
|
|
3363
3420
|
i.toElement = e;
|
|
3364
|
-
})(
|
|
3365
|
-
class
|
|
3421
|
+
})(ce || (ce = {}));
|
|
3422
|
+
class Mt extends We {
|
|
3366
3423
|
constructor(e, r, s, n) {
|
|
3367
3424
|
super(e, r, s);
|
|
3368
3425
|
c(this, "icon");
|
|
@@ -3373,7 +3430,7 @@ class yt extends Ne {
|
|
|
3373
3430
|
}
|
|
3374
3431
|
static create(e) {
|
|
3375
3432
|
var a;
|
|
3376
|
-
const r = this.coordType, s = new BMap.Label(
|
|
3433
|
+
const r = this.coordType, s = new BMap.Label(ce.toString(e.content), {
|
|
3377
3434
|
position: (a = e.position) == null ? void 0 : a.toBaidu(r),
|
|
3378
3435
|
offset: e.offset && new BMap.Size(e.offset.x, e.offset.y)
|
|
3379
3436
|
});
|
|
@@ -3382,7 +3439,7 @@ class yt extends Ne {
|
|
|
3382
3439
|
padding: "0px",
|
|
3383
3440
|
backgroundColor: "unset"
|
|
3384
3441
|
});
|
|
3385
|
-
const n = new
|
|
3442
|
+
const n = new Mt(s, r, this, e.content);
|
|
3386
3443
|
return s.__label__ = n, n;
|
|
3387
3444
|
}
|
|
3388
3445
|
setContentInternal(e, r = !1) {
|
|
@@ -3393,7 +3450,7 @@ class yt extends Ne {
|
|
|
3393
3450
|
characterData: !0,
|
|
3394
3451
|
childList: !0,
|
|
3395
3452
|
subtree: !0
|
|
3396
|
-
})), r || this.innerOverlay.setContent(
|
|
3453
|
+
})), r || this.innerOverlay.setContent(ce.toString(e)), this.content = e);
|
|
3397
3454
|
}
|
|
3398
3455
|
setZIndex(e) {
|
|
3399
3456
|
this.innerOverlay.setZIndex(e);
|
|
@@ -3435,7 +3492,7 @@ class yt extends Ne {
|
|
|
3435
3492
|
height: e.style.anchor.height + o.y
|
|
3436
3493
|
}, process.env.NODE_ENV !== "production" && setTimeout(() => {
|
|
3437
3494
|
var u, p;
|
|
3438
|
-
if (
|
|
3495
|
+
if (ne(e.__icon__, `${e}必须是由'SymbolIcon.toBaidu()'创建的`), !e.anchor) {
|
|
3439
3496
|
console.log("BaiduLabelOverlay.attachIcon", "Bmap.Symbol.anchor尚未计算完成");
|
|
3440
3497
|
return;
|
|
3441
3498
|
}
|
|
@@ -3448,7 +3505,7 @@ class yt extends Ne {
|
|
|
3448
3505
|
e.__icon__.scale,
|
|
3449
3506
|
e.__icon__.strokeWeight
|
|
3450
3507
|
].map((_) => _ ?? "").join(",");
|
|
3451
|
-
console.warn("BaiduLabelOverlay.attachIcon", e.__icon__,
|
|
3508
|
+
console.warn("BaiduLabelOverlay.attachIcon", e.__icon__, be.trimIndent(
|
|
3452
3509
|
`
|
|
3453
3510
|
为了保证Label的位置正确, 请将SymbolIcon(${b})中baiduLabelOffset的值改写成:
|
|
3454
3511
|
${JSON.stringify({ x: l, y: d })}
|
|
@@ -3462,23 +3519,23 @@ class yt extends Ne {
|
|
|
3462
3519
|
this.iconAnchor && (n -= this.iconAnchor.width, a -= this.iconAnchor.height), r && (n += r.width, a += r.height), this.innerOverlay.setOffset(new BMap.Size(n, a)), this.icon = e, this.iconAnchor = r;
|
|
3463
3520
|
}
|
|
3464
3521
|
}
|
|
3465
|
-
class
|
|
3522
|
+
class Tt extends pt {
|
|
3466
3523
|
static create(t) {
|
|
3467
3524
|
var s;
|
|
3468
|
-
const e = this.coordType, r =
|
|
3469
|
-
|
|
3525
|
+
const e = this.coordType, r = Bi(
|
|
3526
|
+
ce.toElement(t.content),
|
|
3470
3527
|
(s = t.position) == null ? void 0 : s.toGoogle(e),
|
|
3471
3528
|
t.offset,
|
|
3472
3529
|
t.mapPane,
|
|
3473
3530
|
t.zIndex
|
|
3474
3531
|
);
|
|
3475
|
-
return new
|
|
3532
|
+
return new Tt(r, e, this);
|
|
3476
3533
|
}
|
|
3477
3534
|
setZIndex(t) {
|
|
3478
3535
|
this.innerOverlay.setZIndex(t);
|
|
3479
3536
|
}
|
|
3480
3537
|
setContent(t) {
|
|
3481
|
-
this.innerOverlay.setElement(
|
|
3538
|
+
this.innerOverlay.setElement(ce.toElement(t));
|
|
3482
3539
|
}
|
|
3483
3540
|
getPosition() {
|
|
3484
3541
|
const t = this.innerOverlay.getPosition();
|
|
@@ -3488,17 +3545,17 @@ class vt extends ht {
|
|
|
3488
3545
|
this.coordType = this.map.coordType, this.innerOverlay.setPosition(t.toGoogle(this.coordType));
|
|
3489
3546
|
}
|
|
3490
3547
|
getOffset() {
|
|
3491
|
-
return this.innerOverlay.getOffset() ??
|
|
3548
|
+
return this.innerOverlay.getOffset() ?? K.ZERO;
|
|
3492
3549
|
}
|
|
3493
3550
|
setOffset(t) {
|
|
3494
3551
|
this.innerOverlay.setOffset(t);
|
|
3495
3552
|
}
|
|
3496
3553
|
}
|
|
3497
|
-
const
|
|
3498
|
-
toGoogle: (i) => "url" in i ?
|
|
3499
|
-
toBaidu: (i) => "url" in i ?
|
|
3554
|
+
const Re = {
|
|
3555
|
+
toGoogle: (i) => "url" in i ? $e.toGoogle(i) : De.toGoogle(i),
|
|
3556
|
+
toBaidu: (i) => "url" in i ? $e.toBaidu(i) : De.toBaidu(i)
|
|
3500
3557
|
};
|
|
3501
|
-
var
|
|
3558
|
+
var $e;
|
|
3502
3559
|
((i) => {
|
|
3503
3560
|
function t(r) {
|
|
3504
3561
|
return {
|
|
@@ -3522,8 +3579,8 @@ var Se;
|
|
|
3522
3579
|
});
|
|
3523
3580
|
}
|
|
3524
3581
|
i.toBaidu = e;
|
|
3525
|
-
})(
|
|
3526
|
-
var
|
|
3582
|
+
})($e || ($e = {}));
|
|
3583
|
+
var De;
|
|
3527
3584
|
((i) => {
|
|
3528
3585
|
function t(r) {
|
|
3529
3586
|
return {
|
|
@@ -3554,22 +3611,22 @@ var Ae;
|
|
|
3554
3611
|
return s.__icon__ = r, s;
|
|
3555
3612
|
}
|
|
3556
3613
|
i.toBaidu = e;
|
|
3557
|
-
})(
|
|
3558
|
-
const
|
|
3614
|
+
})(De || (De = {}));
|
|
3615
|
+
const Ws = {
|
|
3559
3616
|
CIRCLE: { baidu: () => BMap_Symbol_SHAPE_CIRCLE, google: () => google.maps.SymbolPath.CIRCLE },
|
|
3560
3617
|
BACKWARD_CLOSED_ARROW: { baidu: () => BMap_Symbol_SHAPE_BACKWARD_CLOSED_ARROW, google: () => google.maps.SymbolPath.BACKWARD_CLOSED_ARROW },
|
|
3561
3618
|
BACKWARD_OPEN_ARROW: { baidu: () => BMap_Symbol_SHAPE_BACKWARD_OPEN_ARROW, google: () => google.maps.SymbolPath.BACKWARD_OPEN_ARROW },
|
|
3562
3619
|
FORWARD_CLOSED_ARROW: { baidu: () => BMap_Symbol_SHAPE_FORWARD_CLOSED_ARROW, google: () => google.maps.SymbolPath.FORWARD_CLOSED_ARROW },
|
|
3563
3620
|
FORWARD_OPEN_ARROW: { baidu: () => BMap_Symbol_SHAPE_FORWARD_OPEN_ARROW, google: () => google.maps.SymbolPath.FORWARD_OPEN_ARROW }
|
|
3564
3621
|
};
|
|
3565
|
-
class
|
|
3622
|
+
class Oe extends We {
|
|
3566
3623
|
constructor(t, e, r, s) {
|
|
3567
3624
|
super(t, e, r), this.state = s;
|
|
3568
3625
|
}
|
|
3569
3626
|
static create(t) {
|
|
3570
3627
|
const e = this.coordType, r = t.icon, s = {
|
|
3571
3628
|
title: t.title,
|
|
3572
|
-
icon: r &&
|
|
3629
|
+
icon: r && Re.toBaidu(r),
|
|
3573
3630
|
enableClicking: t.clickable,
|
|
3574
3631
|
enableDragging: t.draggable,
|
|
3575
3632
|
// baidu的raiseOnDrag属性, 默认为false, 而我们的options.crossOnDrag默认为true, 故这里需要转换下
|
|
@@ -3578,7 +3635,7 @@ class Te extends Ne {
|
|
|
3578
3635
|
}, n = new BMap.Marker(t.position.toBaidu(e), s);
|
|
3579
3636
|
t.zIndex !== void 0 && n.setZIndex(t.zIndex);
|
|
3580
3637
|
const a = t.clickable === void 0 ? !0 : t.clickable, h = !!t.draggable;
|
|
3581
|
-
return new
|
|
3638
|
+
return new Oe(n, e, this, { clickable: a, draggable: h, zIndex: t.zIndex }).visibleOptionInternal(t.visible);
|
|
3582
3639
|
}
|
|
3583
3640
|
getPosition() {
|
|
3584
3641
|
return y.fromBaidu(this.innerOverlay.getPosition(), this.coordType);
|
|
@@ -3594,7 +3651,7 @@ class Te extends Ne {
|
|
|
3594
3651
|
return this.innerOverlay.getTitle();
|
|
3595
3652
|
}
|
|
3596
3653
|
setIcon(t) {
|
|
3597
|
-
const e =
|
|
3654
|
+
const e = Re.toBaidu(t);
|
|
3598
3655
|
this.innerOverlay.setIcon(e);
|
|
3599
3656
|
const r = this.getLabel();
|
|
3600
3657
|
r && r.attachIcon(e);
|
|
@@ -3629,7 +3686,7 @@ class Te extends Ne {
|
|
|
3629
3686
|
return (t = this.innerOverlay.getLabel()) == null ? void 0 : t.__label__;
|
|
3630
3687
|
}
|
|
3631
3688
|
}
|
|
3632
|
-
class
|
|
3689
|
+
class Ot extends pt {
|
|
3633
3690
|
constructor() {
|
|
3634
3691
|
super(...arguments);
|
|
3635
3692
|
c(this, "label");
|
|
@@ -3643,7 +3700,7 @@ class _t extends ht {
|
|
|
3643
3700
|
title: e.title,
|
|
3644
3701
|
zIndex: e.zIndex,
|
|
3645
3702
|
visible: e.visible,
|
|
3646
|
-
icon: s &&
|
|
3703
|
+
icon: s && Re.toGoogle(s),
|
|
3647
3704
|
clickable: e.clickable,
|
|
3648
3705
|
draggable: e.draggable,
|
|
3649
3706
|
// google的crossOnDrag和我们的crossOnDrag是匹配的, 不需要转换
|
|
@@ -3652,7 +3709,7 @@ class _t extends ht {
|
|
|
3652
3709
|
// InfoWindow相对marker的position的偏移量, 若不指定, 则偏移到marker的icon的上部中央
|
|
3653
3710
|
anchorPoint: new google.maps.Point(0, 0)
|
|
3654
3711
|
};
|
|
3655
|
-
return new
|
|
3712
|
+
return new Ot(new google.maps.Marker(n), r, this);
|
|
3656
3713
|
}
|
|
3657
3714
|
getPosition() {
|
|
3658
3715
|
return y.fromGoogle(this.innerOverlay.getPosition(), this.coordType);
|
|
@@ -3667,7 +3724,7 @@ class _t extends ht {
|
|
|
3667
3724
|
return this.innerOverlay.getTitle() || "";
|
|
3668
3725
|
}
|
|
3669
3726
|
setIcon(e) {
|
|
3670
|
-
this.innerOverlay.setIcon(
|
|
3727
|
+
this.innerOverlay.setIcon(Re.toGoogle(e));
|
|
3671
3728
|
}
|
|
3672
3729
|
getIcon() {
|
|
3673
3730
|
return this.innerOverlay.getIcon();
|
|
@@ -3705,7 +3762,7 @@ class _t extends ht {
|
|
|
3705
3762
|
this.label = void 0, this.labelPositionListener = void 0, this.labelVisibleListener = void 0, this.labelMapChangedListener = void 0;
|
|
3706
3763
|
}
|
|
3707
3764
|
}
|
|
3708
|
-
class
|
|
3765
|
+
class Ct extends br {
|
|
3709
3766
|
constructor() {
|
|
3710
3767
|
super(...arguments);
|
|
3711
3768
|
c(this, "eventHubDelegate");
|
|
@@ -3730,7 +3787,7 @@ class bt extends pr {
|
|
|
3730
3787
|
this.isDoingSetPath = !0, this.innerOverlay.setPath(e), this.isDoingSetPath = !1;
|
|
3731
3788
|
}
|
|
3732
3789
|
createDelegate() {
|
|
3733
|
-
return this.eventHubDelegate = new
|
|
3790
|
+
return this.eventHubDelegate = new Ze(super.createDelegate(), {
|
|
3734
3791
|
types: [this.pathEditedEventType],
|
|
3735
3792
|
onListen: () => {
|
|
3736
3793
|
this.prevPath = this.innerOverlay.getPath(), this.innerOverlay.addEventListener("lineupdate", this.onLineUpdate);
|
|
@@ -3741,7 +3798,7 @@ class bt extends pr {
|
|
|
3741
3798
|
});
|
|
3742
3799
|
}
|
|
3743
3800
|
}
|
|
3744
|
-
class
|
|
3801
|
+
class wt extends Ct {
|
|
3745
3802
|
constructor() {
|
|
3746
3803
|
super(...arguments);
|
|
3747
3804
|
c(this, "pathEditedEventType", "path-edited");
|
|
@@ -3754,7 +3811,7 @@ class Mt extends bt {
|
|
|
3754
3811
|
strokeOpacity: e.strokeOpacity,
|
|
3755
3812
|
strokeWeight: e.strokeWeight
|
|
3756
3813
|
});
|
|
3757
|
-
return new
|
|
3814
|
+
return new wt(s, r, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
3758
3815
|
}
|
|
3759
3816
|
getPath() {
|
|
3760
3817
|
return this.innerOverlay.getPath().map((e) => y.fromBaidu(e, this.coordType));
|
|
@@ -3763,7 +3820,7 @@ class Mt extends bt {
|
|
|
3763
3820
|
this.coordType = this.map.coordType, this.setPathInternal(e.map((r) => r.toBaidu(this.coordType)));
|
|
3764
3821
|
}
|
|
3765
3822
|
}
|
|
3766
|
-
class
|
|
3823
|
+
class Et extends He {
|
|
3767
3824
|
constructor() {
|
|
3768
3825
|
super(...arguments);
|
|
3769
3826
|
c(this, "pathChangedListeners");
|
|
@@ -3779,21 +3836,21 @@ class Tt extends Ge {
|
|
|
3779
3836
|
strokeWeight: e.strokeWeight,
|
|
3780
3837
|
visible: e.visible
|
|
3781
3838
|
});
|
|
3782
|
-
return new
|
|
3839
|
+
return new Et(s, r, this);
|
|
3783
3840
|
}
|
|
3784
3841
|
setupPathChangedListeners() {
|
|
3785
3842
|
const e = () => {
|
|
3786
3843
|
var s;
|
|
3787
3844
|
return (s = this.eventHubDelegate) == null ? void 0 : s.notify({ type: "path-edited", target: this });
|
|
3788
3845
|
}, r = this.innerOverlay.getPath();
|
|
3789
|
-
this.pathChangedListeners =
|
|
3846
|
+
this.pathChangedListeners = he.listenChanged(r, e);
|
|
3790
3847
|
}
|
|
3791
3848
|
clearPathChangedListeners() {
|
|
3792
3849
|
var e;
|
|
3793
3850
|
(e = this.pathChangedListeners) == null || e.forEach((r) => r.remove()), this.pathChangedListeners = void 0;
|
|
3794
3851
|
}
|
|
3795
3852
|
createDelegate() {
|
|
3796
|
-
return this.eventHubDelegate = new
|
|
3853
|
+
return this.eventHubDelegate = new Ze(super.createDelegate(), {
|
|
3797
3854
|
types: ["path-edited"],
|
|
3798
3855
|
onListen: () => this.setupPathChangedListeners(),
|
|
3799
3856
|
onCancel: () => this.clearPathChangedListeners()
|
|
@@ -3810,7 +3867,7 @@ class Tt extends Ge {
|
|
|
3810
3867
|
this.coordType = this.map.coordType, this.innerOverlay.setPath(e.map((s) => s.toGoogle(this.coordType))), (r = this.eventHubDelegate) != null && r.hasListener("path-edited") && this.setupPathChangedListeners();
|
|
3811
3868
|
}
|
|
3812
3869
|
}
|
|
3813
|
-
class
|
|
3870
|
+
class Lt extends Ct {
|
|
3814
3871
|
constructor() {
|
|
3815
3872
|
super(...arguments);
|
|
3816
3873
|
c(this, "pathEditedEventType", "paths-edited");
|
|
@@ -3827,7 +3884,7 @@ class Ot extends bt {
|
|
|
3827
3884
|
fillColor: e.fillColor,
|
|
3828
3885
|
fillOpacity: e.fillOpacity
|
|
3829
3886
|
});
|
|
3830
|
-
return new
|
|
3887
|
+
return new Lt(n, r, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
3831
3888
|
}
|
|
3832
3889
|
getPaths() {
|
|
3833
3890
|
return [this.innerOverlay.getPath().map((e) => y.fromBaidu(e, this.coordType))];
|
|
@@ -3836,7 +3893,7 @@ class Ot extends bt {
|
|
|
3836
3893
|
e.length > 1 && console.warn("baidu不支持多path, 只会显示paths[0]"), this.coordType = this.map.coordType, this.setPathInternal((e[0] || []).map((r) => r.toBaidu(this.coordType)));
|
|
3837
3894
|
}
|
|
3838
3895
|
}
|
|
3839
|
-
class
|
|
3896
|
+
class xt extends He {
|
|
3840
3897
|
constructor() {
|
|
3841
3898
|
super(...arguments);
|
|
3842
3899
|
c(this, "pathChangedListeners");
|
|
@@ -3854,7 +3911,7 @@ class Ct extends Ge {
|
|
|
3854
3911
|
fillOpacity: e.fillOpacity,
|
|
3855
3912
|
visible: e.visible
|
|
3856
3913
|
});
|
|
3857
|
-
return new
|
|
3914
|
+
return new xt(s, r, this);
|
|
3858
3915
|
}
|
|
3859
3916
|
setupPathChangedListeners() {
|
|
3860
3917
|
const e = () => {
|
|
@@ -3862,7 +3919,7 @@ class Ct extends Ge {
|
|
|
3862
3919
|
return (s = this.eventHubDelegate) == null ? void 0 : s.notify({ type: "paths-edited", target: this });
|
|
3863
3920
|
}, r = this.innerOverlay.getPaths();
|
|
3864
3921
|
this.pathChangedListeners = [], r.forEach((s) => {
|
|
3865
|
-
this.pathChangedListeners.push(...
|
|
3922
|
+
this.pathChangedListeners.push(...he.listenChanged(s, e));
|
|
3866
3923
|
});
|
|
3867
3924
|
}
|
|
3868
3925
|
clearPathChangedListeners() {
|
|
@@ -3870,7 +3927,7 @@ class Ct extends Ge {
|
|
|
3870
3927
|
(e = this.pathChangedListeners) == null || e.forEach((r) => r.remove()), this.pathChangedListeners = void 0;
|
|
3871
3928
|
}
|
|
3872
3929
|
createDelegate() {
|
|
3873
|
-
return this.eventHubDelegate = new
|
|
3930
|
+
return this.eventHubDelegate = new Ze(super.createDelegate(), {
|
|
3874
3931
|
types: ["paths-edited"],
|
|
3875
3932
|
onListen: () => this.setupPathChangedListeners(),
|
|
3876
3933
|
onCancel: () => this.clearPathChangedListeners()
|
|
@@ -3890,7 +3947,7 @@ class Ct extends Ge {
|
|
|
3890
3947
|
this.coordType = this.map.coordType, this.innerOverlay.setPaths(e.map((s) => s.map((n) => n.toGoogle(this.coordType)))), (r = this.eventHubDelegate) != null && r.hasListener("paths-edited") && this.setupPathChangedListeners();
|
|
3891
3948
|
}
|
|
3892
3949
|
}
|
|
3893
|
-
class
|
|
3950
|
+
class Pt extends Ct {
|
|
3894
3951
|
constructor(e, r, s, n) {
|
|
3895
3952
|
super(e, r, s, n);
|
|
3896
3953
|
c(this, "pathEditedEventType", "bounds-changed");
|
|
@@ -3905,7 +3962,7 @@ class wt extends bt {
|
|
|
3905
3962
|
if (r.length === 4)
|
|
3906
3963
|
if (a > r.length) {
|
|
3907
3964
|
for (let o = 0; o < a; o++)
|
|
3908
|
-
if (r[o] == null ||
|
|
3965
|
+
if (r[o] == null || !Zt.equals(s[o], r[o])) {
|
|
3909
3966
|
const l = s[(o - 2 + a) % a], d = s[(o - 1 + a) % a], u = s[o], p = s[(o + 1) % a], b = s[(o + 2) % a];
|
|
3910
3967
|
let _;
|
|
3911
3968
|
d.lat === p.lat ? _ = new BMap.Point(d.lng, u.lat) : d.lng === p.lng ? _ = new BMap.Point(u.lng, d.lat) : _ = u, n = [l, b, _];
|
|
@@ -3913,7 +3970,7 @@ class wt extends bt {
|
|
|
3913
3970
|
}
|
|
3914
3971
|
} else if (a === r.length) {
|
|
3915
3972
|
for (let o = 0; o < a; o++)
|
|
3916
|
-
if (
|
|
3973
|
+
if (!Zt.equals(s[o], r[o])) {
|
|
3917
3974
|
n = [
|
|
3918
3975
|
s[o],
|
|
3919
3976
|
s[(o + 2) % 4]
|
|
@@ -3938,7 +3995,7 @@ class wt extends bt {
|
|
|
3938
3995
|
fillColor: e.fillColor,
|
|
3939
3996
|
fillOpacity: e.fillOpacity
|
|
3940
3997
|
});
|
|
3941
|
-
return new
|
|
3998
|
+
return new Pt(s, r, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
3942
3999
|
}
|
|
3943
4000
|
getBounds() {
|
|
3944
4001
|
return I.fromBaidu(this.innerOverlay.getBounds(), this.coordType);
|
|
@@ -3950,7 +4007,7 @@ class wt extends bt {
|
|
|
3950
4007
|
}) : this.setPathInternal(r.map((s) => s.toBaidu(this.coordType)));
|
|
3951
4008
|
}
|
|
3952
4009
|
}
|
|
3953
|
-
class
|
|
4010
|
+
class kt extends He {
|
|
3954
4011
|
static create(t) {
|
|
3955
4012
|
const e = this.coordType, r = new google.maps.Rectangle({
|
|
3956
4013
|
bounds: t.bounds.toGoogle(e),
|
|
@@ -3963,42 +4020,42 @@ class Et extends Ge {
|
|
|
3963
4020
|
fillOpacity: t.fillOpacity,
|
|
3964
4021
|
visible: t.visible
|
|
3965
4022
|
});
|
|
3966
|
-
return new
|
|
4023
|
+
return new kt(r, e, this);
|
|
3967
4024
|
}
|
|
3968
4025
|
getBounds() {
|
|
3969
|
-
return I.fromGoogle(this.innerOverlay.getBounds() ??
|
|
4026
|
+
return I.fromGoogle(this.innerOverlay.getBounds() ?? X.BOUNDS_ZERO, this.coordType);
|
|
3970
4027
|
}
|
|
3971
4028
|
setBounds(t) {
|
|
3972
4029
|
const e = t.toGoogle(this.coordType);
|
|
3973
4030
|
e.equals(this.innerOverlay.getBounds()) || this.innerOverlay.setBounds(e);
|
|
3974
4031
|
}
|
|
3975
4032
|
}
|
|
3976
|
-
const
|
|
3977
|
-
class
|
|
4033
|
+
const Q = 1;
|
|
4034
|
+
class Ai extends ut {
|
|
3978
4035
|
constructor(e, r) {
|
|
3979
4036
|
var s;
|
|
3980
4037
|
super(e);
|
|
3981
4038
|
c(this, "buildInMapTypeId2BIMT");
|
|
3982
4039
|
c(this, "baiduMapType2BIMT");
|
|
3983
4040
|
c(this, "map");
|
|
3984
|
-
c(this, "createLabel",
|
|
3985
|
-
c(this, "createCircle",
|
|
3986
|
-
c(this, "createPolygon",
|
|
3987
|
-
c(this, "createPolyline",
|
|
3988
|
-
c(this, "createRectangle",
|
|
3989
|
-
c(this, "createInfoWindow",
|
|
3990
|
-
c(this, "createInfoBox",
|
|
3991
|
-
c(this, "createMarker",
|
|
3992
|
-
c(this, "createMapTypeControl",
|
|
3993
|
-
c(this, "createZoomControl",
|
|
3994
|
-
c(this, "createScaleControl",
|
|
3995
|
-
this.buildInMapTypeId2BIMT =
|
|
3996
|
-
minZoom: r.minZoom && r.minZoom +
|
|
3997
|
-
maxZoom: r.maxZoom && r.maxZoom +
|
|
4041
|
+
c(this, "createLabel", Mt.create);
|
|
4042
|
+
c(this, "createCircle", gt.create);
|
|
4043
|
+
c(this, "createPolygon", Lt.create);
|
|
4044
|
+
c(this, "createPolyline", wt.create);
|
|
4045
|
+
c(this, "createRectangle", Pt.create);
|
|
4046
|
+
c(this, "createInfoWindow", yt.create);
|
|
4047
|
+
c(this, "createInfoBox", _t.create);
|
|
4048
|
+
c(this, "createMarker", Oe.create);
|
|
4049
|
+
c(this, "createMapTypeControl", ot.create);
|
|
4050
|
+
c(this, "createZoomControl", ht.create);
|
|
4051
|
+
c(this, "createScaleControl", at.create);
|
|
4052
|
+
this.buildInMapTypeId2BIMT = A.BUILD_IN_MAP_TYPES.getValueMap(B.prototype.getId), this.baiduMapType2BIMT = A.BUILD_IN_MAP_TYPES.getValueMap(B.prototype.asBaiduMapType), this.map = new BMap.Map(e, {
|
|
4053
|
+
minZoom: r.minZoom && r.minZoom + Q,
|
|
4054
|
+
maxZoom: r.maxZoom && r.maxZoom + Q,
|
|
3998
4055
|
mapType: r.buildInMapTypeId && ((s = this.buildInMapTypeId2BIMT.get(r.buildInMapTypeId)) == null ? void 0 : s.asBaiduMapType()),
|
|
3999
4056
|
enableMapClick: !1
|
|
4000
4057
|
// 关闭底图点击功能
|
|
4001
|
-
}), this.map.centerAndZoom(r.center.toBaidu(this.coordType), r.zoom +
|
|
4058
|
+
}), this.map.centerAndZoom(r.center.toBaidu(this.coordType), r.zoom + Q), this.setGestureHandling(r.gestureHandling), r.infoWindowMode === "multi" && console.warn("baidu不支持多个InfoWindow, 可能会出现未知问题"), r.mapStyle && this.map.setMapStyleV2(r.mapStyle.toBaidu()), this.setEventTargetDelegate(new oe(this.map, this)), this.map.addEventListener("addoverlay", (n) => {
|
|
4002
4059
|
const a = n.target.__info_box__;
|
|
4003
4060
|
a && (console.debug("add:info-box", a), this.map.addOverlay(a));
|
|
4004
4061
|
}), this.map.addEventListener("removeoverlay", (n) => {
|
|
@@ -4006,15 +4063,15 @@ class wi extends lt {
|
|
|
4006
4063
|
a && (console.debug("remove:info-box", a), this.map.removeOverlay(a));
|
|
4007
4064
|
});
|
|
4008
4065
|
}
|
|
4009
|
-
setGestureHandling(e =
|
|
4010
|
-
switch (e ===
|
|
4011
|
-
case
|
|
4066
|
+
setGestureHandling(e = W.auto) {
|
|
4067
|
+
switch (e === W.auto && (e = this.element.parentElement && Qe.isScrollable(this.element.parentElement) ? W.cooperative : W.greedy), e) {
|
|
4068
|
+
case W.cooperative:
|
|
4012
4069
|
this.map.disableScrollWheelZoom(), this.map.enableDragging(), this.map.enableDoubleClickZoom();
|
|
4013
4070
|
break;
|
|
4014
|
-
case
|
|
4071
|
+
case W.greedy:
|
|
4015
4072
|
this.map.enableScrollWheelZoom(), this.map.enableDragging(), this.map.enableDoubleClickZoom();
|
|
4016
4073
|
break;
|
|
4017
|
-
case
|
|
4074
|
+
case W.none:
|
|
4018
4075
|
this.map.disableDragging(), this.map.disableScrollWheelZoom(), this.map.disableDoubleClickZoom();
|
|
4019
4076
|
break;
|
|
4020
4077
|
}
|
|
@@ -4061,16 +4118,16 @@ class wi extends lt {
|
|
|
4061
4118
|
this.map.setCenter(e.toBaidu(this.coordType));
|
|
4062
4119
|
}
|
|
4063
4120
|
getZoom() {
|
|
4064
|
-
return super.getZoom() -
|
|
4121
|
+
return super.getZoom() - Q;
|
|
4065
4122
|
}
|
|
4066
4123
|
setZoom(e) {
|
|
4067
|
-
return super.setZoom(e +
|
|
4124
|
+
return super.setZoom(e + Q);
|
|
4068
4125
|
}
|
|
4069
4126
|
setMinZoom(e) {
|
|
4070
|
-
this.map.setMinZoom(e +
|
|
4127
|
+
this.map.setMinZoom(e + Q);
|
|
4071
4128
|
}
|
|
4072
4129
|
setMaxZoom(e) {
|
|
4073
|
-
this.map.setMaxZoom(e +
|
|
4130
|
+
this.map.setMaxZoom(e + Q);
|
|
4074
4131
|
}
|
|
4075
4132
|
setMapStyle(e) {
|
|
4076
4133
|
this.map.setMapStyleV2(e.toBaidu());
|
|
@@ -4078,14 +4135,14 @@ class wi extends lt {
|
|
|
4078
4135
|
setBuildInMapTypeId(e) {
|
|
4079
4136
|
var s;
|
|
4080
4137
|
const r = (s = this.buildInMapTypeId2BIMT.get(e)) == null ? void 0 : s.asBaiduMapType();
|
|
4081
|
-
this.map.setMapType(r ??
|
|
4138
|
+
this.map.setMapType(r ?? C("理论上来说不可能为空"));
|
|
4082
4139
|
}
|
|
4083
4140
|
setMapType(e) {
|
|
4084
4141
|
this.map.setMapType(e.asBaiduMapType());
|
|
4085
4142
|
}
|
|
4086
4143
|
getMapType() {
|
|
4087
4144
|
const e = this.map.getMapType(), r = this.baiduMapType2BIMT.get(e);
|
|
4088
|
-
return r || (e.__baidu_map_type__ ??
|
|
4145
|
+
return r || (e.__baidu_map_type__ ?? C("实现asBaiduMapType()时, 忘了给实例设置__baidu_map_type__?"));
|
|
4089
4146
|
}
|
|
4090
4147
|
addLayer(e) {
|
|
4091
4148
|
this.map.addTileLayer(e.asBaiduLayer());
|
|
@@ -4125,7 +4182,7 @@ class wi extends lt {
|
|
|
4125
4182
|
const r = class extends BMap.Control {
|
|
4126
4183
|
constructor() {
|
|
4127
4184
|
super(...arguments);
|
|
4128
|
-
c(this, "defaultAnchor",
|
|
4185
|
+
c(this, "defaultAnchor", R.getBaidu().toValue(e.position));
|
|
4129
4186
|
c(this, "defaultOffset", new BMap.Size(0, 0));
|
|
4130
4187
|
}
|
|
4131
4188
|
initialize(n) {
|
|
@@ -4137,43 +4194,46 @@ class wi extends lt {
|
|
|
4137
4194
|
}
|
|
4138
4195
|
}
|
|
4139
4196
|
removeCustomControl(e) {
|
|
4140
|
-
e.inner && (
|
|
4197
|
+
e.inner && (ne(e.inner instanceof BMap.Control, `control.inner(${e.inner})需要是BMap.Control`), this.map.removeControl(e.inner));
|
|
4141
4198
|
}
|
|
4142
4199
|
createMarkerClusterer(e) {
|
|
4143
|
-
return new
|
|
4200
|
+
return new _i(this, e);
|
|
4144
4201
|
}
|
|
4145
4202
|
createAutocomplete(e) {
|
|
4146
|
-
return new
|
|
4203
|
+
return new gi(this, e);
|
|
4147
4204
|
}
|
|
4148
4205
|
createSearchBox(e) {
|
|
4149
|
-
return new
|
|
4206
|
+
return new Ci(this, e);
|
|
4150
4207
|
}
|
|
4151
|
-
|
|
4152
|
-
return new
|
|
4208
|
+
createPlacesService(e) {
|
|
4209
|
+
return new Ti(this, e);
|
|
4210
|
+
}
|
|
4211
|
+
createMapUrlsService(e) {
|
|
4212
|
+
return new Se(e);
|
|
4153
4213
|
}
|
|
4154
4214
|
}
|
|
4155
|
-
class
|
|
4215
|
+
class Ri extends ut {
|
|
4156
4216
|
constructor(e, r) {
|
|
4157
4217
|
var n;
|
|
4158
4218
|
super(e);
|
|
4159
4219
|
c(this, "buildInMapTypeId2BIMT");
|
|
4160
4220
|
c(this, "googleMapTypeId2BIMT");
|
|
4161
4221
|
c(this, "map");
|
|
4162
|
-
c(this, "createLabel",
|
|
4163
|
-
c(this, "createCircle",
|
|
4164
|
-
c(this, "createPolygon",
|
|
4165
|
-
c(this, "createPolyline",
|
|
4166
|
-
c(this, "createRectangle",
|
|
4167
|
-
c(this, "createInfoWindow",
|
|
4168
|
-
c(this, "createInfoBox",
|
|
4169
|
-
c(this, "createMarker",
|
|
4170
|
-
c(this, "createMapTypeControl",
|
|
4171
|
-
c(this, "createZoomControl",
|
|
4172
|
-
c(this, "createScaleControl",
|
|
4173
|
-
this.mapOptions = r, this.buildInMapTypeId2BIMT =
|
|
4222
|
+
c(this, "createLabel", Tt.create);
|
|
4223
|
+
c(this, "createCircle", mt.create);
|
|
4224
|
+
c(this, "createPolygon", xt.create);
|
|
4225
|
+
c(this, "createPolyline", Et.create);
|
|
4226
|
+
c(this, "createRectangle", kt.create);
|
|
4227
|
+
c(this, "createInfoWindow", vt.create);
|
|
4228
|
+
c(this, "createInfoBox", bt.create);
|
|
4229
|
+
c(this, "createMarker", Ot.create);
|
|
4230
|
+
c(this, "createMapTypeControl", Pe.create);
|
|
4231
|
+
c(this, "createZoomControl", ct.create);
|
|
4232
|
+
c(this, "createScaleControl", lt.create);
|
|
4233
|
+
this.mapOptions = r, this.buildInMapTypeId2BIMT = A.BUILD_IN_MAP_TYPES.getValueMap(B.prototype.getId), this.googleMapTypeId2BIMT = A.BUILD_IN_MAP_TYPES.getValueMap(B.prototype.getGoogleMapTypeId);
|
|
4174
4234
|
const s = r.buildInMapTypeId && this.buildInMapTypeId2BIMT.get(r.buildInMapTypeId);
|
|
4175
4235
|
this.map = new google.maps.Map(e, {
|
|
4176
|
-
center: r.center.toGoogle((s ??
|
|
4236
|
+
center: r.center.toGoogle((s ?? A.NORMAL).getGoogleCoordType()),
|
|
4177
4237
|
zoom: r.zoom,
|
|
4178
4238
|
disableDefaultUI: !0,
|
|
4179
4239
|
streetViewControl: !0,
|
|
@@ -4182,7 +4242,7 @@ class Ei extends lt {
|
|
|
4182
4242
|
maxZoom: r.maxZoom,
|
|
4183
4243
|
styles: (n = r.mapStyle) == null ? void 0 : n.toGoogle(),
|
|
4184
4244
|
mapTypeId: s == null ? void 0 : s.getGoogleMapTypeId()
|
|
4185
|
-
}), this.setEventTargetDelegate(new
|
|
4245
|
+
}), this.setEventTargetDelegate(new te(this.map, this));
|
|
4186
4246
|
}
|
|
4187
4247
|
setGestureHandling(e) {
|
|
4188
4248
|
this.map.setOptions({
|
|
@@ -4203,17 +4263,17 @@ class Ei extends lt {
|
|
|
4203
4263
|
if (n == null || a == null || h == null)
|
|
4204
4264
|
return y.ZERO;
|
|
4205
4265
|
const o = Math.pow(2, h), l = new google.maps.Point(e.x / o + n.x, e.y / o + a.y);
|
|
4206
|
-
return y.fromGoogle(r.fromPointToLatLng(l) ??
|
|
4266
|
+
return y.fromGoogle(r.fromPointToLatLng(l) ?? X.LATLNG_ZERO, this.coordType);
|
|
4207
4267
|
}
|
|
4208
4268
|
fromLatLngToContainerPoint(e) {
|
|
4209
4269
|
const r = this.innerMap.getProjection(), s = this.innerMap.getBounds();
|
|
4210
4270
|
if (r == null || s == null)
|
|
4211
|
-
return
|
|
4271
|
+
return K.ZERO;
|
|
4212
4272
|
const n = r.fromLatLngToPoint(s.getSouthWest()), a = r.fromLatLngToPoint(s.getNorthEast()), h = this.innerMap.getZoom();
|
|
4213
4273
|
if (n == null || a == null || h == null)
|
|
4214
|
-
return
|
|
4274
|
+
return K.ZERO;
|
|
4215
4275
|
const o = Math.pow(2, h), l = r.fromLatLngToPoint(e.toGoogle(this.coordType));
|
|
4216
|
-
return l == null ?
|
|
4276
|
+
return l == null ? K.ZERO : { x: (l.x - n.x) * o, y: (l.y - a.y) * o };
|
|
4217
4277
|
}
|
|
4218
4278
|
setDefaultCursor(e) {
|
|
4219
4279
|
this.innerMap.setOptions({ draggableCursor: e });
|
|
@@ -4225,7 +4285,7 @@ class Ei extends lt {
|
|
|
4225
4285
|
this.map.setOptions({ disableDoubleClickZoom: !e });
|
|
4226
4286
|
}
|
|
4227
4287
|
getCenter() {
|
|
4228
|
-
return y.fromGoogle(this.map.getCenter() ??
|
|
4288
|
+
return y.fromGoogle(this.map.getCenter() ?? X.LATLNG_ZERO, this.coordType);
|
|
4229
4289
|
}
|
|
4230
4290
|
setCenter(e) {
|
|
4231
4291
|
this.map.setCenter(e.toGoogle(this.coordType));
|
|
@@ -4242,20 +4302,20 @@ class Ei extends lt {
|
|
|
4242
4302
|
setBuildInMapTypeId(e) {
|
|
4243
4303
|
var s;
|
|
4244
4304
|
const r = (s = this.buildInMapTypeId2BIMT.get(e)) == null ? void 0 : s.getGoogleMapTypeId();
|
|
4245
|
-
this.map.setMapTypeId(r ??
|
|
4305
|
+
this.map.setMapTypeId(r ?? C("理论上来说不可能为空"));
|
|
4246
4306
|
}
|
|
4247
4307
|
setMapType(e) {
|
|
4248
4308
|
e instanceof B ? this.map.setMapTypeId(e.getGoogleMapTypeId()) : (this.map.mapTypes.set(e.id, e.asGoogleMapType()), this.map.setMapTypeId(e.id));
|
|
4249
4309
|
}
|
|
4250
4310
|
getMapType() {
|
|
4251
4311
|
const e = this.map.getMapTypeId() ?? google.maps.MapTypeId.ROADMAP, r = this.googleMapTypeId2BIMT.get(e);
|
|
4252
|
-
return r || (this.map.mapTypes.get(e).__google_map_type__ ??
|
|
4312
|
+
return r || (this.map.mapTypes.get(e).__google_map_type__ ?? C(`实现${e}的asGoogleMapType()时, 忘了给实例设置__google_map_type__?`));
|
|
4253
4313
|
}
|
|
4254
4314
|
addOverlayMapType(e) {
|
|
4255
4315
|
this.map.overlayMapTypes.push(e.asGoogleMapType());
|
|
4256
4316
|
}
|
|
4257
4317
|
removeOverlayMapType(e) {
|
|
4258
|
-
|
|
4318
|
+
he.remove(this.map.overlayMapTypes, e.asGoogleMapType());
|
|
4259
4319
|
}
|
|
4260
4320
|
addLayer(e) {
|
|
4261
4321
|
e.asGoogleLayer().setMap(this.map);
|
|
@@ -4289,36 +4349,39 @@ class Ei extends lt {
|
|
|
4289
4349
|
e.innerOverlay.setMap(null);
|
|
4290
4350
|
}
|
|
4291
4351
|
addCustomControl(e) {
|
|
4292
|
-
e.inner || (e.inner = e.onCreateElement(), this.map.controls[
|
|
4352
|
+
e.inner || (e.inner = e.onCreateElement(), this.map.controls[R.getGoogle().toValue(e.position)].push(e.inner));
|
|
4293
4353
|
}
|
|
4294
4354
|
removeCustomControl(e) {
|
|
4295
4355
|
if (e.inner) {
|
|
4296
|
-
const r = this.map.controls[
|
|
4297
|
-
|
|
4356
|
+
const r = this.map.controls[R.getGoogle().toValue(e.position)];
|
|
4357
|
+
he.remove(r, e.inner);
|
|
4298
4358
|
}
|
|
4299
4359
|
}
|
|
4300
4360
|
createMarkerClusterer(e) {
|
|
4301
|
-
return new
|
|
4361
|
+
return new bi(this, e);
|
|
4302
4362
|
}
|
|
4303
4363
|
createAutocomplete(e) {
|
|
4304
|
-
return new
|
|
4364
|
+
return new pi(this, e);
|
|
4305
4365
|
}
|
|
4306
4366
|
createSearchBox(e) {
|
|
4307
|
-
return new
|
|
4367
|
+
return new Oi(this, e);
|
|
4308
4368
|
}
|
|
4309
|
-
|
|
4310
|
-
return new
|
|
4369
|
+
createPlacesService(e) {
|
|
4370
|
+
return new Mi(this, e);
|
|
4371
|
+
}
|
|
4372
|
+
createMapUrlsService(e) {
|
|
4373
|
+
return new ke(e);
|
|
4311
4374
|
}
|
|
4312
4375
|
}
|
|
4313
|
-
class
|
|
4376
|
+
class $i extends ut {
|
|
4314
4377
|
constructor(e, r) {
|
|
4315
4378
|
var a;
|
|
4316
4379
|
super(e);
|
|
4317
4380
|
c(this, "map");
|
|
4318
4381
|
c(this, "defaultLayers");
|
|
4319
4382
|
this.mapOptions = r;
|
|
4320
|
-
const s =
|
|
4321
|
-
|
|
4383
|
+
const s = Jt().here;
|
|
4384
|
+
Ie.includes(s.version) || C(`不支持${s.version}, HereMap当前只支持如下版本: ${Ie}`);
|
|
4322
4385
|
const n = new H.service.Platform({
|
|
4323
4386
|
app_id: s.key.split(",")[0],
|
|
4324
4387
|
app_code: s.key.split(",")[1]
|
|
@@ -4332,7 +4395,7 @@ class Li extends lt {
|
|
|
4332
4395
|
return this.map;
|
|
4333
4396
|
}
|
|
4334
4397
|
get coordType() {
|
|
4335
|
-
return
|
|
4398
|
+
return S.wgs84;
|
|
4336
4399
|
}
|
|
4337
4400
|
getCenter() {
|
|
4338
4401
|
return y.fromHere(this.map.getCenter(), this.coordType);
|
|
@@ -4419,7 +4482,10 @@ class Li extends lt {
|
|
|
4419
4482
|
createSearchBox(e) {
|
|
4420
4483
|
throw new Error("Method not implemented.");
|
|
4421
4484
|
}
|
|
4422
|
-
|
|
4485
|
+
createPlacesService(e) {
|
|
4486
|
+
throw new Error("Method not implemented.");
|
|
4487
|
+
}
|
|
4488
|
+
createMapUrlsService(e) {
|
|
4423
4489
|
throw new Error("Method not implemented.");
|
|
4424
4490
|
}
|
|
4425
4491
|
createInfoWindow(e) {
|
|
@@ -4459,89 +4525,89 @@ class Li extends lt {
|
|
|
4459
4525
|
throw new Error("Method not implemented.");
|
|
4460
4526
|
}
|
|
4461
4527
|
}
|
|
4462
|
-
var
|
|
4528
|
+
var N = /* @__PURE__ */ ((i) => (i.google = "google", i.baidu = "baidu", i.here = "here", i))(N || {}), tt;
|
|
4463
4529
|
((i) => {
|
|
4464
4530
|
function t(e, r, s) {
|
|
4465
|
-
const n =
|
|
4531
|
+
const n = et.create(s);
|
|
4466
4532
|
switch (e) {
|
|
4467
4533
|
case "google":
|
|
4468
|
-
return new
|
|
4534
|
+
return new Ri(r, n);
|
|
4469
4535
|
case "baidu":
|
|
4470
|
-
return new
|
|
4536
|
+
return new Ai(r, n);
|
|
4471
4537
|
case "here":
|
|
4472
|
-
return new
|
|
4538
|
+
return new $i(r, n);
|
|
4473
4539
|
}
|
|
4474
4540
|
}
|
|
4475
4541
|
i.createMap = t;
|
|
4476
|
-
})(
|
|
4477
|
-
function
|
|
4478
|
-
const e = window, r =
|
|
4542
|
+
})(tt || (tt = {}));
|
|
4543
|
+
function Di({ type: i, config: t }) {
|
|
4544
|
+
const e = window, r = zi(i);
|
|
4479
4545
|
if (e[r])
|
|
4480
4546
|
return Promise.resolve();
|
|
4481
|
-
switch (i !==
|
|
4482
|
-
case
|
|
4483
|
-
return {}.VITE_FALSE ? (
|
|
4547
|
+
switch (i !== N.here && !t.key && C(`请先配置${i}地图的key`), i) {
|
|
4548
|
+
case N.google:
|
|
4549
|
+
return {}.VITE_FALSE ? (ci({
|
|
4484
4550
|
key: t.key,
|
|
4485
4551
|
v: "3.52"
|
|
4486
4552
|
// v: config.version,
|
|
4487
|
-
}), google.maps.importLibrary("core")) :
|
|
4488
|
-
case
|
|
4489
|
-
return
|
|
4490
|
-
case
|
|
4491
|
-
return ue(
|
|
4553
|
+
}), google.maps.importLibrary("core")) : Wt(`https://maps.googleapis.com/maps/api/js?key=${t.key}&language=${t.language}&v=${t.version}&libraries=${t.libraries.join(",")}`);
|
|
4554
|
+
case N.baidu:
|
|
4555
|
+
return Wt(`https://api.map.baidu.com/api?v=${t.version}&ak=${t.key}`);
|
|
4556
|
+
case N.here:
|
|
4557
|
+
return pe(ue("core", t.version)).then(() => Promise.all([
|
|
4492
4558
|
// 其他大多数模块都可以同时载入
|
|
4493
|
-
ue(
|
|
4494
|
-
ue(
|
|
4495
|
-
ue(
|
|
4496
|
-
ue(
|
|
4559
|
+
pe(ue("service", t.version)),
|
|
4560
|
+
pe(ue("mapevents", t.version)),
|
|
4561
|
+
pe(ue("clustering", t.version)),
|
|
4562
|
+
pe(ue("ui", t.version))
|
|
4497
4563
|
])).catch((s) => (delete e[r], Promise.reject(s)));
|
|
4498
4564
|
default:
|
|
4499
|
-
|
|
4565
|
+
Xe(i);
|
|
4500
4566
|
}
|
|
4501
4567
|
}
|
|
4502
|
-
function
|
|
4568
|
+
function ue(i, t = Ie[0]) {
|
|
4503
4569
|
return `https://js.api.here.com/v3/${t}/mapsjs-${i}.js`;
|
|
4504
4570
|
}
|
|
4505
|
-
function
|
|
4571
|
+
function zi(i) {
|
|
4506
4572
|
switch (i) {
|
|
4507
|
-
case
|
|
4573
|
+
case N.google:
|
|
4508
4574
|
return "google";
|
|
4509
|
-
case
|
|
4575
|
+
case N.baidu:
|
|
4510
4576
|
return "BMap";
|
|
4511
|
-
case
|
|
4577
|
+
case N.here:
|
|
4512
4578
|
return "H";
|
|
4513
4579
|
}
|
|
4514
4580
|
}
|
|
4515
|
-
let
|
|
4516
|
-
function
|
|
4581
|
+
let Ni = 0;
|
|
4582
|
+
function Wt(i, t = "callback") {
|
|
4517
4583
|
return new Promise((e, r) => {
|
|
4518
|
-
const s = `__callback${
|
|
4584
|
+
const s = `__callback${Ni++}`;
|
|
4519
4585
|
window[s] = e;
|
|
4520
4586
|
const n = document.createElement("script");
|
|
4521
4587
|
n.src = `${i}&${t}=${s}`, n.onerror = r, document.body.appendChild(n);
|
|
4522
4588
|
});
|
|
4523
4589
|
}
|
|
4524
|
-
function
|
|
4590
|
+
function pe(i) {
|
|
4525
4591
|
return new Promise((t, e) => {
|
|
4526
4592
|
const r = document.createElement("script");
|
|
4527
4593
|
r.src = i, r.onload = t, r.onerror = e, document.body.appendChild(r);
|
|
4528
4594
|
});
|
|
4529
4595
|
}
|
|
4530
|
-
function
|
|
4596
|
+
function G(i, t) {
|
|
4531
4597
|
return {
|
|
4532
4598
|
type: String,
|
|
4533
4599
|
default: t,
|
|
4534
4600
|
validator: (e) => Object.values(i).includes(e)
|
|
4535
4601
|
};
|
|
4536
4602
|
}
|
|
4537
|
-
function
|
|
4603
|
+
function Gi(i, t) {
|
|
4538
4604
|
return {
|
|
4539
4605
|
type: String,
|
|
4540
4606
|
default: t,
|
|
4541
4607
|
validator: (e) => i.includes(e)
|
|
4542
4608
|
};
|
|
4543
4609
|
}
|
|
4544
|
-
function
|
|
4610
|
+
function $(i) {
|
|
4545
4611
|
return {
|
|
4546
4612
|
type: i,
|
|
4547
4613
|
required: !0
|
|
@@ -4553,7 +4619,7 @@ function m(i, t) {
|
|
|
4553
4619
|
default: t
|
|
4554
4620
|
};
|
|
4555
4621
|
}
|
|
4556
|
-
function
|
|
4622
|
+
function Hs(i) {
|
|
4557
4623
|
const t = {};
|
|
4558
4624
|
return Object.entries(i).forEach(([e, r]) => {
|
|
4559
4625
|
const s = `__${e}`;
|
|
@@ -4570,37 +4636,37 @@ function Ts(i) {
|
|
|
4570
4636
|
};
|
|
4571
4637
|
}), t;
|
|
4572
4638
|
}
|
|
4573
|
-
const
|
|
4639
|
+
const ge = {
|
|
4574
4640
|
enumerable: !0,
|
|
4575
4641
|
configurable: !0,
|
|
4576
|
-
get:
|
|
4577
|
-
set:
|
|
4642
|
+
get: ye,
|
|
4643
|
+
set: ye
|
|
4578
4644
|
};
|
|
4579
|
-
function
|
|
4645
|
+
function Zi(i) {
|
|
4580
4646
|
return Object.keys(i).forEach((t) => {
|
|
4581
4647
|
const e = i[t];
|
|
4582
4648
|
let r = !1;
|
|
4583
|
-
typeof e == "function" ? (
|
|
4649
|
+
typeof e == "function" ? (ge.get = e, ge.set = ye, r = !0) : typeof e == "object" && typeof e.get == "function" && (ge.get = e.get, ge.set = e.set, r = !0), r && (i[t] = Object.defineProperty(i, t, ge));
|
|
4584
4650
|
}), i;
|
|
4585
4651
|
}
|
|
4586
|
-
function
|
|
4587
|
-
return
|
|
4652
|
+
function js(i) {
|
|
4653
|
+
return Zi(i);
|
|
4588
4654
|
}
|
|
4589
|
-
function
|
|
4590
|
-
return
|
|
4655
|
+
function Tr() {
|
|
4656
|
+
return Ke();
|
|
4591
4657
|
}
|
|
4592
|
-
function
|
|
4658
|
+
function xe(i, t) {
|
|
4593
4659
|
const e = i.$options[t];
|
|
4594
4660
|
if (e)
|
|
4595
4661
|
for (const r of e)
|
|
4596
4662
|
r.call(i);
|
|
4597
4663
|
}
|
|
4598
|
-
function
|
|
4664
|
+
function Vs(i, t) {
|
|
4599
4665
|
for (const e of i)
|
|
4600
4666
|
if (e.$options.name === t.name)
|
|
4601
4667
|
return e;
|
|
4602
4668
|
}
|
|
4603
|
-
function
|
|
4669
|
+
function Fs(i, t) {
|
|
4604
4670
|
if (!i.default)
|
|
4605
4671
|
return;
|
|
4606
4672
|
const e = i.default();
|
|
@@ -4608,12 +4674,12 @@ function ws(i, t) {
|
|
|
4608
4674
|
if ((r == null ? void 0 : r.type).name === t.name)
|
|
4609
4675
|
return r;
|
|
4610
4676
|
}
|
|
4611
|
-
function
|
|
4677
|
+
function Wi(i, t) {
|
|
4612
4678
|
const e = {}, r = {}, s = {};
|
|
4613
4679
|
return Object.keys(i).forEach((n) => {
|
|
4614
|
-
n.startsWith("on") ? e[
|
|
4680
|
+
n.startsWith("on") ? e[be.pascal2kebab(n.substring(2))] = i[n] : r[n] = i[n];
|
|
4615
4681
|
}), t && Object.keys(t).forEach((n) => {
|
|
4616
|
-
n.startsWith("on") && (s[
|
|
4682
|
+
n.startsWith("on") && (s[be.pascal2kebab(n.substring(2))] = t[n]);
|
|
4617
4683
|
}), {
|
|
4618
4684
|
/** class/style/未声明的属性 等 */
|
|
4619
4685
|
binds: r,
|
|
@@ -4623,13 +4689,13 @@ function Si(i, t) {
|
|
|
4623
4689
|
listenerProps: s
|
|
4624
4690
|
};
|
|
4625
4691
|
}
|
|
4626
|
-
function
|
|
4627
|
-
return
|
|
4692
|
+
function U(i, t) {
|
|
4693
|
+
return jt(() => Wi(i, t));
|
|
4628
4694
|
}
|
|
4629
4695
|
function L() {
|
|
4630
4696
|
return Function;
|
|
4631
4697
|
}
|
|
4632
|
-
const
|
|
4698
|
+
const Us = () => {
|
|
4633
4699
|
let i, t;
|
|
4634
4700
|
function e(s) {
|
|
4635
4701
|
console.log(s), i = s && s.type, t = Date.now();
|
|
@@ -4638,33 +4704,33 @@ const Es = () => {
|
|
|
4638
4704
|
((s && s.type) !== i || Date.now() - (t ?? 0) > 1e3) && e(s);
|
|
4639
4705
|
}
|
|
4640
4706
|
return { eventLog: e, eventLogLess: r };
|
|
4641
|
-
},
|
|
4642
|
-
inject: [
|
|
4707
|
+
}, St = "$map", Ce = "onCreate", we = "onDestroy", P = w({
|
|
4708
|
+
inject: [St],
|
|
4643
4709
|
mounted() {
|
|
4644
|
-
|
|
4710
|
+
xe(this, Ce);
|
|
4645
4711
|
},
|
|
4646
4712
|
beforeUnmount() {
|
|
4647
|
-
|
|
4713
|
+
xe(this, we);
|
|
4648
4714
|
},
|
|
4649
4715
|
methods: {
|
|
4650
4716
|
recreate() {
|
|
4651
|
-
|
|
4717
|
+
xe(this, we), xe(this, Ce);
|
|
4652
4718
|
}
|
|
4653
4719
|
},
|
|
4654
4720
|
render() {
|
|
4655
|
-
return
|
|
4721
|
+
return Tr();
|
|
4656
4722
|
}
|
|
4657
|
-
}),
|
|
4723
|
+
}), Hi = w({
|
|
4658
4724
|
name: "tg-map",
|
|
4659
4725
|
provide() {
|
|
4660
4726
|
return {
|
|
4661
|
-
[
|
|
4727
|
+
[St]: jt(() => this.map)
|
|
4662
4728
|
};
|
|
4663
4729
|
},
|
|
4664
4730
|
inheritAttrs: !1,
|
|
4665
4731
|
props: {
|
|
4666
4732
|
/** type没做响应式, 但外部可以把type作为tg-map的key, 让type修改时完全重建tg-map */
|
|
4667
|
-
type: N
|
|
4733
|
+
type: G(N, N.google),
|
|
4668
4734
|
/**
|
|
4669
4735
|
* 当对该属性使用双向绑定时, 改变center将触发update:center又反过来触发center改变, 最终导致无限循环...
|
|
4670
4736
|
* 当前通过setCenter()时判断center是否有改变来避免该问题, 但为了避免可能存在的问题, 另外设计了如下机制:
|
|
@@ -4673,7 +4739,7 @@ const Es = () => {
|
|
|
4673
4739
|
* - :last-center.sync="center": 获取tg-map销毁时的最后的center的值, 使用这种方式可以做到type切换时保留中心点位置
|
|
4674
4740
|
* @see AbstractMapEventMap.center-changed
|
|
4675
4741
|
* */
|
|
4676
|
-
center:
|
|
4742
|
+
center: $(y),
|
|
4677
4743
|
/**
|
|
4678
4744
|
* 同步center的延时
|
|
4679
4745
|
* @default 300
|
|
@@ -4690,17 +4756,17 @@ const Es = () => {
|
|
|
4690
4756
|
* @see center
|
|
4691
4757
|
*/
|
|
4692
4758
|
lastCenter: m(y),
|
|
4693
|
-
zoom:
|
|
4759
|
+
zoom: $(Number),
|
|
4694
4760
|
/**
|
|
4695
4761
|
* 该属性不会响应式更新, 要让它立即生效, 请参考{@link file://./../views/map/InfoDemo.vue#L3}
|
|
4696
4762
|
* @see MapOptions.infoWindowMode
|
|
4697
4763
|
*/
|
|
4698
|
-
infoWindowMode:
|
|
4699
|
-
gestureHandling:
|
|
4764
|
+
infoWindowMode: Gi(Li),
|
|
4765
|
+
gestureHandling: G(W),
|
|
4700
4766
|
minZoom: m(Number),
|
|
4701
4767
|
maxZoom: m(Number),
|
|
4702
4768
|
mapStyle: m(Object),
|
|
4703
|
-
mapTypeId:
|
|
4769
|
+
mapTypeId: G(ir),
|
|
4704
4770
|
/** 地图类型对象, 优先级比mapTypeId高 */
|
|
4705
4771
|
mapType: m(Object),
|
|
4706
4772
|
hideLogo: m(Boolean),
|
|
@@ -4717,19 +4783,19 @@ const Es = () => {
|
|
|
4717
4783
|
emits: void 0,
|
|
4718
4784
|
setup(i, { attrs: t }) {
|
|
4719
4785
|
return {
|
|
4720
|
-
attrs:
|
|
4786
|
+
attrs: U(t, i),
|
|
4721
4787
|
centerSyncTimeoutId: void 0
|
|
4722
4788
|
};
|
|
4723
4789
|
},
|
|
4724
4790
|
data() {
|
|
4725
4791
|
return {
|
|
4726
|
-
map:
|
|
4792
|
+
map: Je(),
|
|
4727
4793
|
isDestroyed: !1
|
|
4728
4794
|
};
|
|
4729
4795
|
},
|
|
4730
4796
|
computed: {
|
|
4731
4797
|
propsJson() {
|
|
4732
|
-
return
|
|
4798
|
+
return _e.toJsonSafely(this.$props);
|
|
4733
4799
|
}
|
|
4734
4800
|
},
|
|
4735
4801
|
watch: {
|
|
@@ -4755,13 +4821,13 @@ const Es = () => {
|
|
|
4755
4821
|
},
|
|
4756
4822
|
mapType(i) {
|
|
4757
4823
|
var t;
|
|
4758
|
-
(t = this.map) == null || t.setMapType(i ??
|
|
4824
|
+
(t = this.map) == null || t.setMapType(i ?? A.NORMAL);
|
|
4759
4825
|
}
|
|
4760
4826
|
},
|
|
4761
4827
|
async mounted() {
|
|
4762
4828
|
const i = this.type;
|
|
4763
4829
|
try {
|
|
4764
|
-
await
|
|
4830
|
+
await Di({ type: i, config: Jt()[i] });
|
|
4765
4831
|
} catch (s) {
|
|
4766
4832
|
this.$emit("error", s);
|
|
4767
4833
|
return;
|
|
@@ -4770,7 +4836,7 @@ const Es = () => {
|
|
|
4770
4836
|
console.warn(`tg-map(type=${i})已销毁, 不需要继续执行`);
|
|
4771
4837
|
return;
|
|
4772
4838
|
}
|
|
4773
|
-
const t =
|
|
4839
|
+
const t = tt.createMap(
|
|
4774
4840
|
i,
|
|
4775
4841
|
this.$refs.map,
|
|
4776
4842
|
/* options: */
|
|
@@ -4785,12 +4851,12 @@ const Es = () => {
|
|
|
4785
4851
|
buildInMapTypeId: this.mapTypeId
|
|
4786
4852
|
}
|
|
4787
4853
|
);
|
|
4788
|
-
if (this.map =
|
|
4854
|
+
if (this.map = Sr(t), this.mapType && t.setMapType(this.mapType), "ready" in this.attrs.listeners && console.error("地图载入完成的事件已经从ready改为了load, 请手动修改"), F(
|
|
4789
4855
|
this.attrs.listeners,
|
|
4790
4856
|
t,
|
|
4791
4857
|
/* excludes: */
|
|
4792
4858
|
["load"]
|
|
4793
|
-
), this.$emit("load", t),
|
|
4859
|
+
), this.$emit("load", t), Vt([
|
|
4794
4860
|
() => this.zoom,
|
|
4795
4861
|
() => this.center
|
|
4796
4862
|
//
|
|
@@ -4818,28 +4884,28 @@ const Es = () => {
|
|
|
4818
4884
|
},
|
|
4819
4885
|
methods: {}
|
|
4820
4886
|
});
|
|
4821
|
-
const
|
|
4887
|
+
const q = (i, t) => {
|
|
4822
4888
|
const e = i.__vccOpts || i;
|
|
4823
4889
|
for (const [r, s] of t)
|
|
4824
4890
|
e[r] = s;
|
|
4825
4891
|
return e;
|
|
4826
4892
|
};
|
|
4827
|
-
function
|
|
4828
|
-
return
|
|
4829
|
-
|
|
4893
|
+
function ji(i, t, e, r, s, n) {
|
|
4894
|
+
return j(), V("div", de({ class: "tg-map" }, i.attrs.binds), [
|
|
4895
|
+
Br("div", {
|
|
4830
4896
|
ref: "map",
|
|
4831
|
-
class:
|
|
4897
|
+
class: Ne({
|
|
4832
4898
|
"tg-map__map": !0,
|
|
4833
4899
|
[`tg-map__map--hide-logo-${i.type}`]: i.hideLogo
|
|
4834
4900
|
})
|
|
4835
4901
|
}, null, 2),
|
|
4836
|
-
|
|
4837
|
-
i.map ?
|
|
4838
|
-
|
|
4902
|
+
Ke("", !0),
|
|
4903
|
+
i.map ? Z(i.$slots, "default", { key: 1 }) : Ke("", !0),
|
|
4904
|
+
Z(i.$slots, "overlay")
|
|
4839
4905
|
], 16);
|
|
4840
4906
|
}
|
|
4841
|
-
const
|
|
4842
|
-
function
|
|
4907
|
+
const Or = /* @__PURE__ */ q(Hi, [["render", ji]]);
|
|
4908
|
+
function Vi(i) {
|
|
4843
4909
|
if (i == null)
|
|
4844
4910
|
return;
|
|
4845
4911
|
let t;
|
|
@@ -4850,7 +4916,7 @@ function zi(i) {
|
|
|
4850
4916
|
t = i;
|
|
4851
4917
|
return `${t}px`;
|
|
4852
4918
|
}
|
|
4853
|
-
const
|
|
4919
|
+
const Fi = w({
|
|
4854
4920
|
name: "tg-map-widget",
|
|
4855
4921
|
props: {
|
|
4856
4922
|
left: {
|
|
@@ -4876,22 +4942,22 @@ const Di = C({
|
|
|
4876
4942
|
}
|
|
4877
4943
|
},
|
|
4878
4944
|
methods: {
|
|
4879
|
-
dimen:
|
|
4945
|
+
dimen: Vi
|
|
4880
4946
|
}
|
|
4881
4947
|
});
|
|
4882
|
-
function
|
|
4883
|
-
return
|
|
4884
|
-
class:
|
|
4885
|
-
style:
|
|
4948
|
+
function Ui(i, t, e, r, s, n) {
|
|
4949
|
+
return j(), V("div", {
|
|
4950
|
+
class: Ne(i.$options.name),
|
|
4951
|
+
style: Ir({ left: i.dimen(i.left), top: i.dimen(i.topValue), right: i.dimen(i.right), bottom: i.dimen(i.bottom) })
|
|
4886
4952
|
}, [
|
|
4887
|
-
|
|
4953
|
+
Z(i.$slots, "default")
|
|
4888
4954
|
], 6);
|
|
4889
4955
|
}
|
|
4890
|
-
const
|
|
4956
|
+
const qi = /* @__PURE__ */ q(Fi, [["render", Ui]]), Yi = w({
|
|
4891
4957
|
name: "tg-custom-control",
|
|
4892
4958
|
mixins: [P],
|
|
4893
4959
|
props: {
|
|
4894
|
-
position:
|
|
4960
|
+
position: G(k, k.RIGHT_BOTTOM)
|
|
4895
4961
|
},
|
|
4896
4962
|
setup() {
|
|
4897
4963
|
return {
|
|
@@ -4904,8 +4970,8 @@ const Ls = /* @__PURE__ */ U(Di, [["render", Ni]]), Gi = C({
|
|
|
4904
4970
|
}
|
|
4905
4971
|
},
|
|
4906
4972
|
onCreate() {
|
|
4907
|
-
|
|
4908
|
-
const { $el: i } = this, t = class extends
|
|
4973
|
+
Ee(this.$parent, Or) || console.warn("请将tg-custom-control放到tg-map中");
|
|
4974
|
+
const { $el: i } = this, t = class extends li {
|
|
4909
4975
|
onCreateElement() {
|
|
4910
4976
|
return i;
|
|
4911
4977
|
}
|
|
@@ -4916,19 +4982,19 @@ const Ls = /* @__PURE__ */ U(Di, [["render", Ni]]), Gi = C({
|
|
|
4916
4982
|
this.$map.removeCustomControl(this.control);
|
|
4917
4983
|
}
|
|
4918
4984
|
});
|
|
4919
|
-
function
|
|
4920
|
-
return
|
|
4921
|
-
class:
|
|
4985
|
+
function Ki(i, t, e, r, s, n) {
|
|
4986
|
+
return j(), V("div", {
|
|
4987
|
+
class: Ne(i.$options.name)
|
|
4922
4988
|
}, [
|
|
4923
|
-
|
|
4989
|
+
Z(i.$slots, "default")
|
|
4924
4990
|
], 2);
|
|
4925
4991
|
}
|
|
4926
|
-
const
|
|
4992
|
+
const Xi = /* @__PURE__ */ q(Yi, [["render", Ki]]), Ji = w({
|
|
4927
4993
|
name: "tg-map-type-control",
|
|
4928
4994
|
mixins: [P],
|
|
4929
4995
|
props: {
|
|
4930
|
-
position:
|
|
4931
|
-
type:
|
|
4996
|
+
position: G(k, k.TOP_LEFT),
|
|
4997
|
+
type: G(sr),
|
|
4932
4998
|
mapTypes: m(Array)
|
|
4933
4999
|
},
|
|
4934
5000
|
setup() {
|
|
@@ -4956,11 +5022,11 @@ const xs = /* @__PURE__ */ U(Gi, [["render", Zi]]), Ps = C({
|
|
|
4956
5022
|
onDestroy() {
|
|
4957
5023
|
this.$map.removeControl(this.control);
|
|
4958
5024
|
}
|
|
4959
|
-
}),
|
|
5025
|
+
}), Qi = w({
|
|
4960
5026
|
name: "tg-scale-control",
|
|
4961
5027
|
mixins: [P],
|
|
4962
5028
|
props: {
|
|
4963
|
-
position:
|
|
5029
|
+
position: G(k, k.BOTTOM_RIGHT)
|
|
4964
5030
|
},
|
|
4965
5031
|
setup() {
|
|
4966
5032
|
return {
|
|
@@ -4979,32 +5045,32 @@ const xs = /* @__PURE__ */ U(Gi, [["render", Zi]]), Ps = C({
|
|
|
4979
5045
|
this.$map.removeControl(this.control);
|
|
4980
5046
|
}
|
|
4981
5047
|
});
|
|
4982
|
-
function
|
|
5048
|
+
function Cr() {
|
|
4983
5049
|
var e;
|
|
4984
|
-
const i = (e =
|
|
5050
|
+
const i = (e = Ar()) == null ? void 0 : e.type;
|
|
4985
5051
|
let t = (i == null ? void 0 : i.name) ?? (i == null ? void 0 : i.__name);
|
|
4986
5052
|
if (!t) {
|
|
4987
5053
|
const r = i == null ? void 0 : i.__file;
|
|
4988
|
-
r && (t =
|
|
5054
|
+
r && (t = ki.basename(r, ".vue"));
|
|
4989
5055
|
}
|
|
4990
5056
|
return t;
|
|
4991
5057
|
}
|
|
4992
|
-
function
|
|
4993
|
-
const i =
|
|
5058
|
+
function es() {
|
|
5059
|
+
const i = Rr(St);
|
|
4994
5060
|
let t, e;
|
|
4995
|
-
return i == null &&
|
|
5061
|
+
return i == null && C(`<${Cr() || "unknown"}>必须作为<tg-map>的子代组件`), {
|
|
4996
5062
|
mapRef: i,
|
|
4997
5063
|
/** 读取map对象, 只要放在<tg-map>里面的组件(除#overlay插槽外)都能够立即读取到map对象 */
|
|
4998
5064
|
get map() {
|
|
4999
|
-
return i.value ??
|
|
5065
|
+
return i.value ?? C("map尚未初始化");
|
|
5000
5066
|
},
|
|
5001
5067
|
/** 地图元素创建回调 */
|
|
5002
|
-
[
|
|
5003
|
-
|
|
5068
|
+
[Ce](r) {
|
|
5069
|
+
$r(r), t && C(`${Ce}只能调用一次`), t = r;
|
|
5004
5070
|
},
|
|
5005
5071
|
/** 地图元素销毁回调 */
|
|
5006
|
-
[
|
|
5007
|
-
|
|
5072
|
+
[we](r) {
|
|
5073
|
+
Dr(r), e && C(`${we}只能调用一次`), e = r;
|
|
5008
5074
|
},
|
|
5009
5075
|
/** 重新创建地图元素 */
|
|
5010
5076
|
recreate() {
|
|
@@ -5012,23 +5078,23 @@ function Wi() {
|
|
|
5012
5078
|
}
|
|
5013
5079
|
};
|
|
5014
5080
|
}
|
|
5015
|
-
const
|
|
5081
|
+
const ts = w({
|
|
5016
5082
|
name: "tg-zoom-control",
|
|
5017
5083
|
props: {
|
|
5018
|
-
position:
|
|
5084
|
+
position: G(k, k.RIGHT_BOTTOM)
|
|
5019
5085
|
},
|
|
5020
5086
|
setup(i) {
|
|
5021
5087
|
let t = void 0;
|
|
5022
|
-
const { map: e, onCreate: r, onDestroy: s } =
|
|
5088
|
+
const { map: e, onCreate: r, onDestroy: s } = es();
|
|
5023
5089
|
return r(() => {
|
|
5024
5090
|
t = e.createZoomControl(i), e.addControl(t);
|
|
5025
5091
|
}), s(() => {
|
|
5026
5092
|
e.removeControl(t);
|
|
5027
|
-
}),
|
|
5093
|
+
}), Vt(() => i.position, (n) => {
|
|
5028
5094
|
t.setPosition(n);
|
|
5029
|
-
}),
|
|
5095
|
+
}), Tr;
|
|
5030
5096
|
}
|
|
5031
|
-
}),
|
|
5097
|
+
}), rs = w({
|
|
5032
5098
|
name: "tg-marker-clusterer",
|
|
5033
5099
|
mixins: [P],
|
|
5034
5100
|
// markers从this.$children中读取, 故需要省略(Omit)
|
|
@@ -5088,18 +5154,18 @@ const Bs = C({
|
|
|
5088
5154
|
this.markers.push(i), this.isInitiated() && this.clusterer.addMarker(i);
|
|
5089
5155
|
},
|
|
5090
5156
|
onRemoveMarker(i) {
|
|
5091
|
-
this.isInitiated() && this.clusterer.removeMarker(i),
|
|
5157
|
+
this.isInitiated() && this.clusterer.removeMarker(i), le.remove(this.markers, i);
|
|
5092
5158
|
}
|
|
5093
5159
|
}
|
|
5094
5160
|
});
|
|
5095
|
-
function
|
|
5096
|
-
return
|
|
5097
|
-
class:
|
|
5161
|
+
function is(i, t, e, r, s, n) {
|
|
5162
|
+
return j(), V("div", {
|
|
5163
|
+
class: Ne(i.$options.name)
|
|
5098
5164
|
}, [
|
|
5099
|
-
|
|
5165
|
+
Z(i.$slots, "default")
|
|
5100
5166
|
], 2);
|
|
5101
5167
|
}
|
|
5102
|
-
const
|
|
5168
|
+
const wr = /* @__PURE__ */ q(rs, [["render", is]]), ss = w({
|
|
5103
5169
|
name: "tg-traffic-layer",
|
|
5104
5170
|
mixins: [P],
|
|
5105
5171
|
// 请直接使用v-if来控制它的显隐
|
|
@@ -5112,18 +5178,18 @@ const Vi = /* @__PURE__ */ U(Hi, [["render", ji]]), Is = C({
|
|
|
5112
5178
|
},
|
|
5113
5179
|
watch: {},
|
|
5114
5180
|
onCreate() {
|
|
5115
|
-
this.layer = new
|
|
5181
|
+
this.layer = new hi(), this.$map.addLayer(this.layer);
|
|
5116
5182
|
},
|
|
5117
5183
|
onDestroy() {
|
|
5118
5184
|
this.$map.removeLayer(this.layer);
|
|
5119
5185
|
}
|
|
5120
|
-
}),
|
|
5186
|
+
}), ns = w({
|
|
5121
5187
|
name: "tg-circle",
|
|
5122
5188
|
mixins: [P],
|
|
5123
5189
|
inheritAttrs: !1,
|
|
5124
5190
|
props: {
|
|
5125
|
-
center:
|
|
5126
|
-
radius:
|
|
5191
|
+
center: $(y),
|
|
5192
|
+
radius: $(Number),
|
|
5127
5193
|
clickable: m(Boolean),
|
|
5128
5194
|
editable: m(Boolean),
|
|
5129
5195
|
strokeColor: m(String),
|
|
@@ -5138,7 +5204,7 @@ const Vi = /* @__PURE__ */ U(Hi, [["render", ji]]), Is = C({
|
|
|
5138
5204
|
emits: void 0,
|
|
5139
5205
|
setup(i, { attrs: t }) {
|
|
5140
5206
|
return {
|
|
5141
|
-
attrs:
|
|
5207
|
+
attrs: U(t, i),
|
|
5142
5208
|
overlay: void 0,
|
|
5143
5209
|
emittedRadius: void 0,
|
|
5144
5210
|
emittedCenter: void 0
|
|
@@ -5148,7 +5214,7 @@ const Vi = /* @__PURE__ */ U(Hi, [["render", ji]]), Is = C({
|
|
|
5148
5214
|
center(i) {
|
|
5149
5215
|
if (this.emittedCenter != null) {
|
|
5150
5216
|
const t = this.emittedCenter;
|
|
5151
|
-
if (this.emittedCenter = void 0, t ===
|
|
5217
|
+
if (this.emittedCenter = void 0, t === Ge(i))
|
|
5152
5218
|
return;
|
|
5153
5219
|
}
|
|
5154
5220
|
this.overlay.setCenter(i);
|
|
@@ -5187,7 +5253,7 @@ const Vi = /* @__PURE__ */ U(Hi, [["render", ji]]), Is = C({
|
|
|
5187
5253
|
}
|
|
5188
5254
|
},
|
|
5189
5255
|
onCreate() {
|
|
5190
|
-
this.overlay = this.$map.createCircle(this), this.$map.addOverlay(this.overlay),
|
|
5256
|
+
this.overlay = this.$map.createCircle(this), this.$map.addOverlay(this.overlay), F(this.attrs.listeners, this.overlay), "update:center" in this.attrs.listenerProps && this.overlay.addEventListener("center-changed", () => {
|
|
5191
5257
|
this.$emit("update:center", this.emittedCenter = this.overlay.getCenter());
|
|
5192
5258
|
}), "update:radius" in this.attrs.listenerProps && this.overlay.addEventListener("radius-changed", () => {
|
|
5193
5259
|
this.$emit("update:radius", this.emittedRadius = this.overlay.getRadius());
|
|
@@ -5197,7 +5263,7 @@ const Vi = /* @__PURE__ */ U(Hi, [["render", ji]]), Is = C({
|
|
|
5197
5263
|
this.$map.removeOverlay(this.overlay);
|
|
5198
5264
|
}
|
|
5199
5265
|
});
|
|
5200
|
-
class
|
|
5266
|
+
class os extends Si {
|
|
5201
5267
|
constructor(t, e, r, s) {
|
|
5202
5268
|
super(t, e), this.content = r, this.position = s;
|
|
5203
5269
|
}
|
|
@@ -5212,12 +5278,12 @@ class Fi extends Ti {
|
|
|
5212
5278
|
this.position = t, this.draw();
|
|
5213
5279
|
}
|
|
5214
5280
|
}
|
|
5215
|
-
const
|
|
5281
|
+
const as = w({
|
|
5216
5282
|
name: "tg-element-overlay",
|
|
5217
5283
|
mixins: [P],
|
|
5218
5284
|
props: {
|
|
5219
|
-
mapPane:
|
|
5220
|
-
position:
|
|
5285
|
+
mapPane: G(Me, Me.overlayMouseTarget),
|
|
5286
|
+
position: $(y)
|
|
5221
5287
|
},
|
|
5222
5288
|
setup() {
|
|
5223
5289
|
return {
|
|
@@ -5238,25 +5304,25 @@ const Ui = C({
|
|
|
5238
5304
|
}
|
|
5239
5305
|
},
|
|
5240
5306
|
onCreate() {
|
|
5241
|
-
this.overlay = new
|
|
5307
|
+
this.overlay = new os(this.$map, this, this.content(), this.position), this.$map.addElementOverlay(this.overlay);
|
|
5242
5308
|
},
|
|
5243
5309
|
onDestroy() {
|
|
5244
5310
|
this.$map.removeElementOverlay(this.overlay);
|
|
5245
5311
|
}
|
|
5246
5312
|
});
|
|
5247
|
-
function
|
|
5248
|
-
return
|
|
5313
|
+
function ls(i, t, e, r, s, n) {
|
|
5314
|
+
return j(), V("div", de({
|
|
5249
5315
|
class: i.$options.name
|
|
5250
5316
|
}, i.$attrs), [
|
|
5251
|
-
|
|
5317
|
+
Z(i.$slots, "default")
|
|
5252
5318
|
], 16);
|
|
5253
5319
|
}
|
|
5254
|
-
const
|
|
5320
|
+
const hs = /* @__PURE__ */ q(as, [["render", ls]]), cs = w({
|
|
5255
5321
|
name: "tg-marker",
|
|
5256
5322
|
mixins: [P],
|
|
5257
5323
|
inheritAttrs: !1,
|
|
5258
5324
|
props: {
|
|
5259
|
-
position:
|
|
5325
|
+
position: $(y),
|
|
5260
5326
|
title: m(String),
|
|
5261
5327
|
icon: m(Object),
|
|
5262
5328
|
clickable: m(Boolean),
|
|
@@ -5270,10 +5336,10 @@ const As = /* @__PURE__ */ U(Ui, [["render", qi]]), Yi = C({
|
|
|
5270
5336
|
emits: void 0,
|
|
5271
5337
|
setup(i, { attrs: t }) {
|
|
5272
5338
|
return {
|
|
5273
|
-
attrs:
|
|
5339
|
+
attrs: U(t, i),
|
|
5274
5340
|
marker: void 0,
|
|
5275
|
-
label:
|
|
5276
|
-
info:
|
|
5341
|
+
label: Je(),
|
|
5342
|
+
info: Je(),
|
|
5277
5343
|
emittedPosition: void 0
|
|
5278
5344
|
};
|
|
5279
5345
|
},
|
|
@@ -5281,7 +5347,7 @@ const As = /* @__PURE__ */ U(Ui, [["render", qi]]), Yi = C({
|
|
|
5281
5347
|
position(i) {
|
|
5282
5348
|
if (this.emittedPosition != null) {
|
|
5283
5349
|
const t = this.emittedPosition;
|
|
5284
|
-
if (this.emittedPosition = void 0, t ===
|
|
5350
|
+
if (this.emittedPosition = void 0, t === Ge(i))
|
|
5285
5351
|
return;
|
|
5286
5352
|
}
|
|
5287
5353
|
this.marker.setPosition(i);
|
|
@@ -5293,7 +5359,7 @@ const As = /* @__PURE__ */ U(Ui, [["render", qi]]), Yi = C({
|
|
|
5293
5359
|
i ? this.marker.setIcon(i) : this.recreate();
|
|
5294
5360
|
},
|
|
5295
5361
|
clickable(i) {
|
|
5296
|
-
this.marker instanceof
|
|
5362
|
+
this.marker instanceof Oe ? this.recreate() : this.marker.setClickable(i);
|
|
5297
5363
|
},
|
|
5298
5364
|
draggable(i) {
|
|
5299
5365
|
this.marker.setDraggable(i);
|
|
@@ -5305,14 +5371,14 @@ const As = /* @__PURE__ */ U(Ui, [["render", qi]]), Yi = C({
|
|
|
5305
5371
|
this.recreate();
|
|
5306
5372
|
},
|
|
5307
5373
|
zIndex(i) {
|
|
5308
|
-
this.marker instanceof
|
|
5374
|
+
this.marker instanceof Oe ? this.recreate() : this.marker.setZIndex(i);
|
|
5309
5375
|
},
|
|
5310
5376
|
visible(i) {
|
|
5311
5377
|
this.marker.setVisible(i);
|
|
5312
5378
|
}
|
|
5313
5379
|
},
|
|
5314
5380
|
onCreate() {
|
|
5315
|
-
this.marker = this.$map.createMarker(this), this.label && this.marker.setLabel(this.label.overlay), this.$clusterer() ? this.$clusterer().onAddMarker(this.marker) : this.$map.addOverlay(this.marker), this.info && this.info.show && this.info.overlay.open(this.marker),
|
|
5381
|
+
this.marker = this.$map.createMarker(this), this.label && this.marker.setLabel(this.label.overlay), this.$clusterer() ? this.$clusterer().onAddMarker(this.marker) : this.$map.addOverlay(this.marker), this.info && this.info.show && this.info.overlay.open(this.marker), F(this.attrs.listeners, this.marker), "update:position" in this.attrs.listenerProps && this.marker.addEventListener("dragend", (i) => {
|
|
5316
5382
|
this.$emit("update:position", this.emittedPosition = i.position);
|
|
5317
5383
|
});
|
|
5318
5384
|
},
|
|
@@ -5321,7 +5387,7 @@ const As = /* @__PURE__ */ U(Ui, [["render", qi]]), Yi = C({
|
|
|
5321
5387
|
},
|
|
5322
5388
|
methods: {
|
|
5323
5389
|
$clusterer() {
|
|
5324
|
-
return
|
|
5390
|
+
return Ee(this.$parent, wr);
|
|
5325
5391
|
},
|
|
5326
5392
|
onAddLabel(i) {
|
|
5327
5393
|
this.label = i, this.marker && this.marker.setLabel(i.overlay);
|
|
@@ -5340,19 +5406,19 @@ const As = /* @__PURE__ */ U(Ui, [["render", qi]]), Yi = C({
|
|
|
5340
5406
|
}
|
|
5341
5407
|
}
|
|
5342
5408
|
});
|
|
5343
|
-
function
|
|
5344
|
-
return
|
|
5409
|
+
function ds(i, t, e, r, s, n) {
|
|
5410
|
+
return j(), V("div", de({
|
|
5345
5411
|
class: i.$options.name
|
|
5346
5412
|
}, i.attrs.binds), [
|
|
5347
|
-
|
|
5413
|
+
Z(i.$slots, "default")
|
|
5348
5414
|
], 16);
|
|
5349
5415
|
}
|
|
5350
|
-
const
|
|
5416
|
+
const je = /* @__PURE__ */ q(cs, [["render", ds]]), us = w({
|
|
5351
5417
|
name: "tg-info-box",
|
|
5352
5418
|
mixins: [P],
|
|
5353
5419
|
inheritAttrs: !1,
|
|
5354
5420
|
props: {
|
|
5355
|
-
show:
|
|
5421
|
+
show: $(Boolean),
|
|
5356
5422
|
position: m(y),
|
|
5357
5423
|
offset: m(Object),
|
|
5358
5424
|
maxWidth: m(Number),
|
|
@@ -5363,7 +5429,7 @@ const xt = /* @__PURE__ */ U(Yi, [["render", Ki]]), Xi = C({
|
|
|
5363
5429
|
emits: void 0,
|
|
5364
5430
|
setup(i, { attrs: t }) {
|
|
5365
5431
|
return {
|
|
5366
|
-
attrs:
|
|
5432
|
+
attrs: U(t, i),
|
|
5367
5433
|
overlay: void 0
|
|
5368
5434
|
};
|
|
5369
5435
|
},
|
|
@@ -5390,7 +5456,7 @@ const xt = /* @__PURE__ */ U(Yi, [["render", Ki]]), Xi = C({
|
|
|
5390
5456
|
onCreate() {
|
|
5391
5457
|
this.overlay = this.$map.createInfoBox(this.getOptions()), this.$marker() ? this.$marker().onAddInfo(this) : this.show && this.overlay.open(), "update:show" in this.attrs.listenerProps && this.overlay.addEventListener("closeclick", () => {
|
|
5392
5458
|
this.$emit("update:show", !1);
|
|
5393
|
-
}),
|
|
5459
|
+
}), F(this.attrs.listeners, this.overlay);
|
|
5394
5460
|
},
|
|
5395
5461
|
onDestroy() {
|
|
5396
5462
|
this.$marker() ? this.$marker().onRemoveInfo(this) : this.overlay.close();
|
|
@@ -5410,7 +5476,7 @@ const xt = /* @__PURE__ */ U(Yi, [["render", Ki]]), Xi = C({
|
|
|
5410
5476
|
return this.$el;
|
|
5411
5477
|
},
|
|
5412
5478
|
$marker() {
|
|
5413
|
-
return
|
|
5479
|
+
return Ee(this.$parent, je);
|
|
5414
5480
|
},
|
|
5415
5481
|
open(i) {
|
|
5416
5482
|
this.overlay.open(i);
|
|
@@ -5420,19 +5486,19 @@ const xt = /* @__PURE__ */ U(Yi, [["render", Ki]]), Xi = C({
|
|
|
5420
5486
|
}
|
|
5421
5487
|
}
|
|
5422
5488
|
});
|
|
5423
|
-
function
|
|
5424
|
-
return
|
|
5489
|
+
function ps(i, t, e, r, s, n) {
|
|
5490
|
+
return j(), V("div", de({
|
|
5425
5491
|
class: i.$options.name
|
|
5426
5492
|
}, i.attrs.binds), [
|
|
5427
|
-
|
|
5493
|
+
Z(i.$slots, "default")
|
|
5428
5494
|
], 16);
|
|
5429
5495
|
}
|
|
5430
|
-
const
|
|
5496
|
+
const gs = /* @__PURE__ */ q(us, [["render", ps]]), ms = w({
|
|
5431
5497
|
name: "tg-info-window",
|
|
5432
5498
|
mixins: [P],
|
|
5433
5499
|
inheritAttrs: !1,
|
|
5434
5500
|
props: {
|
|
5435
|
-
show:
|
|
5501
|
+
show: $(Boolean),
|
|
5436
5502
|
position: m(y),
|
|
5437
5503
|
maxWidth: m(Number),
|
|
5438
5504
|
offset: m(Object),
|
|
@@ -5442,7 +5508,7 @@ const Rs = /* @__PURE__ */ U(Xi, [["render", Ji]]), Qi = C({
|
|
|
5442
5508
|
emits: void 0,
|
|
5443
5509
|
setup(i, { attrs: t }) {
|
|
5444
5510
|
return {
|
|
5445
|
-
attrs:
|
|
5511
|
+
attrs: U(t, i),
|
|
5446
5512
|
overlay: void 0
|
|
5447
5513
|
};
|
|
5448
5514
|
},
|
|
@@ -5468,7 +5534,7 @@ const Rs = /* @__PURE__ */ U(Xi, [["render", Ji]]), Qi = C({
|
|
|
5468
5534
|
return this.$el;
|
|
5469
5535
|
},
|
|
5470
5536
|
$marker() {
|
|
5471
|
-
return
|
|
5537
|
+
return Ee(this.$parent, je);
|
|
5472
5538
|
},
|
|
5473
5539
|
getOptions() {
|
|
5474
5540
|
return {
|
|
@@ -5485,22 +5551,22 @@ const Rs = /* @__PURE__ */ U(Xi, [["render", Ji]]), Qi = C({
|
|
|
5485
5551
|
this.$emit("update:show", !0);
|
|
5486
5552
|
}), this.overlay.addEventListener("close", () => {
|
|
5487
5553
|
this.$emit("update:show", !1);
|
|
5488
|
-
}),
|
|
5554
|
+
}), F(this.attrs.listeners, this.overlay);
|
|
5489
5555
|
},
|
|
5490
5556
|
onDestroy() {
|
|
5491
5557
|
this.$marker() ? this.$marker().onRemoveInfo(this) : this.overlay.close();
|
|
5492
5558
|
}
|
|
5493
5559
|
});
|
|
5494
|
-
function
|
|
5495
|
-
return
|
|
5560
|
+
function fs(i, t, e, r, s, n) {
|
|
5561
|
+
return zr((j(), V("div", de({
|
|
5496
5562
|
class: i.$options.name
|
|
5497
5563
|
}, i.attrs.binds), [
|
|
5498
|
-
|
|
5564
|
+
Z(i.$slots, "default")
|
|
5499
5565
|
], 16)), [
|
|
5500
|
-
[
|
|
5566
|
+
[Nr, i.show]
|
|
5501
5567
|
]);
|
|
5502
5568
|
}
|
|
5503
|
-
const
|
|
5569
|
+
const ys = /* @__PURE__ */ q(ms, [["render", fs]]), vs = w({
|
|
5504
5570
|
name: "tg-label",
|
|
5505
5571
|
mixins: [P],
|
|
5506
5572
|
inheritAttrs: !1,
|
|
@@ -5508,12 +5574,12 @@ const $s = /* @__PURE__ */ U(Qi, [["render", es]]), ts = C({
|
|
|
5508
5574
|
position: m(y),
|
|
5509
5575
|
offset: m(Object),
|
|
5510
5576
|
zIndex: m(Number),
|
|
5511
|
-
mapPane:
|
|
5577
|
+
mapPane: G(Me)
|
|
5512
5578
|
},
|
|
5513
5579
|
emits: void 0,
|
|
5514
5580
|
setup(i, { attrs: t }) {
|
|
5515
5581
|
return {
|
|
5516
|
-
attrs:
|
|
5582
|
+
attrs: U(t),
|
|
5517
5583
|
overlay: void 0
|
|
5518
5584
|
};
|
|
5519
5585
|
},
|
|
@@ -5543,7 +5609,7 @@ const $s = /* @__PURE__ */ U(Qi, [["render", es]]), ts = C({
|
|
|
5543
5609
|
return (i = this.$marker()) == null ? void 0 : i.marker;
|
|
5544
5610
|
},
|
|
5545
5611
|
$marker() {
|
|
5546
|
-
return
|
|
5612
|
+
return Ee(this.$parent, je);
|
|
5547
5613
|
},
|
|
5548
5614
|
getOptions() {
|
|
5549
5615
|
return {
|
|
@@ -5556,25 +5622,25 @@ const $s = /* @__PURE__ */ U(Qi, [["render", es]]), ts = C({
|
|
|
5556
5622
|
}
|
|
5557
5623
|
},
|
|
5558
5624
|
onCreate() {
|
|
5559
|
-
this.overlay = this.$map.createLabel(this.getOptions()), this.$marker() ? this.$marker().onAddLabel(this) : this.$map.addOverlay(this.overlay),
|
|
5625
|
+
this.overlay = this.$map.createLabel(this.getOptions()), this.$marker() ? this.$marker().onAddLabel(this) : this.$map.addOverlay(this.overlay), F(this.attrs.listeners, this.overlay);
|
|
5560
5626
|
},
|
|
5561
5627
|
onDestroy() {
|
|
5562
5628
|
this.$marker() ? this.$marker().onRemoveLabel(this) : this.$map.removeOverlay(this.overlay);
|
|
5563
5629
|
}
|
|
5564
5630
|
});
|
|
5565
|
-
function
|
|
5566
|
-
return
|
|
5631
|
+
function _s(i, t, e, r, s, n) {
|
|
5632
|
+
return j(), V("div", de({
|
|
5567
5633
|
class: i.$options.name
|
|
5568
5634
|
}, i.attrs.binds), [
|
|
5569
|
-
|
|
5635
|
+
Z(i.$slots, "default")
|
|
5570
5636
|
], 16);
|
|
5571
5637
|
}
|
|
5572
|
-
const
|
|
5638
|
+
const bs = /* @__PURE__ */ q(vs, [["render", _s]]), Ms = w({
|
|
5573
5639
|
name: "tg-polygon",
|
|
5574
5640
|
mixins: [P],
|
|
5575
5641
|
inheritAttrs: !1,
|
|
5576
5642
|
props: {
|
|
5577
|
-
paths:
|
|
5643
|
+
paths: $(Array),
|
|
5578
5644
|
clickable: m(Boolean),
|
|
5579
5645
|
editable: m(Boolean),
|
|
5580
5646
|
strokeColor: m(String),
|
|
@@ -5588,7 +5654,7 @@ const zs = /* @__PURE__ */ U(ts, [["render", rs]]), Ds = C({
|
|
|
5588
5654
|
emits: void 0,
|
|
5589
5655
|
setup(i, { attrs: t }) {
|
|
5590
5656
|
return {
|
|
5591
|
-
attrs:
|
|
5657
|
+
attrs: U(t, i),
|
|
5592
5658
|
overlay: void 0,
|
|
5593
5659
|
emittedPaths: void 0
|
|
5594
5660
|
};
|
|
@@ -5598,7 +5664,7 @@ const zs = /* @__PURE__ */ U(ts, [["render", rs]]), Ds = C({
|
|
|
5598
5664
|
handler(i) {
|
|
5599
5665
|
if (this.emittedPaths != null) {
|
|
5600
5666
|
const t = this.emittedPaths;
|
|
5601
|
-
if (this.emittedPaths = void 0, t.length === i.length && t.every((e, r) => e ===
|
|
5667
|
+
if (this.emittedPaths = void 0, t.length === i.length && t.every((e, r) => e === Ge(i[r])))
|
|
5602
5668
|
return;
|
|
5603
5669
|
}
|
|
5604
5670
|
this.overlay.setPaths(i);
|
|
@@ -5631,19 +5697,19 @@ const zs = /* @__PURE__ */ U(ts, [["render", rs]]), Ds = C({
|
|
|
5631
5697
|
}
|
|
5632
5698
|
},
|
|
5633
5699
|
onCreate() {
|
|
5634
|
-
this.overlay = this.$map.createPolygon(this), this.$map.addOverlay(this.overlay),
|
|
5700
|
+
this.overlay = this.$map.createPolygon(this), this.$map.addOverlay(this.overlay), F(this.attrs.listeners, this.overlay), "update:paths" in this.attrs.listenerProps && this.overlay.addEventListener("paths-edited", () => {
|
|
5635
5701
|
this.$emit("update:paths", this.emittedPaths = this.overlay.getPaths());
|
|
5636
5702
|
});
|
|
5637
5703
|
},
|
|
5638
5704
|
onDestroy() {
|
|
5639
5705
|
this.$map.removeOverlay(this.overlay);
|
|
5640
5706
|
}
|
|
5641
|
-
}),
|
|
5707
|
+
}), Ts = w({
|
|
5642
5708
|
name: "tg-polyline",
|
|
5643
5709
|
mixins: [P],
|
|
5644
5710
|
inheritAttrs: !1,
|
|
5645
5711
|
props: {
|
|
5646
|
-
path:
|
|
5712
|
+
path: $(Array),
|
|
5647
5713
|
clickable: m(Boolean),
|
|
5648
5714
|
editable: m(Boolean),
|
|
5649
5715
|
strokeColor: m(String),
|
|
@@ -5655,7 +5721,7 @@ const zs = /* @__PURE__ */ U(ts, [["render", rs]]), Ds = C({
|
|
|
5655
5721
|
emits: void 0,
|
|
5656
5722
|
setup(i, { attrs: t }) {
|
|
5657
5723
|
return {
|
|
5658
|
-
attrs:
|
|
5724
|
+
attrs: U(t, i),
|
|
5659
5725
|
overlay: void 0,
|
|
5660
5726
|
emittedPath: void 0
|
|
5661
5727
|
};
|
|
@@ -5665,7 +5731,7 @@ const zs = /* @__PURE__ */ U(ts, [["render", rs]]), Ds = C({
|
|
|
5665
5731
|
handler(i) {
|
|
5666
5732
|
if (this.emittedPath != null) {
|
|
5667
5733
|
const t = this.emittedPath;
|
|
5668
|
-
if (this.emittedPath = void 0, t ===
|
|
5734
|
+
if (this.emittedPath = void 0, t === Ge(i))
|
|
5669
5735
|
return;
|
|
5670
5736
|
}
|
|
5671
5737
|
this.overlay.setPath(i);
|
|
@@ -5692,19 +5758,19 @@ const zs = /* @__PURE__ */ U(ts, [["render", rs]]), Ds = C({
|
|
|
5692
5758
|
}
|
|
5693
5759
|
},
|
|
5694
5760
|
onCreate() {
|
|
5695
|
-
this.overlay = this.$map.createPolyline(this), this.$map.addOverlay(this.overlay),
|
|
5761
|
+
this.overlay = this.$map.createPolyline(this), this.$map.addOverlay(this.overlay), F(this.attrs.listeners, this.overlay), "update:path" in this.attrs.listenerProps && this.overlay.addEventListener("path-edited", () => {
|
|
5696
5762
|
this.$emit("update:path", this.emittedPath = this.overlay.getPath());
|
|
5697
5763
|
});
|
|
5698
5764
|
},
|
|
5699
5765
|
onDestroy() {
|
|
5700
5766
|
this.$map.removeOverlay(this.overlay);
|
|
5701
5767
|
}
|
|
5702
|
-
}),
|
|
5768
|
+
}), Os = w({
|
|
5703
5769
|
name: "tg-rectangle",
|
|
5704
5770
|
mixins: [P],
|
|
5705
5771
|
inheritAttrs: !1,
|
|
5706
5772
|
props: {
|
|
5707
|
-
bounds:
|
|
5773
|
+
bounds: $(Object),
|
|
5708
5774
|
clickable: m(Boolean),
|
|
5709
5775
|
editable: m(Boolean),
|
|
5710
5776
|
strokeColor: m(String),
|
|
@@ -5718,7 +5784,7 @@ const zs = /* @__PURE__ */ U(ts, [["render", rs]]), Ds = C({
|
|
|
5718
5784
|
emits: void 0,
|
|
5719
5785
|
setup(i, { attrs: t }) {
|
|
5720
5786
|
return {
|
|
5721
|
-
attrs:
|
|
5787
|
+
attrs: U(t, i),
|
|
5722
5788
|
overlay: void 0,
|
|
5723
5789
|
emittedBounds: void 0
|
|
5724
5790
|
};
|
|
@@ -5758,21 +5824,21 @@ const zs = /* @__PURE__ */ U(ts, [["render", rs]]), Ds = C({
|
|
|
5758
5824
|
}
|
|
5759
5825
|
},
|
|
5760
5826
|
onCreate() {
|
|
5761
|
-
this.overlay = this.$map.createRectangle(this), this.$map.addOverlay(this.overlay),
|
|
5827
|
+
this.overlay = this.$map.createRectangle(this), this.$map.addOverlay(this.overlay), F(this.attrs.listeners, this.overlay), "update:bounds" in this.attrs.listenerProps && this.overlay.addEventListener("bounds-changed", () => {
|
|
5762
5828
|
this.$emit("update:bounds", this.emittedBounds = this.overlay.getBounds());
|
|
5763
5829
|
});
|
|
5764
5830
|
},
|
|
5765
5831
|
onDestroy() {
|
|
5766
5832
|
this.$map.removeOverlay(this.overlay);
|
|
5767
5833
|
}
|
|
5768
|
-
}),
|
|
5834
|
+
}), Cs = ["beforeUpdate", "updated"], qs = {
|
|
5769
5835
|
install(i, t = {}) {
|
|
5770
5836
|
if (t.enable !== !1) {
|
|
5771
|
-
const e =
|
|
5837
|
+
const e = w({
|
|
5772
5838
|
beforeCreate() {
|
|
5773
|
-
const r =
|
|
5774
|
-
t.hookNames ? t.hookNames.includes(a) && console.debug("[lifecycle]", r, a) :
|
|
5775
|
-
} :
|
|
5839
|
+
const r = Cr() ?? "", n = (t.nameRegex || /^[A-Z]/).test(r) ? (a) => {
|
|
5840
|
+
t.hookNames ? t.hookNames.includes(a) && console.debug("[lifecycle]", r, a) : Cs.includes(a) || console.debug("[lifecycle]", r, a);
|
|
5841
|
+
} : ye;
|
|
5776
5842
|
n("beforeCreate"), this.__life_impl = n;
|
|
5777
5843
|
},
|
|
5778
5844
|
created() {
|
|
@@ -5811,173 +5877,184 @@ const zs = /* @__PURE__ */ U(ts, [["render", rs]]), Ds = C({
|
|
|
5811
5877
|
i.mixin(e);
|
|
5812
5878
|
}
|
|
5813
5879
|
}
|
|
5814
|
-
},
|
|
5815
|
-
function
|
|
5880
|
+
}, ws = 6378137;
|
|
5881
|
+
function fe(i) {
|
|
5816
5882
|
return i * Math.PI / 180;
|
|
5817
5883
|
}
|
|
5818
|
-
function
|
|
5884
|
+
function Ht(i) {
|
|
5819
5885
|
return i * 180 / Math.PI;
|
|
5820
5886
|
}
|
|
5821
|
-
function
|
|
5887
|
+
function Es(i, t) {
|
|
5822
5888
|
if (i.lat === t.lat && i.lng === t.lng)
|
|
5823
5889
|
return 0;
|
|
5824
|
-
const e =
|
|
5890
|
+
const e = fe((i.lat + t.lat) / 2), r = fe((i.lat - t.lat) / 2), s = fe((i.lng - t.lng) / 2);
|
|
5825
5891
|
let n = Math.sin(r), a = Math.sin(s), h = Math.sin(e);
|
|
5826
|
-
const o =
|
|
5892
|
+
const o = ws, l = 1 / 298.257;
|
|
5827
5893
|
n = n * n, a = a * a, h = h * h;
|
|
5828
5894
|
const d = n * (1 - a) + (1 - h) * a, u = (1 - n) * (1 - a) + h * a, p = Math.atan(Math.sqrt(d / u)), b = Math.sqrt(d * u) / p, _ = 2 * p * o, M = (3 * b - 1) / 2 / u, g = (3 * b + 1) / 2 / d;
|
|
5829
5895
|
return _ * (1 + l * (M * h * (1 - n) - g * (1 - h) * n));
|
|
5830
5896
|
}
|
|
5831
|
-
function
|
|
5832
|
-
const s = 63567523142e-4, n = 1 / 298.257223563, a =
|
|
5833
|
-
let v = 0, O = 0, x = 0,
|
|
5834
|
-
for (; Math.abs(
|
|
5835
|
-
v = Math.cos(2 * p +
|
|
5836
|
-
const
|
|
5837
|
-
|
|
5897
|
+
function Ls(i, t, e) {
|
|
5898
|
+
const s = 63567523142e-4, n = 1 / 298.257223563, a = fe(t), h = Math.sin(a), o = Math.cos(a), l = (1 - n) * Math.tan(fe(i.lat)), d = 1 / Math.sqrt(1 + l * l), u = l * d, p = Math.atan2(l, o), b = d * h, _ = 1 - b * b, M = _ * (6378137 * 6378137 - s * s) / (s * s), g = 1 + M / 16384 * (4096 + M * (-768 + M * (320 - 175 * M))), f = M / 1024 * (256 + M * (-128 + M * (74 - 47 * M)));
|
|
5899
|
+
let v = 0, O = 0, x = 0, E = e / (s * g), J = 2 * Math.PI;
|
|
5900
|
+
for (; Math.abs(E - J) > 1e-12; ) {
|
|
5901
|
+
v = Math.cos(2 * p + E), O = Math.sin(E), x = Math.cos(E);
|
|
5902
|
+
const xr = f * O * (v + f / 4 * (x * (-1 + 2 * v * v) - f / 6 * v * (-3 + 4 * O * O) * (-3 + 4 * v * v)));
|
|
5903
|
+
J = E, E = e / (s * g) + xr;
|
|
5838
5904
|
}
|
|
5839
|
-
const
|
|
5905
|
+
const re = u * O - d * x * o, Ve = Math.atan2(
|
|
5840
5906
|
u * x + d * O * o,
|
|
5841
|
-
(1 - n) * Math.sqrt(b * b +
|
|
5842
|
-
),
|
|
5843
|
-
return { lng: i.lng +
|
|
5844
|
-
}
|
|
5845
|
-
const
|
|
5846
|
-
getDistance:
|
|
5847
|
-
getDestination:
|
|
5848
|
-
},
|
|
5907
|
+
(1 - n) * Math.sqrt(b * b + re * re)
|
|
5908
|
+
), Er = Math.atan2(O * h, d * x - u * O * o), Fe = n / 16 * _ * (4 + n * (4 - 3 * _)), Lr = Er - (1 - Fe) * n * b * (E + Fe * O * (v + Fe * x * (-1 + 2 * v * v)));
|
|
5909
|
+
return { lng: i.lng + Ht(Lr), lat: Ht(Ve) };
|
|
5910
|
+
}
|
|
5911
|
+
const Ys = {
|
|
5912
|
+
getDistance: Es,
|
|
5913
|
+
getDestination: Ls
|
|
5914
|
+
}, Ks = {
|
|
5849
5915
|
install(i, t) {
|
|
5850
|
-
|
|
5916
|
+
if (si(t), {}.VITE_FALSE) {
|
|
5917
|
+
const r = /* @__PURE__ */ Object.assign({ "./TgMap.vue": Or, "./TgMapWidget.vue": qi, "./controls/TgCustomControl.vue": Xi, "./controls/TgMapTypeControl.vue": Ji, "./controls/TgScaleControl.vue": Qi, "./controls/TgZoomControl.vue": ts, "./extra/TgMarkerClusterer.vue": wr, "./layers/TgTrafficLayer.vue": ss, "./overlays/TgCircle.vue": ns, "./overlays/TgElementOverlay.vue": hs, "./overlays/TgInfoBox.vue": gs, "./overlays/TgInfoWindow.vue": ys, "./overlays/TgLabel.vue": bs, "./overlays/TgMarker.vue": je, "./overlays/TgPolygon.vue": Ms, "./overlays/TgPolyline.vue": Ts, "./overlays/TgRectangle.vue": Os });
|
|
5918
|
+
Object.keys(r).forEach((s) => {
|
|
5919
|
+
const n = r[s];
|
|
5920
|
+
i.component(n.name ?? C(`Tg开头的组件必须设置name: ${s}`), n);
|
|
5921
|
+
});
|
|
5922
|
+
}
|
|
5851
5923
|
const e = i.config.optionMergeStrategies;
|
|
5852
|
-
e[
|
|
5924
|
+
e[Ce] = e[we] = (r, s) => r ? [...new Set([].concat(r, s))] : Array.isArray(s) ? s : [s];
|
|
5853
5925
|
}
|
|
5854
5926
|
};
|
|
5855
5927
|
export {
|
|
5856
|
-
|
|
5857
|
-
|
|
5858
|
-
|
|
5859
|
-
|
|
5860
|
-
|
|
5861
|
-
|
|
5862
|
-
|
|
5863
|
-
|
|
5864
|
-
|
|
5865
|
-
|
|
5866
|
-
|
|
5867
|
-
|
|
5868
|
-
|
|
5869
|
-
|
|
5870
|
-
|
|
5871
|
-
|
|
5872
|
-
|
|
5873
|
-
wt as
|
|
5874
|
-
|
|
5875
|
-
|
|
5876
|
-
|
|
5928
|
+
rr as AbstractControl,
|
|
5929
|
+
ut as AbstractMap,
|
|
5930
|
+
le as Arrays,
|
|
5931
|
+
lr as Autocomplete,
|
|
5932
|
+
gi as BaiduAutocomplete,
|
|
5933
|
+
gt as BaiduCircle,
|
|
5934
|
+
st as BaiduControl,
|
|
5935
|
+
_t as BaiduInfoBoxOverlay,
|
|
5936
|
+
yt as BaiduInfoWindow,
|
|
5937
|
+
ot as BaiduMapTypeControl,
|
|
5938
|
+
Se as BaiduMapUrls,
|
|
5939
|
+
Oe as BaiduMarker,
|
|
5940
|
+
_i as BaiduMarkerClusterer,
|
|
5941
|
+
We as BaiduOverlay,
|
|
5942
|
+
Ti as BaiduPlacesService,
|
|
5943
|
+
Ct as BaiduPolyShape,
|
|
5944
|
+
Lt as BaiduPolygon,
|
|
5945
|
+
wt as BaiduPolyline,
|
|
5946
|
+
Pt as BaiduRectangle,
|
|
5947
|
+
at as BaiduScaleControl,
|
|
5948
|
+
Ci as BaiduSearchBox,
|
|
5949
|
+
ht as BaiduZoomControl,
|
|
5877
5950
|
B as BuildInMapType,
|
|
5878
|
-
|
|
5879
|
-
|
|
5951
|
+
ir as BuildInMapTypeId,
|
|
5952
|
+
me as CachedValue,
|
|
5880
5953
|
k as ControlPosition,
|
|
5881
|
-
|
|
5882
|
-
|
|
5883
|
-
|
|
5884
|
-
|
|
5885
|
-
|
|
5886
|
-
|
|
5887
|
-
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
|
|
5897
|
-
Et as
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
|
|
5901
|
-
|
|
5902
|
-
|
|
5903
|
-
|
|
5904
|
-
|
|
5954
|
+
R as ControlPositionConverter,
|
|
5955
|
+
S as CoordType,
|
|
5956
|
+
li as CustomControl,
|
|
5957
|
+
ai as FastFindValues,
|
|
5958
|
+
pi as GoogleAutocomplete,
|
|
5959
|
+
mt as GoogleCircle,
|
|
5960
|
+
nt as GoogleControl,
|
|
5961
|
+
bt as GoogleInfoBoxOverlay,
|
|
5962
|
+
vt as GoogleInfoWindow,
|
|
5963
|
+
Pe as GoogleMapTypeControl,
|
|
5964
|
+
ke as GoogleMapUrls,
|
|
5965
|
+
Ot as GoogleMarker,
|
|
5966
|
+
bi as GoogleMarkerClusterer,
|
|
5967
|
+
pt as GoogleOverlay,
|
|
5968
|
+
Mi as GooglePlacesService,
|
|
5969
|
+
xt as GooglePolygon,
|
|
5970
|
+
Et as GooglePolyline,
|
|
5971
|
+
kt as GoogleRectangle,
|
|
5972
|
+
lt as GoogleScaleControl,
|
|
5973
|
+
Oi as GoogleSearchBox,
|
|
5974
|
+
ct as GoogleZoomControl,
|
|
5975
|
+
$e as Icon,
|
|
5976
|
+
zs as ImageMapType,
|
|
5977
|
+
ft as InfoWindow,
|
|
5978
|
+
Dt as KeyValue,
|
|
5905
5979
|
y as LatLng,
|
|
5906
5980
|
I as LatLngBounds,
|
|
5907
|
-
|
|
5908
|
-
|
|
5909
|
-
Ce as
|
|
5910
|
-
|
|
5911
|
-
|
|
5981
|
+
qs as LifecycleLogPlugin,
|
|
5982
|
+
Y as Location,
|
|
5983
|
+
Ce as MIXIN_HOOK_CREATE,
|
|
5984
|
+
we as MIXIN_HOOK_DESTROY,
|
|
5985
|
+
St as MIXIN_MAP_NAME,
|
|
5986
|
+
he as MVCArrays,
|
|
5912
5987
|
P as MapMixin,
|
|
5913
|
-
|
|
5914
|
-
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
|
|
5918
|
-
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
|
|
5929
|
-
|
|
5930
|
-
|
|
5931
|
-
|
|
5932
|
-
|
|
5933
|
-
|
|
5934
|
-
|
|
5935
|
-
|
|
5936
|
-
|
|
5937
|
-
|
|
5938
|
-
|
|
5939
|
-
|
|
5940
|
-
|
|
5941
|
-
|
|
5942
|
-
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
|
|
5946
|
-
|
|
5947
|
-
|
|
5948
|
-
|
|
5949
|
-
|
|
5950
|
-
|
|
5951
|
-
|
|
5952
|
-
|
|
5953
|
-
|
|
5954
|
-
|
|
5955
|
-
|
|
5988
|
+
A as MapType,
|
|
5989
|
+
sr as MapTypeControlType,
|
|
5990
|
+
hr as MapUrls,
|
|
5991
|
+
wi as MapZoom,
|
|
5992
|
+
mr as MarkerClusterer,
|
|
5993
|
+
_e as Objects,
|
|
5994
|
+
_r as Overlay,
|
|
5995
|
+
fr as PlacesService,
|
|
5996
|
+
K as Point,
|
|
5997
|
+
yr as SearchBox,
|
|
5998
|
+
Ys as SphericalUtils,
|
|
5999
|
+
be as Strings,
|
|
6000
|
+
De as SymbolIcon,
|
|
6001
|
+
Ws as SymbolPath,
|
|
6002
|
+
ns as TgCircle,
|
|
6003
|
+
Xi as TgCustomControl,
|
|
6004
|
+
hs as TgElementOverlay,
|
|
6005
|
+
gs as TgInfoBox,
|
|
6006
|
+
ys as TgInfoWindow,
|
|
6007
|
+
bs as TgLabel,
|
|
6008
|
+
Or as TgMap,
|
|
6009
|
+
tt as TgMapFactory,
|
|
6010
|
+
N as TgMapType,
|
|
6011
|
+
Ji as TgMapTypeControl,
|
|
6012
|
+
qi as TgMapWidget,
|
|
6013
|
+
je as TgMarker,
|
|
6014
|
+
wr as TgMarkerClusterer,
|
|
6015
|
+
Ms as TgPolygon,
|
|
6016
|
+
Ts as TgPolyline,
|
|
6017
|
+
Os as TgRectangle,
|
|
6018
|
+
Qi as TgScaleControl,
|
|
6019
|
+
ss as TgTrafficLayer,
|
|
6020
|
+
ts as TgZoomControl,
|
|
6021
|
+
hi as TrafficLayer,
|
|
6022
|
+
Re as UnionIcon,
|
|
6023
|
+
ne as assert,
|
|
6024
|
+
Xe as assertNever,
|
|
6025
|
+
xe as callHook,
|
|
6026
|
+
Hs as computedSaveOnThis,
|
|
6027
|
+
Tr as createEmptyVNode,
|
|
6028
|
+
Zi as createPropertyObject,
|
|
6029
|
+
js as createPropertyObjectTyped,
|
|
6030
|
+
$s as debug,
|
|
6031
|
+
Ks as default,
|
|
5956
6032
|
L as eventProp,
|
|
5957
|
-
|
|
5958
|
-
|
|
5959
|
-
|
|
5960
|
-
|
|
5961
|
-
|
|
5962
|
-
|
|
5963
|
-
|
|
5964
|
-
|
|
6033
|
+
Fs as extractVNodeFromSlotsByComponent,
|
|
6034
|
+
Vs as findByComponentType,
|
|
6035
|
+
Ls as getDestination,
|
|
6036
|
+
Jt as getTgMapConfig,
|
|
6037
|
+
Ds as isDef,
|
|
6038
|
+
qt as isEntryValueDef,
|
|
6039
|
+
Bs as isInstanceOf,
|
|
6040
|
+
Ss as lateinit,
|
|
6041
|
+
ye as noop,
|
|
5965
6042
|
m as optionalProp,
|
|
5966
|
-
|
|
5967
|
-
|
|
5968
|
-
|
|
5969
|
-
|
|
5970
|
-
|
|
5971
|
-
|
|
5972
|
-
|
|
5973
|
-
|
|
5974
|
-
|
|
5975
|
-
|
|
5976
|
-
|
|
5977
|
-
|
|
5978
|
-
|
|
5979
|
-
|
|
5980
|
-
|
|
5981
|
-
|
|
6043
|
+
ki as path,
|
|
6044
|
+
$ as requiredProp,
|
|
6045
|
+
Is as safeAs,
|
|
6046
|
+
Ee as safeAsComponent,
|
|
6047
|
+
si as setTgMapConfig,
|
|
6048
|
+
Wi as splitAttrs,
|
|
6049
|
+
G as stringEnumProp,
|
|
6050
|
+
Gi as stringUnionPropFromValues,
|
|
6051
|
+
C as throwError,
|
|
6052
|
+
it as throwUnsupported,
|
|
6053
|
+
Rs as todo,
|
|
6054
|
+
Je as typed,
|
|
6055
|
+
As as unwrapStringEnumValue,
|
|
6056
|
+
Us as useEventLogMethods,
|
|
6057
|
+
U as useSplittedAttrs,
|
|
6058
|
+
es as useTgMapInner
|
|
5982
6059
|
};
|
|
5983
6060
|
//# sourceMappingURL=tg-map.js.map
|