tg-map-vue3 3.2.2 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/components/TgMap.vue.d.ts +34 -22
- package/dist/src/components/TgMapWidget.vue.d.ts +1 -1
- package/dist/src/components/controls/TgCustomControl.vue.d.ts +2 -2
- package/dist/src/components/controls/TgMapTypeControl.vue.d.ts +2 -2
- package/dist/src/components/controls/TgScaleControl.vue.d.ts +2 -2
- package/dist/src/components/controls/TgZoomControl.vue.d.ts +1 -1
- package/dist/src/components/extra/TgMarkerClusterer.vue.d.ts +2 -2
- package/dist/src/components/index.d.ts +1 -1
- package/dist/src/components/layers/TgTrafficLayer.vue.d.ts +1 -1
- package/dist/src/components/map-mixin.d.ts +1 -1
- package/dist/src/components/overlays/TgCircle.vue.d.ts +2 -2
- package/dist/src/components/overlays/TgElementOverlay.vue.d.ts +2 -2
- package/dist/src/components/overlays/TgInfoBox.vue.d.ts +4 -4
- package/dist/src/components/overlays/TgInfoWindow.vue.d.ts +2 -2
- package/dist/src/components/overlays/TgLabel.vue.d.ts +2 -2
- package/dist/src/components/overlays/TgMarker.vue.d.ts +56 -18
- package/dist/src/components/overlays/TgPolygon.vue.d.ts +2 -2
- package/dist/src/components/overlays/TgPolyline.vue.d.ts +2 -2
- package/dist/tg-map.js +429 -436
- 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 +21 -13
package/dist/tg-map.js
CHANGED
|
@@ -1,28 +1,25 @@
|
|
|
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)}.tg-map{height:100vh;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}.element-overlay{position:absolute}.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 p = (i, e, t) => (
|
|
5
|
-
import { createCommentVNode as Ge, computed as St, defineComponent as x, markRaw as
|
|
6
|
-
function
|
|
2
|
+
var pr = Object.defineProperty;
|
|
3
|
+
var ur = (i, e, t) => e in i ? pr(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
4
|
+
var p = (i, e, t) => (ur(i, typeof e != "symbol" ? e + "" : e, t), t);
|
|
5
|
+
import { createCommentVNode as Ge, computed as St, defineComponent as x, markRaw as gr, openBlock as Z, createElementBlock as W, mergeProps as le, createElementVNode as mr, normalizeClass as Se, renderSlot as R, normalizeStyle as fr, getCurrentInstance as yr, inject as vr, onMounted as _r, onBeforeUnmount as Mr, watch as br, withDirectives as Tr, vShow as Or } from "vue";
|
|
6
|
+
function U(i, e, t) {
|
|
7
7
|
Object.keys(i).forEach((r) => {
|
|
8
8
|
r.startsWith("update:") || t != null && t.includes(r) || e.addEventListener(r, i[r]);
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
|
-
let
|
|
12
|
-
function
|
|
13
|
-
return
|
|
11
|
+
let wr = 1;
|
|
12
|
+
function Cr() {
|
|
13
|
+
return wr++;
|
|
14
14
|
}
|
|
15
15
|
function we(i, e) {
|
|
16
|
-
return e.__id__ || (e.__id__ =
|
|
16
|
+
return e.__id__ || (e.__id__ = Cr()), `${i}::${e.__id__}`;
|
|
17
17
|
}
|
|
18
|
-
var At = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
V = i;
|
|
24
|
-
}
|
|
25
|
-
};
|
|
18
|
+
var At = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
19
|
+
function Ue(i) {
|
|
20
|
+
return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
|
|
21
|
+
}
|
|
22
|
+
var $t = { exports: {} };
|
|
26
23
|
(function(i) {
|
|
27
24
|
(function(e, t) {
|
|
28
25
|
i.exports ? i.exports = t() : e.coordtransform = t();
|
|
@@ -61,8 +58,8 @@ var At = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
61
58
|
return !1;
|
|
62
59
|
}
|
|
63
60
|
function l(g, m) {
|
|
64
|
-
var v = g - 65e-4, O = m - 6e-3, E = Math.sqrt(v * v + O * O) - 2e-5 * Math.sin(O * e), w = Math.atan2(O, v) - 3e-6 * Math.cos(v * e), q = E * Math.cos(w),
|
|
65
|
-
return [q,
|
|
61
|
+
var v = g - 65e-4, O = m - 6e-3, E = Math.sqrt(v * v + O * O) - 2e-5 * Math.sin(O * e), w = Math.atan2(O, v) - 3e-6 * Math.cos(v * e), q = E * Math.cos(w), te = E * Math.sin(w);
|
|
62
|
+
return [q, te];
|
|
66
63
|
}
|
|
67
64
|
function h(g, m) {
|
|
68
65
|
var v = Math.sqrt(g * g + m * m) + 2e-5 * Math.sin(m * e), O = Math.atan2(m, g) + 3e-6 * Math.cos(g * e), E = v * Math.cos(O) + 65e-4, w = v * Math.sin(O) + 6e-3;
|
|
@@ -82,8 +79,8 @@ var At = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
82
79
|
w = 1 - s * w * w;
|
|
83
80
|
var q = Math.sqrt(w);
|
|
84
81
|
v = v * 180 / (r * (1 - s) / (w * q) * t), O = O * 180 / (r / q * Math.cos(E) * t);
|
|
85
|
-
var
|
|
86
|
-
return [$e,
|
|
82
|
+
var te = m + v, $e = g + O;
|
|
83
|
+
return [$e, te];
|
|
87
84
|
}
|
|
88
85
|
function b(g, m) {
|
|
89
86
|
var v = -100 + 2 * g + 3 * m + 0.2 * m * m + 0.1 * g * m + 0.2 * Math.sqrt(Math.abs(g));
|
|
@@ -118,7 +115,9 @@ var At = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
118
115
|
}
|
|
119
116
|
};
|
|
120
117
|
});
|
|
121
|
-
})(
|
|
118
|
+
})($t);
|
|
119
|
+
var xr = $t.exports;
|
|
120
|
+
const re = /* @__PURE__ */ Ue(xr);
|
|
122
121
|
function se(i, e) {
|
|
123
122
|
if (!i)
|
|
124
123
|
throw new Error(`AssertionError: ${e}`);
|
|
@@ -129,21 +128,21 @@ function Ze(i) {
|
|
|
129
128
|
function C(i) {
|
|
130
129
|
throw new Error(i);
|
|
131
130
|
}
|
|
132
|
-
function
|
|
131
|
+
function Rt(i) {
|
|
133
132
|
throw new Error(`Unsupported: ${i}`);
|
|
134
133
|
}
|
|
135
|
-
function
|
|
134
|
+
function rs(i) {
|
|
136
135
|
throw new Error(`todo: ${i}`);
|
|
137
136
|
}
|
|
138
|
-
function
|
|
137
|
+
function is(i) {
|
|
139
138
|
return i;
|
|
140
139
|
}
|
|
141
140
|
function ue(...i) {
|
|
142
141
|
}
|
|
143
|
-
function
|
|
142
|
+
function ss(i) {
|
|
144
143
|
return i != null;
|
|
145
144
|
}
|
|
146
|
-
var
|
|
145
|
+
var J = /* @__PURE__ */ ((i) => (i.wgs84 = "wgs84", i.gcj02 = "gcj02", i.bd09 = "bd09", i))(J || {});
|
|
147
146
|
const ze = "wgs84", A = class {
|
|
148
147
|
constructor(e, t, r) {
|
|
149
148
|
this.lat = e, this.lng = t, this.coord = r;
|
|
@@ -197,11 +196,11 @@ const ze = "wgs84", A = class {
|
|
|
197
196
|
convert(e) {
|
|
198
197
|
switch (this.coord) {
|
|
199
198
|
case "bd09":
|
|
200
|
-
return e === "gcj02" ?
|
|
199
|
+
return e === "gcj02" ? re.bd09ToGcj02(this.lng, this.lat) : re.bd09ToWgs84(this.lng, this.lat);
|
|
201
200
|
case "gcj02":
|
|
202
|
-
return e === "wgs84" ?
|
|
201
|
+
return e === "wgs84" ? re.gcj02ToWgs84(this.lng, this.lat) : re.gcj02ToBd09(this.lng, this.lat);
|
|
203
202
|
case "wgs84":
|
|
204
|
-
return e === "bd09" ?
|
|
203
|
+
return e === "bd09" ? re.wgs84ToBd09(this.lng, this.lat) : re.wgs84ToGcj02(this.lng, this.lat);
|
|
205
204
|
}
|
|
206
205
|
throw new Error(`不支持的坐标转换: ${this.coord}=>${e}`);
|
|
207
206
|
}
|
|
@@ -214,7 +213,7 @@ const ze = "wgs84", A = class {
|
|
|
214
213
|
};
|
|
215
214
|
let y = A;
|
|
216
215
|
p(y, "ZERO", A.create(0, 0));
|
|
217
|
-
const
|
|
216
|
+
const X = class {
|
|
218
217
|
/**
|
|
219
218
|
* 不推荐直接创建LatLngBounds, sw和ne的大小关系可能没法保证, 推荐用LatLngBounds.Builder或者LatLngBounds.from等静态方法来创建
|
|
220
219
|
* @param sw 西南, lat/lng更小
|
|
@@ -230,7 +229,7 @@ const J = class {
|
|
|
230
229
|
static fromArray(e) {
|
|
231
230
|
if (e.length === 0)
|
|
232
231
|
return;
|
|
233
|
-
const t = new
|
|
232
|
+
const t = new X.Builder(e[0]);
|
|
234
233
|
for (let r = 1; r < e.length; r++)
|
|
235
234
|
t.include(e[r]);
|
|
236
235
|
return t.build();
|
|
@@ -239,13 +238,13 @@ const J = class {
|
|
|
239
238
|
return this.fromArray(e) ?? C("positions中没有点");
|
|
240
239
|
}
|
|
241
240
|
static fromGoogle(e, t) {
|
|
242
|
-
return new
|
|
241
|
+
return new X(
|
|
243
242
|
y.fromGoogle(e.getSouthWest(), t),
|
|
244
243
|
y.fromGoogle(e.getNorthEast(), t)
|
|
245
244
|
);
|
|
246
245
|
}
|
|
247
246
|
static fromBaidu(e, t) {
|
|
248
|
-
return new
|
|
247
|
+
return new X(
|
|
249
248
|
y.fromBaidu(e.getSouthWest(), t),
|
|
250
249
|
y.fromBaidu(e.getNorthEast(), t)
|
|
251
250
|
);
|
|
@@ -258,7 +257,7 @@ const J = class {
|
|
|
258
257
|
}
|
|
259
258
|
contains(e) {
|
|
260
259
|
const { lat: t, lng: r } = e.to(this.coord);
|
|
261
|
-
return this.sw.lat <= t && t <= this.ne.lat &&
|
|
260
|
+
return this.sw.lat <= t && t <= this.ne.lat && X.isBetweenLng(this.sw.lng, this.ne.lng, r);
|
|
262
261
|
}
|
|
263
262
|
getCenter() {
|
|
264
263
|
const e = (this.sw.lat + this.ne.lat) / 2, t = (this.sw.lng + this.ne.lng + (this.sw.lng < this.ne.lng ? 0 : 360)) / 2;
|
|
@@ -280,8 +279,8 @@ const J = class {
|
|
|
280
279
|
return [this.sw.toBaidu(e), this.ne.toBaidu(e)];
|
|
281
280
|
}
|
|
282
281
|
};
|
|
283
|
-
let
|
|
284
|
-
p(
|
|
282
|
+
let V = X;
|
|
283
|
+
p(V, "EMPTY", new X(y.ZERO, y.ZERO));
|
|
285
284
|
((i) => {
|
|
286
285
|
class e {
|
|
287
286
|
constructor(r) {
|
|
@@ -309,68 +308,68 @@ p(F, "EMPTY", new J(y.ZERO, y.ZERO));
|
|
|
309
308
|
}
|
|
310
309
|
}
|
|
311
310
|
i.Builder = e;
|
|
312
|
-
})(
|
|
313
|
-
var
|
|
314
|
-
return
|
|
311
|
+
})(V || (V = {}));
|
|
312
|
+
var Er = function(e) {
|
|
313
|
+
return Lr(e) && !kr(e);
|
|
315
314
|
};
|
|
316
|
-
function
|
|
315
|
+
function Lr(i) {
|
|
317
316
|
return !!i && typeof i == "object";
|
|
318
317
|
}
|
|
319
|
-
function
|
|
318
|
+
function kr(i) {
|
|
320
319
|
var e = Object.prototype.toString.call(i);
|
|
321
|
-
return e === "[object RegExp]" || e === "[object Date]" ||
|
|
320
|
+
return e === "[object RegExp]" || e === "[object Date]" || Br(i);
|
|
322
321
|
}
|
|
323
|
-
var
|
|
324
|
-
function
|
|
325
|
-
return i.$$typeof ===
|
|
322
|
+
var Pr = typeof Symbol == "function" && Symbol.for, Ir = Pr ? Symbol.for("react.element") : 60103;
|
|
323
|
+
function Br(i) {
|
|
324
|
+
return i.$$typeof === Ir;
|
|
326
325
|
}
|
|
327
|
-
function
|
|
326
|
+
function Sr(i) {
|
|
328
327
|
return Array.isArray(i) ? [] : {};
|
|
329
328
|
}
|
|
330
329
|
function ge(i, e) {
|
|
331
|
-
return e.clone !== !1 && e.isMergeableObject(i) ? oe(
|
|
330
|
+
return e.clone !== !1 && e.isMergeableObject(i) ? oe(Sr(i), i, e) : i;
|
|
332
331
|
}
|
|
333
|
-
function
|
|
332
|
+
function Ar(i, e, t) {
|
|
334
333
|
return i.concat(e).map(function(r) {
|
|
335
334
|
return ge(r, t);
|
|
336
335
|
});
|
|
337
336
|
}
|
|
338
|
-
function
|
|
337
|
+
function $r(i, e) {
|
|
339
338
|
if (!e.customMerge)
|
|
340
339
|
return oe;
|
|
341
340
|
var t = e.customMerge(i);
|
|
342
341
|
return typeof t == "function" ? t : oe;
|
|
343
342
|
}
|
|
344
|
-
function
|
|
343
|
+
function Rr(i) {
|
|
345
344
|
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(i).filter(function(e) {
|
|
346
345
|
return Object.propertyIsEnumerable.call(i, e);
|
|
347
346
|
}) : [];
|
|
348
347
|
}
|
|
349
348
|
function Ot(i) {
|
|
350
|
-
return Object.keys(i).concat(
|
|
349
|
+
return Object.keys(i).concat(Rr(i));
|
|
351
350
|
}
|
|
352
|
-
function
|
|
351
|
+
function zt(i, e) {
|
|
353
352
|
try {
|
|
354
353
|
return e in i;
|
|
355
354
|
} catch {
|
|
356
355
|
return !1;
|
|
357
356
|
}
|
|
358
357
|
}
|
|
359
|
-
function
|
|
360
|
-
return
|
|
358
|
+
function zr(i, e) {
|
|
359
|
+
return zt(i, e) && !(Object.hasOwnProperty.call(i, e) && Object.propertyIsEnumerable.call(i, e));
|
|
361
360
|
}
|
|
362
|
-
function
|
|
361
|
+
function Nr(i, e, t) {
|
|
363
362
|
var r = {};
|
|
364
363
|
return t.isMergeableObject(i) && Ot(i).forEach(function(s) {
|
|
365
364
|
r[s] = ge(i[s], t);
|
|
366
365
|
}), Ot(e).forEach(function(s) {
|
|
367
|
-
|
|
366
|
+
zr(i, s) || (zt(i, s) && t.isMergeableObject(e[s]) ? r[s] = $r(s, t)(i[s], e[s], t) : r[s] = ge(e[s], t));
|
|
368
367
|
}), r;
|
|
369
368
|
}
|
|
370
369
|
function oe(i, e, t) {
|
|
371
|
-
t = t || {}, t.arrayMerge = t.arrayMerge ||
|
|
370
|
+
t = t || {}, t.arrayMerge = t.arrayMerge || Ar, t.isMergeableObject = t.isMergeableObject || Er, t.cloneUnlessOtherwiseSpecified = ge;
|
|
372
371
|
var r = Array.isArray(e), s = Array.isArray(i), n = r === s;
|
|
373
|
-
return n ? r ? t.arrayMerge(i, e, t) :
|
|
372
|
+
return n ? r ? t.arrayMerge(i, e, t) : Nr(i, e, t) : ge(e, t);
|
|
374
373
|
}
|
|
375
374
|
oe.all = function(e, t) {
|
|
376
375
|
if (!Array.isArray(e))
|
|
@@ -379,32 +378,32 @@ oe.all = function(e, t) {
|
|
|
379
378
|
return oe(r, s, t);
|
|
380
379
|
}, {});
|
|
381
380
|
};
|
|
382
|
-
var
|
|
383
|
-
const Ce = ["3.0"],
|
|
381
|
+
var Dr = oe, Gr = Dr;
|
|
382
|
+
const Nt = /* @__PURE__ */ Ue(Gr), Ce = ["3.0"], Zr = {
|
|
384
383
|
baidu: {
|
|
385
384
|
version: "3.0",
|
|
386
385
|
// 在build时会被静态替换, 导致使用者不能无法设置它
|
|
387
386
|
// @see https://cn.vitejs.dev/guide/build.html#library-mode:~:text=%E6%A8%A1%E5%BC%8F%E4%B8%8B%EF%BC%8C%E6%89%80%E6%9C%89-,({}).*,-%E7%94%A8%E6%B3%95%E5%9C%A8%E6%9E%84
|
|
388
387
|
// @see @vite_process_env_detail
|
|
389
|
-
key:
|
|
388
|
+
key: ""
|
|
390
389
|
},
|
|
391
390
|
google: {
|
|
392
391
|
version: "quarterly",
|
|
393
|
-
key:
|
|
392
|
+
key: "",
|
|
394
393
|
language: "en-us",
|
|
395
394
|
libraries: ["places"]
|
|
396
395
|
},
|
|
397
396
|
here: {
|
|
398
397
|
version: Ce[0],
|
|
399
|
-
key:
|
|
398
|
+
key: ""
|
|
400
399
|
}
|
|
401
400
|
};
|
|
402
|
-
let
|
|
403
|
-
function
|
|
404
|
-
return
|
|
401
|
+
let Dt;
|
|
402
|
+
function Gt() {
|
|
403
|
+
return Dt || C("请先安装: Vue<PartialTgMapConfig>.use(TgMap, {})");
|
|
405
404
|
}
|
|
406
|
-
function
|
|
407
|
-
i != null && (
|
|
405
|
+
function Wr(i) {
|
|
406
|
+
i != null && (Dt = Nt(Zr, i));
|
|
408
407
|
}
|
|
409
408
|
var We;
|
|
410
409
|
((i) => {
|
|
@@ -445,15 +444,15 @@ var Ee;
|
|
|
445
444
|
}
|
|
446
445
|
i.remove = t;
|
|
447
446
|
})(Ee || (Ee = {}));
|
|
448
|
-
function
|
|
447
|
+
function ns() {
|
|
449
448
|
}
|
|
450
449
|
function je(i) {
|
|
451
450
|
return i;
|
|
452
451
|
}
|
|
453
|
-
function
|
|
452
|
+
function os(i, e) {
|
|
454
453
|
return i instanceof e;
|
|
455
454
|
}
|
|
456
|
-
function
|
|
455
|
+
function as(i, e) {
|
|
457
456
|
if (i instanceof e)
|
|
458
457
|
return i;
|
|
459
458
|
}
|
|
@@ -461,22 +460,22 @@ function Me(i, e) {
|
|
|
461
460
|
if ((i == null ? void 0 : i.$options.name) === e.name)
|
|
462
461
|
return i;
|
|
463
462
|
}
|
|
464
|
-
function
|
|
463
|
+
function ls(i) {
|
|
465
464
|
return i;
|
|
466
465
|
}
|
|
467
|
-
function
|
|
466
|
+
function Zt(i, e, t) {
|
|
468
467
|
return i.addListener(e, t).remove;
|
|
469
468
|
}
|
|
470
|
-
function
|
|
469
|
+
function jr(i, e, t) {
|
|
471
470
|
return i.addEventListener(e, t), () => i.removeEventListener(e, t);
|
|
472
471
|
}
|
|
473
|
-
function
|
|
472
|
+
function Vr(i, e, t, r) {
|
|
474
473
|
return i.addEventListener(e, t, r), () => i.removeEventListener(e, t, r);
|
|
475
474
|
}
|
|
476
475
|
function wt(i, e, t) {
|
|
477
476
|
return i.addEventListener(e, t), () => i.removeEventListener(e, t);
|
|
478
477
|
}
|
|
479
|
-
class
|
|
478
|
+
class Wt {
|
|
480
479
|
constructor(e, t) {
|
|
481
480
|
p(this, "eventMap", /* @__PURE__ */ new Map());
|
|
482
481
|
p(this, "target", void 0);
|
|
@@ -486,7 +485,7 @@ class Zt {
|
|
|
486
485
|
return this.target = e, this;
|
|
487
486
|
}
|
|
488
487
|
}
|
|
489
|
-
const Tt = class extends
|
|
488
|
+
const Tt = class extends Wt {
|
|
490
489
|
addEventListener(e, t) {
|
|
491
490
|
const r = we(e, t);
|
|
492
491
|
if (this.eventMap.get(r)) {
|
|
@@ -508,9 +507,9 @@ const Tt = class extends Zt {
|
|
|
508
507
|
s ? (s.remove(), this.eventMap.delete(r)) : console.warn("移除失败, 不存在该listener", r, t);
|
|
509
508
|
}
|
|
510
509
|
};
|
|
511
|
-
let
|
|
510
|
+
let Q = Tt;
|
|
512
511
|
// 事件类型映射: tg => google
|
|
513
|
-
p(
|
|
512
|
+
p(Q, "EVENT_TYPE_MAP", {
|
|
514
513
|
"center-changed": "center_changed",
|
|
515
514
|
"zoom-changed": "zoom_changed",
|
|
516
515
|
"map-type-changed": "maptypeid_changed",
|
|
@@ -521,7 +520,7 @@ p(ee, "EVENT_TYPE_MAP", {
|
|
|
521
520
|
"map-mouseup": "mouseup",
|
|
522
521
|
"map-dblclick": "dblclick"
|
|
523
522
|
});
|
|
524
|
-
const Be = class extends
|
|
523
|
+
const Be = class extends Wt {
|
|
525
524
|
addEventListener(e, t) {
|
|
526
525
|
const r = we(e, t);
|
|
527
526
|
if (this.eventMap.get(r)) {
|
|
@@ -552,7 +551,7 @@ p(ne, "EVENT_TYPE_MAP", {
|
|
|
552
551
|
"zoom-changed": "zoomend",
|
|
553
552
|
"map-type-changed": "maptypechange"
|
|
554
553
|
});
|
|
555
|
-
class
|
|
554
|
+
class Hr {
|
|
556
555
|
constructor() {
|
|
557
556
|
p(this, "typeMap", /* @__PURE__ */ new Map());
|
|
558
557
|
}
|
|
@@ -591,7 +590,7 @@ class Ct {
|
|
|
591
590
|
return this.keyToValue.get(e) ?? C();
|
|
592
591
|
}
|
|
593
592
|
}
|
|
594
|
-
class
|
|
593
|
+
class Fr {
|
|
595
594
|
constructor(e, t = 10) {
|
|
596
595
|
p(this, "map", /* @__PURE__ */ new Map());
|
|
597
596
|
this.values = e, this.maxSize4Debug = t;
|
|
@@ -629,7 +628,7 @@ class xt {
|
|
|
629
628
|
return this.value === void 0 && (this.value = this.creator()), this.value;
|
|
630
629
|
}
|
|
631
630
|
}
|
|
632
|
-
var
|
|
631
|
+
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 || {}), B;
|
|
633
632
|
((i) => {
|
|
634
633
|
let e, t;
|
|
635
634
|
const r = [
|
|
@@ -695,16 +694,16 @@ var P = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
|
|
|
695
694
|
}
|
|
696
695
|
i.getGoogle = n;
|
|
697
696
|
})(B || (B = {}));
|
|
698
|
-
class
|
|
697
|
+
class Ur {
|
|
699
698
|
constructor(e) {
|
|
700
699
|
/** 实际添加到地图中的control对象 */
|
|
701
700
|
p(this, "inner");
|
|
702
701
|
this.position = e;
|
|
703
702
|
}
|
|
704
703
|
}
|
|
705
|
-
class
|
|
704
|
+
class jt {
|
|
706
705
|
}
|
|
707
|
-
class Ye extends
|
|
706
|
+
class Ye extends jt {
|
|
708
707
|
constructor(e, t) {
|
|
709
708
|
super(), this.inner = e, this.position = t;
|
|
710
709
|
}
|
|
@@ -727,7 +726,7 @@ class Ye extends Wt {
|
|
|
727
726
|
e.innerMap.removeControl(this.inner);
|
|
728
727
|
}
|
|
729
728
|
}
|
|
730
|
-
class
|
|
729
|
+
class qe extends jt {
|
|
731
730
|
constructor(t, r) {
|
|
732
731
|
super();
|
|
733
732
|
p(this, "visible", !1);
|
|
@@ -764,8 +763,8 @@ class Ke extends Wt {
|
|
|
764
763
|
});
|
|
765
764
|
}
|
|
766
765
|
}
|
|
767
|
-
var
|
|
768
|
-
class
|
|
766
|
+
var Vt = /* @__PURE__ */ ((i) => (i.normal = "normal", i.satellite = "satellite", i.hybrid = "hybrid", i))(Vt || {});
|
|
767
|
+
class P {
|
|
769
768
|
constructor(e, t, r, s) {
|
|
770
769
|
this.id = e, this.baidu = t, this.google = r, this.googleCoordType = s;
|
|
771
770
|
}
|
|
@@ -773,7 +772,7 @@ class k {
|
|
|
773
772
|
return this.id;
|
|
774
773
|
}
|
|
775
774
|
getBaiduCoordType() {
|
|
776
|
-
return
|
|
775
|
+
return J.bd09;
|
|
777
776
|
}
|
|
778
777
|
asBaiduMapType() {
|
|
779
778
|
return this.baidu();
|
|
@@ -786,10 +785,10 @@ class k {
|
|
|
786
785
|
return this.google();
|
|
787
786
|
}
|
|
788
787
|
asGoogleMapType() {
|
|
789
|
-
|
|
788
|
+
Rt("google的内置地图没有对应的实例");
|
|
790
789
|
}
|
|
791
790
|
}
|
|
792
|
-
class
|
|
791
|
+
class Yr {
|
|
793
792
|
constructor() {
|
|
794
793
|
p(this, "baiduCache", new xt(() => new BMap.TrafficLayer()));
|
|
795
794
|
p(this, "googleCache", new xt(() => new google.maps.TrafficLayer()));
|
|
@@ -803,19 +802,19 @@ class Hr {
|
|
|
803
802
|
}
|
|
804
803
|
var I;
|
|
805
804
|
((i) => {
|
|
806
|
-
i.NORMAL = new
|
|
805
|
+
i.NORMAL = new P("normal", () => BMAP_NORMAL_MAP, () => google.maps.MapTypeId.ROADMAP, J.gcj02), i.SATELLITE = new P("satellite", () => BMAP_SATELLITE_MAP, () => google.maps.MapTypeId.SATELLITE, J.wgs84), i.HYBRID = new P("hybrid", () => BMAP_HYBRID_MAP, () => google.maps.MapTypeId.HYBRID, J.gcj02), i.TERRAIN = new P("terrain", () => (
|
|
807
806
|
/* 三维 */
|
|
808
807
|
BMAP_PERSPECTIVE_MAP
|
|
809
808
|
), () => (
|
|
810
809
|
/* 地形 */
|
|
811
810
|
google.maps.MapTypeId.TERRAIN
|
|
812
|
-
),
|
|
811
|
+
), J.wgs84), i.BUILD_IN_MAP_TYPES = new Fr([i.NORMAL, i.SATELLITE, i.HYBRID, i.TERRAIN]);
|
|
813
812
|
})(I || (I = {}));
|
|
814
|
-
var
|
|
815
|
-
const
|
|
816
|
-
class
|
|
813
|
+
var Ht = /* @__PURE__ */ ((i) => (i.DEFAULT = "default", i.HORIZONTAL = "horizontal", i.DROPDOWN = "dropdown", i))(Ht || {});
|
|
814
|
+
const Ft = [I.NORMAL, I.SATELLITE, I.HYBRID];
|
|
815
|
+
class Ke extends Ye {
|
|
817
816
|
static create(e) {
|
|
818
|
-
const t = e.mapTypes ??
|
|
817
|
+
const t = e.mapTypes ?? Ft, r = {
|
|
819
818
|
default: BMAP_MAPTYPE_CONTROL_HORIZONTAL,
|
|
820
819
|
horizontal: BMAP_MAPTYPE_CONTROL_HORIZONTAL,
|
|
821
820
|
dropdown: BMAP_MAPTYPE_CONTROL_DROPDOWN
|
|
@@ -823,11 +822,11 @@ class qe extends Ye {
|
|
|
823
822
|
type: e.type && r[e.type],
|
|
824
823
|
mapTypes: t.map((n) => n.asBaiduMapType())
|
|
825
824
|
});
|
|
826
|
-
return e.position && s.setAnchor(B.getBaidu().toValue(e.position)), new
|
|
825
|
+
return e.position && s.setAnchor(B.getBaidu().toValue(e.position)), new Ke(s, e.position);
|
|
827
826
|
}
|
|
828
827
|
}
|
|
829
|
-
const ie = class extends
|
|
830
|
-
constructor(e = "default", t =
|
|
828
|
+
const ie = class extends qe {
|
|
829
|
+
constructor(e = "default", t = k.TOP_LEFT, r = Ft) {
|
|
831
830
|
super("mapType", t), this.type = e, this.mapTypes = r, ie.type2google || (ie.type2google = {
|
|
832
831
|
default: google.maps.MapTypeControlStyle.DEFAULT,
|
|
833
832
|
horizontal: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
|
|
@@ -839,11 +838,11 @@ const ie = class extends Ke {
|
|
|
839
838
|
}
|
|
840
839
|
onCreateOptions() {
|
|
841
840
|
const e = super.onCreateOptions();
|
|
842
|
-
return e.style = ie.type2google[this.type], e.mapTypeIds = this.mapTypes.map((t) => t instanceof
|
|
841
|
+
return e.style = ie.type2google[this.type], e.mapTypeIds = this.mapTypes.map((t) => t instanceof P ? t.getGoogleMapTypeId() : t.id), e;
|
|
843
842
|
}
|
|
844
843
|
addTo(e) {
|
|
845
844
|
super.addTo(e), this.mapTypes.forEach((t) => {
|
|
846
|
-
t instanceof
|
|
845
|
+
t instanceof P || e.innerMap.mapTypes.set(t.id, t.asGoogleMapType());
|
|
847
846
|
});
|
|
848
847
|
}
|
|
849
848
|
};
|
|
@@ -857,11 +856,11 @@ class Xe extends Ye {
|
|
|
857
856
|
return new Xe(t, e.position);
|
|
858
857
|
}
|
|
859
858
|
}
|
|
860
|
-
class Je extends
|
|
859
|
+
class Je extends qe {
|
|
861
860
|
static create(e) {
|
|
862
861
|
return new Je(e.position);
|
|
863
862
|
}
|
|
864
|
-
constructor(e =
|
|
863
|
+
constructor(e = k.BOTTOM_RIGHT) {
|
|
865
864
|
super("scale", e);
|
|
866
865
|
}
|
|
867
866
|
}
|
|
@@ -875,15 +874,15 @@ class Qe extends Ye {
|
|
|
875
874
|
return new Qe(t, e.position);
|
|
876
875
|
}
|
|
877
876
|
}
|
|
878
|
-
class et extends
|
|
877
|
+
class et extends qe {
|
|
879
878
|
static create(e) {
|
|
880
879
|
return new et(e.position);
|
|
881
880
|
}
|
|
882
|
-
constructor(e =
|
|
881
|
+
constructor(e = k.RIGHT_BOTTOM) {
|
|
883
882
|
super("zoom", e);
|
|
884
883
|
}
|
|
885
884
|
}
|
|
886
|
-
function
|
|
885
|
+
function qr(i) {
|
|
887
886
|
let e, t, r;
|
|
888
887
|
const s = "The Google Maps JavaScript API", n = "google", a = "importLibrary", c = "__ib__", o = document, l = window, h = l[n] || (l[n] = {}), d = h.maps || (h.maps = {}), u = /* @__PURE__ */ new Set(), _ = new URLSearchParams(), b = () => e || (e = new Promise(async (M, g) => {
|
|
889
888
|
var m;
|
|
@@ -895,13 +894,13 @@ function Fr(i) {
|
|
|
895
894
|
d[a] ? console.warn(s + " only loads once. Ignoring:", i) : d[a] = (M, ...g) => u.add(M) && b().then(() => d[a](M, ...g));
|
|
896
895
|
}
|
|
897
896
|
let Et;
|
|
898
|
-
const
|
|
897
|
+
const ee = {
|
|
899
898
|
/** Google的坐标0点 */
|
|
900
899
|
get LATLNG_ZERO() {
|
|
901
900
|
return Et ?? (Et = new google.maps.LatLng({ lat: 0, lng: 0 }));
|
|
902
901
|
}
|
|
903
902
|
};
|
|
904
|
-
function
|
|
903
|
+
function Ut(i, e = { country: "", province: "", city: "", district: "", street: "", streetNumber: "" }) {
|
|
905
904
|
for (const t of i)
|
|
906
905
|
for (const r of t.types)
|
|
907
906
|
switch (r) {
|
|
@@ -926,22 +925,22 @@ function Ft(i, e = { country: "", province: "", city: "", district: "", street:
|
|
|
926
925
|
}
|
|
927
926
|
return e;
|
|
928
927
|
}
|
|
929
|
-
function
|
|
928
|
+
function Yt(i, e) {
|
|
930
929
|
var r;
|
|
931
|
-
const t = i.address_components &&
|
|
930
|
+
const t = i.address_components && Ut(i.address_components);
|
|
932
931
|
return {
|
|
933
932
|
country: (t == null ? void 0 : t.country) ?? "",
|
|
934
933
|
province: (t == null ? void 0 : t.province) ?? "",
|
|
935
934
|
city: (t == null ? void 0 : t.city) ?? "",
|
|
936
935
|
id: i.place_id ?? "",
|
|
937
936
|
address: i.formatted_address ?? "",
|
|
938
|
-
position: y.fromGoogle(((r = i.geometry) == null ? void 0 : r.location) ??
|
|
937
|
+
position: y.fromGoogle(((r = i.geometry) == null ? void 0 : r.location) ?? ee.LATLNG_ZERO, e.coordType),
|
|
939
938
|
title: i.name ?? ""
|
|
940
939
|
};
|
|
941
940
|
}
|
|
942
|
-
class
|
|
941
|
+
class qt {
|
|
943
942
|
}
|
|
944
|
-
class
|
|
943
|
+
class Kr extends qt {
|
|
945
944
|
constructor(t, r) {
|
|
946
945
|
super();
|
|
947
946
|
p(this, "inner");
|
|
@@ -957,7 +956,7 @@ class Ur extends Yt {
|
|
|
957
956
|
this.inner.setBounds(t.toGoogle(this.map.coordType));
|
|
958
957
|
}
|
|
959
958
|
addResultListener(t) {
|
|
960
|
-
return
|
|
959
|
+
return Zt(this.inner, "place_changed", () => {
|
|
961
960
|
const r = this.inner.getPlace(), s = {
|
|
962
961
|
title: r.name ?? "",
|
|
963
962
|
province: "",
|
|
@@ -967,11 +966,11 @@ class Ur extends Yt {
|
|
|
967
966
|
streetNumber: "",
|
|
968
967
|
country: ""
|
|
969
968
|
};
|
|
970
|
-
r.address_components &&
|
|
969
|
+
r.address_components && Ut(r.address_components, s), t(s);
|
|
971
970
|
});
|
|
972
971
|
}
|
|
973
972
|
}
|
|
974
|
-
class
|
|
973
|
+
class Xr extends qt {
|
|
975
974
|
constructor(t, r) {
|
|
976
975
|
super();
|
|
977
976
|
p(this, "inner");
|
|
@@ -993,14 +992,14 @@ class Yr extends Yt {
|
|
|
993
992
|
}
|
|
994
993
|
addResultListener(t) {
|
|
995
994
|
let r = 0;
|
|
996
|
-
const s =
|
|
995
|
+
const s = jr(this.inner, "confirm", (a) => {
|
|
997
996
|
const c = a.item.value;
|
|
998
997
|
r = Date.now(), t(Object.assign({
|
|
999
998
|
title: c.business,
|
|
1000
999
|
country: ""
|
|
1001
1000
|
// Baidu的自动完成只支持中国
|
|
1002
1001
|
}, c));
|
|
1003
|
-
}), n =
|
|
1002
|
+
}), n = Vr(this.input, "keyup", (a) => {
|
|
1004
1003
|
a.key === "Enter" && Date.now() - r > 100 && t({
|
|
1005
1004
|
title: this.input.value,
|
|
1006
1005
|
country: "",
|
|
@@ -1016,7 +1015,7 @@ class Yr extends Yt {
|
|
|
1016
1015
|
};
|
|
1017
1016
|
}
|
|
1018
1017
|
}
|
|
1019
|
-
let
|
|
1018
|
+
let Jr = class Kt {
|
|
1020
1019
|
constructor(e, t, r) {
|
|
1021
1020
|
this.extend(Kt, google.maps.OverlayView), this.map_ = e, 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;
|
|
1022
1021
|
var s = r || {};
|
|
@@ -1437,7 +1436,7 @@ let Kr = class Kt {
|
|
|
1437
1436
|
if (r && r.isMarkerInClusterBounds(e))
|
|
1438
1437
|
r.addMarker(e);
|
|
1439
1438
|
else {
|
|
1440
|
-
var o = new
|
|
1439
|
+
var o = new Qr(this);
|
|
1441
1440
|
o.addMarker(e), this.clusters_.push(o);
|
|
1442
1441
|
}
|
|
1443
1442
|
}
|
|
@@ -1454,7 +1453,7 @@ let Kr = class Kt {
|
|
|
1454
1453
|
), t = this.getExtendedBounds(e), r = 0, s; s = this.markers_[r]; r++)
|
|
1455
1454
|
!s.isAdded && this.isMarkerInBounds_(s, t) && this.addToClosestCluster_(s);
|
|
1456
1455
|
}
|
|
1457
|
-
},
|
|
1456
|
+
}, Qr = class {
|
|
1458
1457
|
constructor(e) {
|
|
1459
1458
|
this.markerClusterer_ = e, this.map_ = e.getMap(), this.gridSize_ = e.getGridSize(), this.minClusterSize_ = e.getMinClusterSize(), this.averageCenter_ = e.isAverageCenter(), this.center_ = null, this.markers_ = [], this.bounds_ = null, this.clusterIcon_ = new tt(
|
|
1460
1459
|
this,
|
|
@@ -1723,14 +1722,7 @@ class tt {
|
|
|
1723
1722
|
), t.join("");
|
|
1724
1723
|
}
|
|
1725
1724
|
}
|
|
1726
|
-
var
|
|
1727
|
-
get exports() {
|
|
1728
|
-
return Ve;
|
|
1729
|
-
},
|
|
1730
|
-
set exports(i) {
|
|
1731
|
-
Ve = i;
|
|
1732
|
-
}
|
|
1733
|
-
};
|
|
1725
|
+
var Xt = { exports: {} };
|
|
1734
1726
|
(function(i, e) {
|
|
1735
1727
|
(function(t, r) {
|
|
1736
1728
|
i.exports = r();
|
|
@@ -1923,24 +1915,25 @@ var Ve = {}, Xr = {
|
|
|
1923
1915
|
});
|
|
1924
1916
|
}, c;
|
|
1925
1917
|
});
|
|
1926
|
-
})(
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1918
|
+
})(Xt);
|
|
1919
|
+
var ei = Xt.exports;
|
|
1920
|
+
const Lt = /* @__PURE__ */ Ue(ei);
|
|
1921
|
+
var Jt = function(i, e, t) {
|
|
1922
|
+
e = ti(e);
|
|
1930
1923
|
var r = i.pointToPixel(e.getNorthEast()), s = i.pointToPixel(e.getSouthWest());
|
|
1931
1924
|
r.x += t, r.y -= t, s.x -= t, s.y += t;
|
|
1932
1925
|
var n = i.pixelToPoint(r), a = i.pixelToPoint(s);
|
|
1933
1926
|
return new BMap.Bounds(a, n);
|
|
1934
|
-
},
|
|
1927
|
+
}, ti = function(i) {
|
|
1935
1928
|
var e = be(i.getNorthEast().lng, -180, 180), t = be(i.getSouthWest().lng, -180, 180), r = be(i.getNorthEast().lat, -74, 74), s = be(i.getSouthWest().lat, -74, 74);
|
|
1936
1929
|
return new BMap.Bounds(new BMap.Point(t, s), new BMap.Point(e, r));
|
|
1937
1930
|
}, be = function(i, e, t) {
|
|
1938
1931
|
return e && (i = Math.max(i, e)), t && (i = Math.min(i, t)), i;
|
|
1939
|
-
},
|
|
1932
|
+
}, Qt = function(i) {
|
|
1940
1933
|
return Object.prototype.toString.call(i) === "[object Array]";
|
|
1941
|
-
},
|
|
1934
|
+
}, er = function(i, e) {
|
|
1942
1935
|
var t = -1;
|
|
1943
|
-
if (
|
|
1936
|
+
if (Qt(e)) {
|
|
1944
1937
|
if (e.indexOf)
|
|
1945
1938
|
t = e.indexOf(i);
|
|
1946
1939
|
else
|
|
@@ -1968,7 +1961,7 @@ var qt = function(i, e, t) {
|
|
|
1968
1961
|
r._redraw();
|
|
1969
1962
|
});
|
|
1970
1963
|
var s = t.markers;
|
|
1971
|
-
|
|
1964
|
+
Qt(s) && this.addMarkers(s);
|
|
1972
1965
|
}
|
|
1973
1966
|
};
|
|
1974
1967
|
T.prototype.addMarkers = function(i) {
|
|
@@ -1979,7 +1972,7 @@ T.prototype.addMarkers = function(i) {
|
|
|
1979
1972
|
}
|
|
1980
1973
|
};
|
|
1981
1974
|
T.prototype._pushMarkerTo = function(i) {
|
|
1982
|
-
var e =
|
|
1975
|
+
var e = er(i, this._markers);
|
|
1983
1976
|
e === -1 && (i.isInCluster = !1, this._markers.push(i));
|
|
1984
1977
|
};
|
|
1985
1978
|
T.prototype.addMarker = function(i) {
|
|
@@ -1988,7 +1981,7 @@ T.prototype.addMarker = function(i) {
|
|
|
1988
1981
|
T.prototype._createClusters = function() {
|
|
1989
1982
|
var i = this._map.getBounds();
|
|
1990
1983
|
if (i.getCenter()) {
|
|
1991
|
-
for (var e =
|
|
1984
|
+
for (var e = Jt(this._map, i, this._gridSize), t = 0, r; r = this._markers[t]; t++)
|
|
1992
1985
|
!r.isInCluster && e.containsPoint(r.getPosition()) && this._addToClosestCluster(r);
|
|
1993
1986
|
for (var s = this._markers.length, t = 0; t < s; t++)
|
|
1994
1987
|
this._clusters[t] && this._clusters[t].render();
|
|
@@ -2028,7 +2021,7 @@ T.prototype._removeMarkersFromMap = function() {
|
|
|
2028
2021
|
}
|
|
2029
2022
|
};
|
|
2030
2023
|
T.prototype._removeMarker = function(i) {
|
|
2031
|
-
var e =
|
|
2024
|
+
var e = er(i, this._markers);
|
|
2032
2025
|
return e === -1 ? !1 : (this._map.removeOverlay(i), this._markers.splice(e, 1), !0);
|
|
2033
2026
|
};
|
|
2034
2027
|
T.prototype.removeMarker = function(i) {
|
|
@@ -2152,7 +2145,7 @@ S.prototype.isReal = function(i) {
|
|
|
2152
2145
|
};
|
|
2153
2146
|
S.prototype.updateGridBounds = function() {
|
|
2154
2147
|
var i = new BMap.Bounds(this._center, this._center);
|
|
2155
|
-
this._gridBounds =
|
|
2148
|
+
this._gridBounds = Jt(this._map, i, this._markerClusterer.getGridSize());
|
|
2156
2149
|
};
|
|
2157
2150
|
S.prototype.updateClusterMarker = function() {
|
|
2158
2151
|
if (this._map.getZoom() > this._markerClusterer.getMaxZoom()) {
|
|
@@ -2208,7 +2201,7 @@ var Le;
|
|
|
2208
2201
|
}
|
|
2209
2202
|
i.toGoogle = t;
|
|
2210
2203
|
})(Le || (Le = {}));
|
|
2211
|
-
class
|
|
2204
|
+
class tr {
|
|
2212
2205
|
constructor(e) {
|
|
2213
2206
|
p(this, "inner");
|
|
2214
2207
|
this.map = e;
|
|
@@ -2234,7 +2227,7 @@ class Qt {
|
|
|
2234
2227
|
return this.inner.removeMarkers(e.map((t) => t.innerOverlay));
|
|
2235
2228
|
}
|
|
2236
2229
|
}
|
|
2237
|
-
class
|
|
2230
|
+
class ri extends tr {
|
|
2238
2231
|
constructor(e, t) {
|
|
2239
2232
|
var s;
|
|
2240
2233
|
super(e), this.inner = new T(e.innerMap, {
|
|
@@ -2254,10 +2247,10 @@ class Qr extends Qt {
|
|
|
2254
2247
|
this.inner._redraw();
|
|
2255
2248
|
}
|
|
2256
2249
|
}
|
|
2257
|
-
class
|
|
2250
|
+
class ii extends tr {
|
|
2258
2251
|
constructor(e, t) {
|
|
2259
2252
|
var s, n;
|
|
2260
|
-
super(e), this.inner = new
|
|
2253
|
+
super(e), this.inner = new Jr(
|
|
2261
2254
|
e.innerMap,
|
|
2262
2255
|
// google的构造器中的markers,不会触发重绘, 第一次绘制通过监听地图的'idle'事件触发, 可以直接设置
|
|
2263
2256
|
(s = t.markers) == null ? void 0 : s.map((a) => a.innerOverlay),
|
|
@@ -2281,11 +2274,11 @@ class ei extends Qt {
|
|
|
2281
2274
|
this.inner.repaint();
|
|
2282
2275
|
}
|
|
2283
2276
|
}
|
|
2284
|
-
class
|
|
2277
|
+
class rr {
|
|
2285
2278
|
constructor() {
|
|
2286
2279
|
}
|
|
2287
2280
|
}
|
|
2288
|
-
class
|
|
2281
|
+
class si extends rr {
|
|
2289
2282
|
constructor(t, r) {
|
|
2290
2283
|
super();
|
|
2291
2284
|
p(this, "inner");
|
|
@@ -2319,7 +2312,7 @@ class ti extends er {
|
|
|
2319
2312
|
switch (c) {
|
|
2320
2313
|
case google.maps.places.PlacesServiceStatus.ZERO_RESULTS:
|
|
2321
2314
|
case google.maps.places.PlacesServiceStatus.OK: {
|
|
2322
|
-
const o = (a ?? []).map((l) =>
|
|
2315
|
+
const o = (a ?? []).map((l) => Yt(l, this.map));
|
|
2323
2316
|
s(o);
|
|
2324
2317
|
break;
|
|
2325
2318
|
}
|
|
@@ -2331,7 +2324,7 @@ class ti extends er {
|
|
|
2331
2324
|
});
|
|
2332
2325
|
}
|
|
2333
2326
|
}
|
|
2334
|
-
class
|
|
2327
|
+
class ni extends rr {
|
|
2335
2328
|
constructor(t, r) {
|
|
2336
2329
|
super();
|
|
2337
2330
|
p(this, "searchRequestMap", /* @__PURE__ */ new Map());
|
|
@@ -2363,7 +2356,7 @@ class ri extends er {
|
|
|
2363
2356
|
return new Promise((s, n) => {
|
|
2364
2357
|
const a = new BMap.LocalSearch(t ?? this.map.innerMap, {
|
|
2365
2358
|
onSearchComplete: (c) => {
|
|
2366
|
-
Array.isArray(c) &&
|
|
2359
|
+
Array.isArray(c) && Rt("当前只支持一次搜索一条数据");
|
|
2367
2360
|
const o = a.getStatus();
|
|
2368
2361
|
switch (o) {
|
|
2369
2362
|
case BMAP_STATUS_SUCCESS: {
|
|
@@ -2397,7 +2390,7 @@ class ri extends er {
|
|
|
2397
2390
|
});
|
|
2398
2391
|
}
|
|
2399
2392
|
}
|
|
2400
|
-
class
|
|
2393
|
+
class ir {
|
|
2401
2394
|
constructor(e, t) {
|
|
2402
2395
|
p(this, "onData");
|
|
2403
2396
|
p(this, "onError");
|
|
@@ -2412,23 +2405,23 @@ class tr {
|
|
|
2412
2405
|
return this.onData && C("setSearchListener只能调用一次"), this.onData = e, this.onError = t, ue;
|
|
2413
2406
|
}
|
|
2414
2407
|
}
|
|
2415
|
-
class
|
|
2408
|
+
class oi extends ir {
|
|
2416
2409
|
constructor(t, r) {
|
|
2417
2410
|
super(t, r.input);
|
|
2418
2411
|
p(this, "searchBox");
|
|
2419
2412
|
this.searchBox = new google.maps.places.SearchBox(r.input), this.searchBox.bindTo("bounds", t.innerMap);
|
|
2420
2413
|
}
|
|
2421
2414
|
setSearchListener(t, r) {
|
|
2422
|
-
return super.setSearchListener(t, r),
|
|
2415
|
+
return super.setSearchListener(t, r), Zt(this.searchBox, "places_changed", () => {
|
|
2423
2416
|
const s = this.searchBox.getPlaces();
|
|
2424
|
-
t((s ?? []).map((n) =>
|
|
2417
|
+
t((s ?? []).map((n) => Yt(n, this.map)));
|
|
2425
2418
|
});
|
|
2426
2419
|
}
|
|
2427
2420
|
search() {
|
|
2428
2421
|
this.input.value && (google.maps.event.trigger(this.input, "focus", {}), google.maps.event.trigger(this.input, "keydown", { keyCode: 13 }));
|
|
2429
2422
|
}
|
|
2430
2423
|
}
|
|
2431
|
-
class
|
|
2424
|
+
class ai extends ir {
|
|
2432
2425
|
constructor(t, r) {
|
|
2433
2426
|
super(t, r.input);
|
|
2434
2427
|
p(this, "autocomplete");
|
|
@@ -2447,7 +2440,7 @@ class si extends tr {
|
|
|
2447
2440
|
this.placeService.search(t).then(this.onData, this.onError);
|
|
2448
2441
|
}
|
|
2449
2442
|
}
|
|
2450
|
-
var
|
|
2443
|
+
var li = /* @__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))(li || {});
|
|
2451
2444
|
class rt {
|
|
2452
2445
|
constructor(e) {
|
|
2453
2446
|
p(this, "latestInfoWindow");
|
|
@@ -2500,7 +2493,7 @@ class rt {
|
|
|
2500
2493
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
2501
2494
|
* Released under the MIT License.
|
|
2502
2495
|
*/
|
|
2503
|
-
function
|
|
2496
|
+
function hi(i) {
|
|
2504
2497
|
return i != null && typeof i == "object" && Array.isArray(i) === !1;
|
|
2505
2498
|
}
|
|
2506
2499
|
/*!
|
|
@@ -2509,12 +2502,12 @@ function oi(i) {
|
|
|
2509
2502
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
2510
2503
|
* Released under the MIT License.
|
|
2511
2504
|
*/
|
|
2512
|
-
function
|
|
2513
|
-
return
|
|
2505
|
+
function kt(i) {
|
|
2506
|
+
return hi(i) === !0 && Object.prototype.toString.call(i) === "[object Object]";
|
|
2514
2507
|
}
|
|
2515
|
-
function
|
|
2508
|
+
function sr(i) {
|
|
2516
2509
|
var e, t;
|
|
2517
|
-
return !(
|
|
2510
|
+
return !(kt(i) === !1 || (e = i.constructor, typeof e != "function") || (t = e.prototype, kt(t) === !1) || t.hasOwnProperty("isPrototypeOf") === !1);
|
|
2518
2511
|
}
|
|
2519
2512
|
var me;
|
|
2520
2513
|
((i) => {
|
|
@@ -2531,27 +2524,27 @@ var me;
|
|
|
2531
2524
|
}
|
|
2532
2525
|
i.toJsonSafely = r;
|
|
2533
2526
|
function s(c) {
|
|
2534
|
-
|
|
2527
|
+
sr(c) && Object.keys(c).forEach((o) => {
|
|
2535
2528
|
c[o] === void 0 ? delete c[o] : s(c[o]);
|
|
2536
2529
|
});
|
|
2537
2530
|
}
|
|
2538
2531
|
i.deleteUndefinedPropertyOnPlainObjectDeeply = s;
|
|
2539
2532
|
function n(c, ...o) {
|
|
2540
|
-
const l =
|
|
2533
|
+
const l = Pt(o), h = {};
|
|
2541
2534
|
for (const d in c)
|
|
2542
2535
|
l(d) || (h[d] = c[d]);
|
|
2543
2536
|
return h;
|
|
2544
2537
|
}
|
|
2545
2538
|
i.omit = n;
|
|
2546
2539
|
function a(c, ...o) {
|
|
2547
|
-
const l =
|
|
2540
|
+
const l = Pt(o), h = {};
|
|
2548
2541
|
for (const d in c)
|
|
2549
2542
|
l(d) && (h[d] = c[d]);
|
|
2550
2543
|
return h;
|
|
2551
2544
|
}
|
|
2552
2545
|
i.pick = a;
|
|
2553
2546
|
})(me || (me = {}));
|
|
2554
|
-
function
|
|
2547
|
+
function Pt(i) {
|
|
2555
2548
|
if (i.length <= 4)
|
|
2556
2549
|
return i.includes.bind(i);
|
|
2557
2550
|
{
|
|
@@ -2560,19 +2553,19 @@ function kt(i) {
|
|
|
2560
2553
|
}
|
|
2561
2554
|
}
|
|
2562
2555
|
me.toJsonSafely;
|
|
2563
|
-
const
|
|
2564
|
-
var D = /* @__PURE__ */ ((i) => (i.auto = "auto", i.none = "none", i.greedy = "greedy", i.cooperative = "cooperative", i))(D || {}),
|
|
2556
|
+
const ci = ["single", "multi"];
|
|
2557
|
+
var D = /* @__PURE__ */ ((i) => (i.auto = "auto", i.none = "none", i.greedy = "greedy", i.cooperative = "cooperative", i))(D || {}), Ve;
|
|
2565
2558
|
((i) => {
|
|
2566
2559
|
function e(t) {
|
|
2567
2560
|
me.deleteUndefinedPropertyOnPlainObjectDeeply(t);
|
|
2568
2561
|
const r = { center: y.ZERO, zoom: 5 };
|
|
2569
|
-
return
|
|
2570
|
-
isMergeableObject:
|
|
2562
|
+
return Nt(r, t || {}, {
|
|
2563
|
+
isMergeableObject: sr
|
|
2571
2564
|
});
|
|
2572
2565
|
}
|
|
2573
2566
|
i.create = e;
|
|
2574
|
-
})(
|
|
2575
|
-
class
|
|
2567
|
+
})(Ve || (Ve = {}));
|
|
2568
|
+
class nr {
|
|
2576
2569
|
constructor(e, t, r, s) {
|
|
2577
2570
|
p(this, "addEventListener");
|
|
2578
2571
|
p(this, "removeEventListener");
|
|
@@ -2582,9 +2575,9 @@ class ir {
|
|
|
2582
2575
|
this.map.removeOverlay(this);
|
|
2583
2576
|
}
|
|
2584
2577
|
}
|
|
2585
|
-
class it extends
|
|
2578
|
+
class it extends nr {
|
|
2586
2579
|
constructor(e, t, r) {
|
|
2587
|
-
super(e, t, r, new
|
|
2580
|
+
super(e, t, r, new Q(e, r));
|
|
2588
2581
|
}
|
|
2589
2582
|
isVisible() {
|
|
2590
2583
|
return this.innerOverlay.getVisible();
|
|
@@ -2593,7 +2586,7 @@ class it extends ir {
|
|
|
2593
2586
|
this.innerOverlay.setVisible(e);
|
|
2594
2587
|
}
|
|
2595
2588
|
}
|
|
2596
|
-
class Ae extends
|
|
2589
|
+
class Ae extends nr {
|
|
2597
2590
|
constructor(e, t, r) {
|
|
2598
2591
|
super(e, t, r, new ne(e, r));
|
|
2599
2592
|
}
|
|
@@ -2707,7 +2700,7 @@ class at extends nt {
|
|
|
2707
2700
|
this.coordType = this.map.coordType, this.innerOverlay.setCenter(e.toGoogle(this.coordType));
|
|
2708
2701
|
}
|
|
2709
2702
|
getCenter() {
|
|
2710
|
-
return y.fromGoogle(this.innerOverlay.getCenter() ??
|
|
2703
|
+
return y.fromGoogle(this.innerOverlay.getCenter() ?? ee.LATLNG_ZERO, this.coordType);
|
|
2711
2704
|
}
|
|
2712
2705
|
setRadius(e) {
|
|
2713
2706
|
this.innerOverlay.setRadius(e);
|
|
@@ -2716,22 +2709,22 @@ class at extends nt {
|
|
|
2716
2709
|
return this.innerOverlay.getRadius();
|
|
2717
2710
|
}
|
|
2718
2711
|
}
|
|
2719
|
-
function
|
|
2712
|
+
function or() {
|
|
2720
2713
|
BMap.OverlayV3 || (BMap.OverlayV3 = BMap.Overlay);
|
|
2721
2714
|
}
|
|
2722
|
-
var
|
|
2715
|
+
var F;
|
|
2723
2716
|
((i) => {
|
|
2724
2717
|
i.ZERO = { x: 0, y: 0 };
|
|
2725
|
-
})(
|
|
2718
|
+
})(F || (F = {}));
|
|
2726
2719
|
let Ne;
|
|
2727
|
-
function
|
|
2728
|
-
return Ne || (Ne =
|
|
2720
|
+
function di(i, e, t, r, s, n) {
|
|
2721
|
+
return Ne || (Ne = pi()), new Ne(i, e, t, r, s, n);
|
|
2729
2722
|
}
|
|
2730
|
-
function
|
|
2731
|
-
|
|
2723
|
+
function pi() {
|
|
2724
|
+
or();
|
|
2732
2725
|
const i = new BMap.Point(0, 0);
|
|
2733
2726
|
return class extends BMap.OverlayV3 {
|
|
2734
|
-
constructor(r, s = i, n =
|
|
2727
|
+
constructor(r, s = i, n = F.ZERO, a, c = 654, o = "") {
|
|
2735
2728
|
super();
|
|
2736
2729
|
// 类表达式不能有私有成员, 故改成public
|
|
2737
2730
|
p(this, "container");
|
|
@@ -2838,8 +2831,8 @@ class ht extends lt {
|
|
|
2838
2831
|
}
|
|
2839
2832
|
class ct extends lt {
|
|
2840
2833
|
constructor(t, r) {
|
|
2841
|
-
super(new
|
|
2842
|
-
p(this, "eventHub", new
|
|
2834
|
+
super(new Q(t, r));
|
|
2835
|
+
p(this, "eventHub", new Hr());
|
|
2843
2836
|
p(this, "isOpened", !1);
|
|
2844
2837
|
this.inner = t, this.map = r, t.addListener("closeclick", () => {
|
|
2845
2838
|
this.isOpened = !1, this.eventHub.hasListener("close") && this.eventHub.notify({ type: "close", target: this });
|
|
@@ -2888,7 +2881,7 @@ class ct extends lt {
|
|
|
2888
2881
|
this.isOpened && (this.isOpened = !1, this.inner.close(), this.eventHub.notify({ type: "close", target: this }));
|
|
2889
2882
|
}
|
|
2890
2883
|
getPosition() {
|
|
2891
|
-
return y.fromGoogle(this.inner.getPosition() ??
|
|
2884
|
+
return y.fromGoogle(this.inner.getPosition() ?? ee.LATLNG_ZERO, this.map.coordType);
|
|
2892
2885
|
}
|
|
2893
2886
|
setPosition(t) {
|
|
2894
2887
|
this.inner.setPosition(t.toGoogle(this.map.coordType));
|
|
@@ -2900,7 +2893,7 @@ class dt extends Ae {
|
|
|
2900
2893
|
}
|
|
2901
2894
|
static create(e) {
|
|
2902
2895
|
var s;
|
|
2903
|
-
const t = this.coordType, r =
|
|
2896
|
+
const t = this.coordType, r = di(
|
|
2904
2897
|
e.content,
|
|
2905
2898
|
(s = e.position) == null ? void 0 : s.toBaidu(t),
|
|
2906
2899
|
e.offset,
|
|
@@ -2931,7 +2924,7 @@ class dt extends Ae {
|
|
|
2931
2924
|
}
|
|
2932
2925
|
class pt extends lt {
|
|
2933
2926
|
constructor(e, t, r) {
|
|
2934
|
-
super(new
|
|
2927
|
+
super(new Q(e, r)), this.inner = e, this.coordType = t, this.map = r;
|
|
2935
2928
|
}
|
|
2936
2929
|
static create(e) {
|
|
2937
2930
|
var n;
|
|
@@ -2955,7 +2948,7 @@ class pt extends lt {
|
|
|
2955
2948
|
this.inner.close();
|
|
2956
2949
|
}
|
|
2957
2950
|
getPosition() {
|
|
2958
|
-
return y.fromGoogle(this.inner.getPosition() ??
|
|
2951
|
+
return y.fromGoogle(this.inner.getPosition() ?? ee.LATLNG_ZERO, this.coordType);
|
|
2959
2952
|
}
|
|
2960
2953
|
setPosition(e) {
|
|
2961
2954
|
this.coordType = this.map.coordType, this.inner.setPosition(e.toGoogle(this.coordType));
|
|
@@ -2992,7 +2985,7 @@ var fe;
|
|
|
2992
2985
|
}
|
|
2993
2986
|
i.pascal2kebab = r;
|
|
2994
2987
|
})(fe || (fe = {}));
|
|
2995
|
-
const
|
|
2988
|
+
const ui = {
|
|
2996
2989
|
/** @see https://nodejs.org/docs/v10.3.0/api/path.html#path_path_basename_path_ext */
|
|
2997
2990
|
basename(i, e) {
|
|
2998
2991
|
const t = i.endsWith("/") ? i.slice(0, -1) : i, r = t.lastIndexOf("/"), s = r >= 0 ? t.substring(r + 1) : t;
|
|
@@ -3000,10 +2993,10 @@ const ci = {
|
|
|
3000
2993
|
}
|
|
3001
2994
|
};
|
|
3002
2995
|
let De;
|
|
3003
|
-
function
|
|
3004
|
-
return De || (De =
|
|
2996
|
+
function gi(i, e, t, r) {
|
|
2997
|
+
return De || (De = mi()), new De(i, e, t, r);
|
|
3005
2998
|
}
|
|
3006
|
-
function
|
|
2999
|
+
function mi() {
|
|
3007
3000
|
return class extends google.maps.OverlayView {
|
|
3008
3001
|
constructor(t, r, s, n) {
|
|
3009
3002
|
super();
|
|
@@ -3178,7 +3171,7 @@ class ut extends Ae {
|
|
|
3178
3171
|
class gt extends it {
|
|
3179
3172
|
static create(e) {
|
|
3180
3173
|
var s;
|
|
3181
|
-
const t = this.coordType, r =
|
|
3174
|
+
const t = this.coordType, r = gi(
|
|
3182
3175
|
ae.toElement(e.content),
|
|
3183
3176
|
(s = e.position) == null ? void 0 : s.toGoogle(t),
|
|
3184
3177
|
e.offset,
|
|
@@ -3200,17 +3193,17 @@ class gt extends it {
|
|
|
3200
3193
|
this.coordType = this.map.coordType, this.innerOverlay.setPosition(e.toGoogle(this.coordType));
|
|
3201
3194
|
}
|
|
3202
3195
|
getOffset() {
|
|
3203
|
-
return this.innerOverlay.getOffset() ??
|
|
3196
|
+
return this.innerOverlay.getOffset() ?? F.ZERO;
|
|
3204
3197
|
}
|
|
3205
3198
|
setOffset(e) {
|
|
3206
3199
|
this.innerOverlay.setOffset(e);
|
|
3207
3200
|
}
|
|
3208
3201
|
}
|
|
3209
|
-
const
|
|
3210
|
-
toGoogle: (i) => "url" in i ?
|
|
3211
|
-
toBaidu: (i) => "url" in i ?
|
|
3202
|
+
const ke = {
|
|
3203
|
+
toGoogle: (i) => "url" in i ? Pe.toGoogle(i) : Ie.toGoogle(i),
|
|
3204
|
+
toBaidu: (i) => "url" in i ? Pe.toBaidu(i) : Ie.toBaidu(i)
|
|
3212
3205
|
};
|
|
3213
|
-
var
|
|
3206
|
+
var Pe;
|
|
3214
3207
|
((i) => {
|
|
3215
3208
|
function e(r) {
|
|
3216
3209
|
return {
|
|
@@ -3232,7 +3225,7 @@ var ke;
|
|
|
3232
3225
|
});
|
|
3233
3226
|
}
|
|
3234
3227
|
i.toBaidu = t;
|
|
3235
|
-
})(
|
|
3228
|
+
})(Pe || (Pe = {}));
|
|
3236
3229
|
var Ie;
|
|
3237
3230
|
((i) => {
|
|
3238
3231
|
function e(r) {
|
|
@@ -3265,7 +3258,7 @@ var Ie;
|
|
|
3265
3258
|
}
|
|
3266
3259
|
i.toBaidu = t;
|
|
3267
3260
|
})(Ie || (Ie = {}));
|
|
3268
|
-
const
|
|
3261
|
+
const ps = {
|
|
3269
3262
|
CIRCLE: { baidu: () => BMap_Symbol_SHAPE_CIRCLE, google: () => google.maps.SymbolPath.CIRCLE },
|
|
3270
3263
|
BACKWARD_CLOSED_ARROW: { baidu: () => BMap_Symbol_SHAPE_BACKWARD_CLOSED_ARROW, google: () => google.maps.SymbolPath.BACKWARD_CLOSED_ARROW },
|
|
3271
3264
|
BACKWARD_OPEN_ARROW: { baidu: () => BMap_Symbol_SHAPE_BACKWARD_OPEN_ARROW, google: () => google.maps.SymbolPath.BACKWARD_OPEN_ARROW },
|
|
@@ -3279,7 +3272,7 @@ class ye extends Ae {
|
|
|
3279
3272
|
static create(e) {
|
|
3280
3273
|
const t = this.coordType, r = e.icon, s = {
|
|
3281
3274
|
title: e.title,
|
|
3282
|
-
icon: r &&
|
|
3275
|
+
icon: r && ke.toBaidu(r),
|
|
3283
3276
|
enableClicking: e.clickable,
|
|
3284
3277
|
enableDragging: e.draggable,
|
|
3285
3278
|
// baidu的raiseOnDrag属性, 默认为false, 而我们的options.crossOnDrag默认为true, 故这里需要转换下
|
|
@@ -3304,7 +3297,7 @@ class ye extends Ae {
|
|
|
3304
3297
|
return this.innerOverlay.getTitle();
|
|
3305
3298
|
}
|
|
3306
3299
|
setIcon(e) {
|
|
3307
|
-
const t =
|
|
3300
|
+
const t = ke.toBaidu(e);
|
|
3308
3301
|
this.innerOverlay.setIcon(t);
|
|
3309
3302
|
const r = this.getLabel();
|
|
3310
3303
|
r && r.attachIcon(t);
|
|
@@ -3353,7 +3346,7 @@ class mt extends it {
|
|
|
3353
3346
|
title: t.title,
|
|
3354
3347
|
zIndex: t.zIndex,
|
|
3355
3348
|
visible: t.visible,
|
|
3356
|
-
icon: s &&
|
|
3349
|
+
icon: s && ke.toGoogle(s),
|
|
3357
3350
|
clickable: t.clickable,
|
|
3358
3351
|
draggable: t.draggable,
|
|
3359
3352
|
// google的crossOnDrag和我们的crossOnDrag是匹配的, 不需要转换
|
|
@@ -3377,7 +3370,7 @@ class mt extends it {
|
|
|
3377
3370
|
return this.innerOverlay.getTitle() || "";
|
|
3378
3371
|
}
|
|
3379
3372
|
setIcon(t) {
|
|
3380
|
-
this.innerOverlay.setIcon(
|
|
3373
|
+
this.innerOverlay.setIcon(ke.toGoogle(t));
|
|
3381
3374
|
}
|
|
3382
3375
|
getIcon() {
|
|
3383
3376
|
return this.innerOverlay.getIcon();
|
|
@@ -3506,8 +3499,8 @@ class _t extends nt {
|
|
|
3506
3499
|
this.coordType = this.map.coordType, this.innerOverlay.setPath(e.map((t) => t.toGoogle(this.coordType)));
|
|
3507
3500
|
}
|
|
3508
3501
|
}
|
|
3509
|
-
const
|
|
3510
|
-
class
|
|
3502
|
+
const K = 1;
|
|
3503
|
+
class fi extends rt {
|
|
3511
3504
|
constructor(t, r) {
|
|
3512
3505
|
var s;
|
|
3513
3506
|
super(t);
|
|
@@ -3521,16 +3514,16 @@ class ui extends rt {
|
|
|
3521
3514
|
p(this, "createInfoWindow", ht.create);
|
|
3522
3515
|
p(this, "createInfoBox", dt.create);
|
|
3523
3516
|
p(this, "createMarker", ye.create);
|
|
3524
|
-
p(this, "createMapTypeControl",
|
|
3517
|
+
p(this, "createMapTypeControl", Ke.create);
|
|
3525
3518
|
p(this, "createZoomControl", Qe.create);
|
|
3526
3519
|
p(this, "createScaleControl", Xe.create);
|
|
3527
|
-
this.buildInMapTypeId2BIMT = I.BUILD_IN_MAP_TYPES.getValueMap(
|
|
3528
|
-
minZoom: r.minZoom && r.minZoom +
|
|
3529
|
-
maxZoom: r.maxZoom && r.maxZoom +
|
|
3520
|
+
this.buildInMapTypeId2BIMT = I.BUILD_IN_MAP_TYPES.getValueMap(P.prototype.getId), this.baiduMapType2BIMT = I.BUILD_IN_MAP_TYPES.getValueMap(P.prototype.asBaiduMapType), this.map = new BMap.Map(t, {
|
|
3521
|
+
minZoom: r.minZoom && r.minZoom + K,
|
|
3522
|
+
maxZoom: r.maxZoom && r.maxZoom + K,
|
|
3530
3523
|
mapType: r.buildInMapTypeId && ((s = this.buildInMapTypeId2BIMT.get(r.buildInMapTypeId)) == null ? void 0 : s.asBaiduMapType()),
|
|
3531
3524
|
enableMapClick: !1
|
|
3532
3525
|
// 关闭底图点击功能
|
|
3533
|
-
}), this.map.centerAndZoom(r.center.toBaidu(this.coordType), r.zoom +
|
|
3526
|
+
}), this.map.centerAndZoom(r.center.toBaidu(this.coordType), r.zoom + K), this.setGestureHandling(r.gestureHandling), r.infoWindowMode === "multi" && console.warn("baidu不支持多个InfoWindow, 可能会出现未知问题"), r.mapStyle && this.map.setMapStyleV2(r.mapStyle.toBaidu()), this.setEventTargetDelegate(new ne(this.map, this)), this.map.addEventListener("addoverlay", (n) => {
|
|
3534
3527
|
const a = n.target.__info_box__;
|
|
3535
3528
|
a && (console.debug("add:info-box", a), this.map.addOverlay(a));
|
|
3536
3529
|
}), this.map.addEventListener("removeoverlay", (n) => {
|
|
@@ -3593,16 +3586,16 @@ class ui extends rt {
|
|
|
3593
3586
|
this.map.setCenter(t.toBaidu(this.coordType));
|
|
3594
3587
|
}
|
|
3595
3588
|
getZoom() {
|
|
3596
|
-
return super.getZoom() -
|
|
3589
|
+
return super.getZoom() - K;
|
|
3597
3590
|
}
|
|
3598
3591
|
setZoom(t) {
|
|
3599
|
-
return super.setZoom(t +
|
|
3592
|
+
return super.setZoom(t + K);
|
|
3600
3593
|
}
|
|
3601
3594
|
setMinZoom(t) {
|
|
3602
|
-
this.map.setMinZoom(t +
|
|
3595
|
+
this.map.setMinZoom(t + K);
|
|
3603
3596
|
}
|
|
3604
3597
|
setMaxZoom(t) {
|
|
3605
|
-
this.map.setMaxZoom(t +
|
|
3598
|
+
this.map.setMaxZoom(t + K);
|
|
3606
3599
|
}
|
|
3607
3600
|
setMapStyle(t) {
|
|
3608
3601
|
this.map.setMapStyleV2(t.toBaidu());
|
|
@@ -3638,7 +3631,7 @@ class ui extends rt {
|
|
|
3638
3631
|
});
|
|
3639
3632
|
}
|
|
3640
3633
|
getBounds() {
|
|
3641
|
-
return
|
|
3634
|
+
return V.fromBaidu(this.map.getBounds(), this.coordType);
|
|
3642
3635
|
}
|
|
3643
3636
|
addElementOverlay(t) {
|
|
3644
3637
|
this.map.addOverlay(t.asBaidu());
|
|
@@ -3672,19 +3665,19 @@ class ui extends rt {
|
|
|
3672
3665
|
t.inner && (se(t.inner instanceof BMap.Control, `control.inner(${t.inner})需要是BMap.Control`), this.map.removeControl(t.inner));
|
|
3673
3666
|
}
|
|
3674
3667
|
createMarkerClusterer(t) {
|
|
3675
|
-
return new
|
|
3668
|
+
return new ri(this, t);
|
|
3676
3669
|
}
|
|
3677
3670
|
createAutocomplete(t) {
|
|
3678
|
-
return new
|
|
3671
|
+
return new Xr(this, t);
|
|
3679
3672
|
}
|
|
3680
3673
|
createSearchBox(t) {
|
|
3681
|
-
return new
|
|
3674
|
+
return new ai(this, t);
|
|
3682
3675
|
}
|
|
3683
3676
|
createPlaceService(t) {
|
|
3684
|
-
return new
|
|
3677
|
+
return new ni(this, t);
|
|
3685
3678
|
}
|
|
3686
3679
|
}
|
|
3687
|
-
class
|
|
3680
|
+
class yi extends rt {
|
|
3688
3681
|
constructor(t, r) {
|
|
3689
3682
|
var n;
|
|
3690
3683
|
super(t);
|
|
@@ -3701,7 +3694,7 @@ class gi extends rt {
|
|
|
3701
3694
|
p(this, "createMapTypeControl", Oe.create);
|
|
3702
3695
|
p(this, "createZoomControl", et.create);
|
|
3703
3696
|
p(this, "createScaleControl", Je.create);
|
|
3704
|
-
this.mapOptions = r, this.buildInMapTypeId2BIMT = I.BUILD_IN_MAP_TYPES.getValueMap(
|
|
3697
|
+
this.mapOptions = r, this.buildInMapTypeId2BIMT = I.BUILD_IN_MAP_TYPES.getValueMap(P.prototype.getId), this.googleMapTypeId2BIMT = I.BUILD_IN_MAP_TYPES.getValueMap(P.prototype.getGoogleMapTypeId);
|
|
3705
3698
|
const s = r.buildInMapTypeId && this.buildInMapTypeId2BIMT.get(r.buildInMapTypeId);
|
|
3706
3699
|
this.map = new google.maps.Map(t, {
|
|
3707
3700
|
center: r.center.toGoogle((s ?? I.NORMAL).getGoogleCoordType()),
|
|
@@ -3713,7 +3706,7 @@ class gi extends rt {
|
|
|
3713
3706
|
maxZoom: r.maxZoom,
|
|
3714
3707
|
styles: (n = r.mapStyle) == null ? void 0 : n.toGoogle(),
|
|
3715
3708
|
mapTypeId: s == null ? void 0 : s.getGoogleMapTypeId()
|
|
3716
|
-
}), this.setEventTargetDelegate(new
|
|
3709
|
+
}), this.setEventTargetDelegate(new Q(this.map, this));
|
|
3717
3710
|
}
|
|
3718
3711
|
setDefaultCursor(t) {
|
|
3719
3712
|
this.innerMap.setOptions({ draggableCursor: t });
|
|
@@ -3737,17 +3730,17 @@ class gi extends rt {
|
|
|
3737
3730
|
if (n == null || a == null || c == null)
|
|
3738
3731
|
return y.ZERO;
|
|
3739
3732
|
const o = Math.pow(2, c), l = new google.maps.Point(t.x / o + n.x, t.y / o + a.y);
|
|
3740
|
-
return y.fromGoogle(r.fromPointToLatLng(l) ??
|
|
3733
|
+
return y.fromGoogle(r.fromPointToLatLng(l) ?? ee.LATLNG_ZERO, this.coordType);
|
|
3741
3734
|
}
|
|
3742
3735
|
fromLatLngToContainerPoint(t) {
|
|
3743
3736
|
const r = this.innerMap.getProjection(), s = this.innerMap.getBounds();
|
|
3744
3737
|
if (r == null || s == null)
|
|
3745
|
-
return
|
|
3738
|
+
return F.ZERO;
|
|
3746
3739
|
const n = r.fromLatLngToPoint(s.getSouthWest()), a = r.fromLatLngToPoint(s.getNorthEast()), c = this.innerMap.getZoom();
|
|
3747
3740
|
if (n == null || a == null || c == null)
|
|
3748
|
-
return
|
|
3741
|
+
return F.ZERO;
|
|
3749
3742
|
const o = Math.pow(2, c), l = r.fromLatLngToPoint(t.toGoogle(this.coordType));
|
|
3750
|
-
return l == null ?
|
|
3743
|
+
return l == null ? F.ZERO : { x: (l.x - n.x) * o, y: (l.y - a.y) * o };
|
|
3751
3744
|
}
|
|
3752
3745
|
setDraggable(t) {
|
|
3753
3746
|
this.innerMap.setOptions({ draggable: t });
|
|
@@ -3756,7 +3749,7 @@ class gi extends rt {
|
|
|
3756
3749
|
this.map.setOptions({ disableDoubleClickZoom: t });
|
|
3757
3750
|
}
|
|
3758
3751
|
getCenter() {
|
|
3759
|
-
return y.fromGoogle(this.map.getCenter() ??
|
|
3752
|
+
return y.fromGoogle(this.map.getCenter() ?? ee.LATLNG_ZERO, this.coordType);
|
|
3760
3753
|
}
|
|
3761
3754
|
setCenter(t) {
|
|
3762
3755
|
this.map.setCenter(t.toGoogle(this.coordType));
|
|
@@ -3776,7 +3769,7 @@ class gi extends rt {
|
|
|
3776
3769
|
this.map.setMapTypeId(r ?? C("理论上来说不可能为空"));
|
|
3777
3770
|
}
|
|
3778
3771
|
setMapType(t) {
|
|
3779
|
-
t instanceof
|
|
3772
|
+
t instanceof P ? this.map.setMapTypeId(t.getGoogleMapTypeId()) : (this.map.mapTypes.set(t.id, t.asGoogleMapType()), this.map.setMapTypeId(t.id));
|
|
3780
3773
|
}
|
|
3781
3774
|
getMapType() {
|
|
3782
3775
|
const t = this.map.getMapTypeId() ?? google.maps.MapTypeId.ROADMAP, r = this.googleMapTypeId2BIMT.get(t);
|
|
@@ -3805,7 +3798,7 @@ class gi extends rt {
|
|
|
3805
3798
|
}
|
|
3806
3799
|
getBounds() {
|
|
3807
3800
|
const t = this.map.getBounds();
|
|
3808
|
-
return t ?
|
|
3801
|
+
return t ? V.fromGoogle(t, this.coordType) : V.EMPTY;
|
|
3809
3802
|
}
|
|
3810
3803
|
addElementOverlay(t) {
|
|
3811
3804
|
t.asGoogle().setMap(this.map);
|
|
@@ -3829,26 +3822,26 @@ class gi extends rt {
|
|
|
3829
3822
|
}
|
|
3830
3823
|
}
|
|
3831
3824
|
createMarkerClusterer(t) {
|
|
3832
|
-
return new
|
|
3825
|
+
return new ii(this, t);
|
|
3833
3826
|
}
|
|
3834
3827
|
createAutocomplete(t) {
|
|
3835
|
-
return new
|
|
3828
|
+
return new Kr(this, t);
|
|
3836
3829
|
}
|
|
3837
3830
|
createSearchBox(t) {
|
|
3838
|
-
return new
|
|
3831
|
+
return new oi(this, t);
|
|
3839
3832
|
}
|
|
3840
3833
|
createPlaceService(t) {
|
|
3841
|
-
return new
|
|
3834
|
+
return new si(this, t);
|
|
3842
3835
|
}
|
|
3843
3836
|
}
|
|
3844
|
-
class
|
|
3837
|
+
class vi extends rt {
|
|
3845
3838
|
constructor(t, r) {
|
|
3846
3839
|
var a;
|
|
3847
3840
|
super(t);
|
|
3848
3841
|
p(this, "map");
|
|
3849
3842
|
p(this, "defaultLayers");
|
|
3850
3843
|
this.mapOptions = r;
|
|
3851
|
-
const s =
|
|
3844
|
+
const s = Gt().here;
|
|
3852
3845
|
Ce.includes(s.version) || C(`不支持${s.version}, HereMap当前只支持如下版本: ${Ce}`);
|
|
3853
3846
|
const n = new H.service.Platform({
|
|
3854
3847
|
app_id: s.key.split(",")[0],
|
|
@@ -3866,7 +3859,7 @@ class mi extends rt {
|
|
|
3866
3859
|
return this.map;
|
|
3867
3860
|
}
|
|
3868
3861
|
get coordType() {
|
|
3869
|
-
return
|
|
3862
|
+
return J.wgs84;
|
|
3870
3863
|
}
|
|
3871
3864
|
getCenter() {
|
|
3872
3865
|
return y.fromHere(this.map.getCenter(), this.coordType);
|
|
@@ -3987,28 +3980,28 @@ class mi extends rt {
|
|
|
3987
3980
|
throw new Error("Method not implemented.");
|
|
3988
3981
|
}
|
|
3989
3982
|
}
|
|
3990
|
-
var $ = /* @__PURE__ */ ((i) => (i.google = "google", i.baidu = "baidu", i.here = "here", i))($ || {}),
|
|
3983
|
+
var $ = /* @__PURE__ */ ((i) => (i.google = "google", i.baidu = "baidu", i.here = "here", i))($ || {}), He;
|
|
3991
3984
|
((i) => {
|
|
3992
3985
|
function e(t, r, s) {
|
|
3993
|
-
const n =
|
|
3986
|
+
const n = Ve.create(s);
|
|
3994
3987
|
switch (t) {
|
|
3995
3988
|
case "google":
|
|
3996
|
-
return new
|
|
3989
|
+
return new yi(r, n);
|
|
3997
3990
|
case "baidu":
|
|
3998
|
-
return new
|
|
3991
|
+
return new fi(r, n);
|
|
3999
3992
|
case "here":
|
|
4000
|
-
return new
|
|
3993
|
+
return new vi(r, n);
|
|
4001
3994
|
}
|
|
4002
3995
|
}
|
|
4003
3996
|
i.createMap = e;
|
|
4004
|
-
})(
|
|
4005
|
-
function
|
|
4006
|
-
const t = window, r =
|
|
3997
|
+
})(He || (He = {}));
|
|
3998
|
+
function _i({ type: i, config: e }) {
|
|
3999
|
+
const t = window, r = Mi(i);
|
|
4007
4000
|
if (t[r])
|
|
4008
4001
|
return Promise.resolve();
|
|
4009
4002
|
switch (i !== $.here && !e.key && C(`请先配置${i}地图的key`), i) {
|
|
4010
4003
|
case $.google:
|
|
4011
|
-
return {}.VITE_FALSE ? (
|
|
4004
|
+
return {}.VITE_FALSE ? (qr({
|
|
4012
4005
|
key: e.key,
|
|
4013
4006
|
v: "3.52"
|
|
4014
4007
|
// v: config.version,
|
|
@@ -4030,7 +4023,7 @@ function fi({ type: i, config: e }) {
|
|
|
4030
4023
|
function he(i, e = Ce[0]) {
|
|
4031
4024
|
return `https://js.api.here.com/v3/${e}/mapsjs-${i}.js`;
|
|
4032
4025
|
}
|
|
4033
|
-
function
|
|
4026
|
+
function Mi(i) {
|
|
4034
4027
|
switch (i) {
|
|
4035
4028
|
case $.google:
|
|
4036
4029
|
return "google";
|
|
@@ -4040,10 +4033,10 @@ function yi(i) {
|
|
|
4040
4033
|
return "H";
|
|
4041
4034
|
}
|
|
4042
4035
|
}
|
|
4043
|
-
let
|
|
4036
|
+
let bi = 0;
|
|
4044
4037
|
function It(i, e = "callback") {
|
|
4045
4038
|
return new Promise((t, r) => {
|
|
4046
|
-
const s = `__callback${
|
|
4039
|
+
const s = `__callback${bi++}`;
|
|
4047
4040
|
window[s] = t;
|
|
4048
4041
|
const n = document.createElement("script");
|
|
4049
4042
|
n.src = `${i}&${e}=${s}`, n.onerror = r, document.body.appendChild(n);
|
|
@@ -4062,7 +4055,7 @@ function G(i, e) {
|
|
|
4062
4055
|
validator: (t) => Object.values(i).includes(t)
|
|
4063
4056
|
};
|
|
4064
4057
|
}
|
|
4065
|
-
function
|
|
4058
|
+
function Ti(i, e) {
|
|
4066
4059
|
return {
|
|
4067
4060
|
type: String,
|
|
4068
4061
|
default: e,
|
|
@@ -4081,7 +4074,7 @@ function f(i, e) {
|
|
|
4081
4074
|
default: e
|
|
4082
4075
|
};
|
|
4083
4076
|
}
|
|
4084
|
-
function
|
|
4077
|
+
function us(i) {
|
|
4085
4078
|
const e = {};
|
|
4086
4079
|
return Object.entries(i).forEach(([t, r]) => {
|
|
4087
4080
|
const s = `__${t}`;
|
|
@@ -4104,17 +4097,17 @@ const de = {
|
|
|
4104
4097
|
get: ue,
|
|
4105
4098
|
set: ue
|
|
4106
4099
|
};
|
|
4107
|
-
function
|
|
4100
|
+
function Oi(i) {
|
|
4108
4101
|
return Object.keys(i).forEach((e) => {
|
|
4109
4102
|
const t = i[e];
|
|
4110
4103
|
let r = !1;
|
|
4111
4104
|
typeof t == "function" ? (de.get = t, de.set = ue, r = !0) : typeof t == "object" && typeof t.get == "function" && (de.get = t.get, de.set = t.set, r = !0), r && (i[e] = Object.defineProperty(i, e, de));
|
|
4112
4105
|
}), i;
|
|
4113
4106
|
}
|
|
4114
|
-
function
|
|
4115
|
-
return
|
|
4107
|
+
function gs(i) {
|
|
4108
|
+
return Oi(i);
|
|
4116
4109
|
}
|
|
4117
|
-
function
|
|
4110
|
+
function ar() {
|
|
4118
4111
|
return Ge();
|
|
4119
4112
|
}
|
|
4120
4113
|
function Te(i, e) {
|
|
@@ -4123,12 +4116,12 @@ function Te(i, e) {
|
|
|
4123
4116
|
for (const r of t)
|
|
4124
4117
|
r.call(i);
|
|
4125
4118
|
}
|
|
4126
|
-
function
|
|
4119
|
+
function ms(i, e) {
|
|
4127
4120
|
for (const t of i)
|
|
4128
4121
|
if (t.$options.name === e.name)
|
|
4129
4122
|
return t;
|
|
4130
4123
|
}
|
|
4131
|
-
function
|
|
4124
|
+
function fs(i, e) {
|
|
4132
4125
|
if (!i.default)
|
|
4133
4126
|
return;
|
|
4134
4127
|
const t = i.default();
|
|
@@ -4136,7 +4129,7 @@ function us(i, e) {
|
|
|
4136
4129
|
if ((r == null ? void 0 : r.type).name === e.name)
|
|
4137
4130
|
return r;
|
|
4138
4131
|
}
|
|
4139
|
-
function
|
|
4132
|
+
function wi(i, e) {
|
|
4140
4133
|
const t = {}, r = {}, s = {};
|
|
4141
4134
|
return Object.keys(i).forEach((n) => {
|
|
4142
4135
|
n.startsWith("on") ? t[fe.pascal2kebab(n.substring(2))] = i[n] : r[n] = i[n];
|
|
@@ -4151,13 +4144,13 @@ function bi(i, e) {
|
|
|
4151
4144
|
listenerProps: s
|
|
4152
4145
|
};
|
|
4153
4146
|
}
|
|
4154
|
-
function
|
|
4155
|
-
return St(() =>
|
|
4147
|
+
function Y(i, e) {
|
|
4148
|
+
return St(() => wi(i, e));
|
|
4156
4149
|
}
|
|
4157
4150
|
function N() {
|
|
4158
4151
|
return Function;
|
|
4159
4152
|
}
|
|
4160
|
-
const
|
|
4153
|
+
const ys = {
|
|
4161
4154
|
/**
|
|
4162
4155
|
* @event 一般来说传{@link Tg.Event}对象, 但传其他对象也不会报错
|
|
4163
4156
|
*/
|
|
@@ -4182,9 +4175,9 @@ const gs = {
|
|
|
4182
4175
|
}
|
|
4183
4176
|
},
|
|
4184
4177
|
render() {
|
|
4185
|
-
return
|
|
4178
|
+
return ar();
|
|
4186
4179
|
}
|
|
4187
|
-
}),
|
|
4180
|
+
}), Ci = x({
|
|
4188
4181
|
name: "tg-map",
|
|
4189
4182
|
provide() {
|
|
4190
4183
|
return {
|
|
@@ -4221,12 +4214,12 @@ const gs = {
|
|
|
4221
4214
|
*/
|
|
4222
4215
|
lastCenter: f(y),
|
|
4223
4216
|
zoom: z(Number),
|
|
4224
|
-
infoWindowMode:
|
|
4217
|
+
infoWindowMode: Ti(ci),
|
|
4225
4218
|
gestureHandling: G(D),
|
|
4226
4219
|
minZoom: f(Number),
|
|
4227
4220
|
maxZoom: f(Number),
|
|
4228
4221
|
mapStyle: f(Object),
|
|
4229
|
-
mapTypeId: G(
|
|
4222
|
+
mapTypeId: G(Vt),
|
|
4230
4223
|
/** 地图类型对象, 优先级比mapTypeId高 */
|
|
4231
4224
|
mapType: f(Object),
|
|
4232
4225
|
hideLogo: f(Boolean),
|
|
@@ -4243,8 +4236,8 @@ const gs = {
|
|
|
4243
4236
|
emits: void 0,
|
|
4244
4237
|
setup(i, { attrs: e }) {
|
|
4245
4238
|
return {
|
|
4246
|
-
attrs:
|
|
4247
|
-
centerSyncTimeoutId: 0
|
|
4239
|
+
attrs: Y(e, i),
|
|
4240
|
+
centerSyncTimeoutId: void 0
|
|
4248
4241
|
};
|
|
4249
4242
|
},
|
|
4250
4243
|
data() {
|
|
@@ -4294,7 +4287,7 @@ const gs = {
|
|
|
4294
4287
|
async mounted() {
|
|
4295
4288
|
const i = this.type;
|
|
4296
4289
|
try {
|
|
4297
|
-
await
|
|
4290
|
+
await _i({ type: i, config: Gt()[i] });
|
|
4298
4291
|
} catch (s) {
|
|
4299
4292
|
this.$emit("error", s);
|
|
4300
4293
|
return;
|
|
@@ -4303,7 +4296,7 @@ const gs = {
|
|
|
4303
4296
|
console.warn(`tg-map(type=${i})已销毁, 不需要继续执行`);
|
|
4304
4297
|
return;
|
|
4305
4298
|
}
|
|
4306
|
-
const e =
|
|
4299
|
+
const e = He.createMap(
|
|
4307
4300
|
i,
|
|
4308
4301
|
this.$refs.map,
|
|
4309
4302
|
/* options: */
|
|
@@ -4318,7 +4311,7 @@ const gs = {
|
|
|
4318
4311
|
buildInMapTypeId: this.mapTypeId
|
|
4319
4312
|
}
|
|
4320
4313
|
);
|
|
4321
|
-
if (this.map =
|
|
4314
|
+
if (this.map = gr(e), this.mapType && e.setMapType(this.mapType), "ready" in this.attrs.listeners && console.error("地图载入完成的事件已经从ready改为了load, 请手动修改"), U(
|
|
4322
4315
|
this.attrs.listeners,
|
|
4323
4316
|
e,
|
|
4324
4317
|
/* excludes: */
|
|
@@ -4351,9 +4344,9 @@ const j = (i, e) => {
|
|
|
4351
4344
|
t[r] = s;
|
|
4352
4345
|
return t;
|
|
4353
4346
|
};
|
|
4354
|
-
function
|
|
4347
|
+
function xi(i, e, t, r, s, n) {
|
|
4355
4348
|
return Z(), W("div", le({ class: "tg-map" }, i.attrs.binds), [
|
|
4356
|
-
|
|
4349
|
+
mr("div", {
|
|
4357
4350
|
ref: "map",
|
|
4358
4351
|
class: Se({
|
|
4359
4352
|
"tg-map__map": !0,
|
|
@@ -4365,8 +4358,8 @@ function Oi(i, e, t, r, s, n) {
|
|
|
4365
4358
|
R(i.$slots, "overlay")
|
|
4366
4359
|
], 16);
|
|
4367
4360
|
}
|
|
4368
|
-
const
|
|
4369
|
-
function
|
|
4361
|
+
const Ei = /* @__PURE__ */ j(Ci, [["render", xi]]);
|
|
4362
|
+
function Li(i) {
|
|
4370
4363
|
if (i == null)
|
|
4371
4364
|
return;
|
|
4372
4365
|
let e;
|
|
@@ -4377,7 +4370,7 @@ function Ci(i) {
|
|
|
4377
4370
|
e = i;
|
|
4378
4371
|
return `${e}px`;
|
|
4379
4372
|
}
|
|
4380
|
-
const
|
|
4373
|
+
const ki = x({
|
|
4381
4374
|
name: "tg-map-widget",
|
|
4382
4375
|
props: {
|
|
4383
4376
|
left: {
|
|
@@ -4403,22 +4396,22 @@ const xi = x({
|
|
|
4403
4396
|
}
|
|
4404
4397
|
},
|
|
4405
4398
|
methods: {
|
|
4406
|
-
dimen:
|
|
4399
|
+
dimen: Li
|
|
4407
4400
|
}
|
|
4408
4401
|
});
|
|
4409
|
-
function
|
|
4402
|
+
function Pi(i, e, t, r, s, n) {
|
|
4410
4403
|
return Z(), W("div", {
|
|
4411
4404
|
class: Se(i.$options.name),
|
|
4412
|
-
style:
|
|
4405
|
+
style: fr({ left: i.dimen(i.left), top: i.dimen(i.topValue), right: i.dimen(i.right), bottom: i.dimen(i.bottom) })
|
|
4413
4406
|
}, [
|
|
4414
4407
|
R(i.$slots, "default")
|
|
4415
4408
|
], 6);
|
|
4416
4409
|
}
|
|
4417
|
-
const
|
|
4410
|
+
const vs = /* @__PURE__ */ j(ki, [["render", Pi]]), Ii = x({
|
|
4418
4411
|
name: "tg-custom-control",
|
|
4419
4412
|
mixins: [L],
|
|
4420
4413
|
props: {
|
|
4421
|
-
position: G(
|
|
4414
|
+
position: G(k, k.RIGHT_BOTTOM)
|
|
4422
4415
|
},
|
|
4423
4416
|
setup() {
|
|
4424
4417
|
return {
|
|
@@ -4431,8 +4424,8 @@ const ms = /* @__PURE__ */ j(xi, [["render", Ei]]), Li = x({
|
|
|
4431
4424
|
}
|
|
4432
4425
|
},
|
|
4433
4426
|
onCreate() {
|
|
4434
|
-
Me(this.$parent,
|
|
4435
|
-
const { $el: i } = this, e = class extends
|
|
4427
|
+
Me(this.$parent, Ei) || console.warn("请将tg-custom-control放到tg-map中");
|
|
4428
|
+
const { $el: i } = this, e = class extends Ur {
|
|
4436
4429
|
onCreateElement() {
|
|
4437
4430
|
return i;
|
|
4438
4431
|
}
|
|
@@ -4443,19 +4436,19 @@ const ms = /* @__PURE__ */ j(xi, [["render", Ei]]), Li = x({
|
|
|
4443
4436
|
this.$map.removeCustomControl(this.control);
|
|
4444
4437
|
}
|
|
4445
4438
|
});
|
|
4446
|
-
function
|
|
4439
|
+
function Bi(i, e, t, r, s, n) {
|
|
4447
4440
|
return Z(), W("div", {
|
|
4448
4441
|
class: Se(i.$options.name)
|
|
4449
4442
|
}, [
|
|
4450
4443
|
R(i.$slots, "default")
|
|
4451
4444
|
], 2);
|
|
4452
4445
|
}
|
|
4453
|
-
const
|
|
4446
|
+
const _s = /* @__PURE__ */ j(Ii, [["render", Bi]]), Ms = x({
|
|
4454
4447
|
name: "tg-map-type-control",
|
|
4455
4448
|
mixins: [L],
|
|
4456
4449
|
props: {
|
|
4457
|
-
position: G(
|
|
4458
|
-
type: G(
|
|
4450
|
+
position: G(k, k.TOP_LEFT),
|
|
4451
|
+
type: G(Ht),
|
|
4459
4452
|
mapTypes: f(Array)
|
|
4460
4453
|
},
|
|
4461
4454
|
setup() {
|
|
@@ -4483,11 +4476,11 @@ const fs = /* @__PURE__ */ j(Li, [["render", Pi]]), ys = x({
|
|
|
4483
4476
|
onDestroy() {
|
|
4484
4477
|
this.$map.removeControl(this.control);
|
|
4485
4478
|
}
|
|
4486
|
-
}),
|
|
4479
|
+
}), bs = x({
|
|
4487
4480
|
name: "tg-scale-control",
|
|
4488
4481
|
mixins: [L],
|
|
4489
4482
|
props: {
|
|
4490
|
-
position: G(
|
|
4483
|
+
position: G(k, k.BOTTOM_RIGHT)
|
|
4491
4484
|
},
|
|
4492
4485
|
setup() {
|
|
4493
4486
|
return {
|
|
@@ -4506,20 +4499,20 @@ const fs = /* @__PURE__ */ j(Li, [["render", Pi]]), ys = x({
|
|
|
4506
4499
|
this.$map.removeControl(this.control);
|
|
4507
4500
|
}
|
|
4508
4501
|
});
|
|
4509
|
-
function
|
|
4502
|
+
function lr() {
|
|
4510
4503
|
var t;
|
|
4511
|
-
const i = (t =
|
|
4504
|
+
const i = (t = yr()) == null ? void 0 : t.type;
|
|
4512
4505
|
let e = (i == null ? void 0 : i.name) ?? (i == null ? void 0 : i.__name);
|
|
4513
4506
|
if (!e) {
|
|
4514
4507
|
const r = i == null ? void 0 : i.__file;
|
|
4515
|
-
r && (e =
|
|
4508
|
+
r && (e = ui.basename(r, ".vue"));
|
|
4516
4509
|
}
|
|
4517
4510
|
return e;
|
|
4518
4511
|
}
|
|
4519
|
-
function
|
|
4520
|
-
const i =
|
|
4512
|
+
function Si() {
|
|
4513
|
+
const i = vr(Mt);
|
|
4521
4514
|
let e, t;
|
|
4522
|
-
return i == null && C(`<${
|
|
4515
|
+
return i == null && C(`<${lr() || "unknown"}>必须作为<tg-map>的子代组件`), {
|
|
4523
4516
|
mapRef: i,
|
|
4524
4517
|
/** 读取map对象, 只要放在<tg-map>里面的组件(除#overlay插槽外)都能够立即读取到map对象 */
|
|
4525
4518
|
get map() {
|
|
@@ -4527,11 +4520,11 @@ function ki() {
|
|
|
4527
4520
|
},
|
|
4528
4521
|
/** 地图元素创建回调 */
|
|
4529
4522
|
[ve](r) {
|
|
4530
|
-
|
|
4523
|
+
_r(r), e && C(`${ve}只能调用一次`), e = r;
|
|
4531
4524
|
},
|
|
4532
4525
|
/** 地图元素销毁回调 */
|
|
4533
4526
|
[_e](r) {
|
|
4534
|
-
|
|
4527
|
+
Mr(r), t && C(`${_e}只能调用一次`), t = r;
|
|
4535
4528
|
},
|
|
4536
4529
|
/** 重新创建地图元素 */
|
|
4537
4530
|
recreate() {
|
|
@@ -4539,23 +4532,23 @@ function ki() {
|
|
|
4539
4532
|
}
|
|
4540
4533
|
};
|
|
4541
4534
|
}
|
|
4542
|
-
const
|
|
4535
|
+
const Ts = x({
|
|
4543
4536
|
name: "tg-zoom-control",
|
|
4544
4537
|
props: {
|
|
4545
|
-
position: G(
|
|
4538
|
+
position: G(k, k.RIGHT_BOTTOM)
|
|
4546
4539
|
},
|
|
4547
4540
|
setup(i) {
|
|
4548
4541
|
let e = void 0;
|
|
4549
|
-
const { map: t, onCreate: r, onDestroy: s } =
|
|
4542
|
+
const { map: t, onCreate: r, onDestroy: s } = Si();
|
|
4550
4543
|
return r(() => {
|
|
4551
4544
|
e = t.createZoomControl(i), t.addControl(e);
|
|
4552
4545
|
}), s(() => {
|
|
4553
4546
|
t.removeControl(e);
|
|
4554
|
-
}),
|
|
4547
|
+
}), br(() => i.position, (n) => {
|
|
4555
4548
|
e.setPosition(n);
|
|
4556
|
-
}),
|
|
4549
|
+
}), ar;
|
|
4557
4550
|
}
|
|
4558
|
-
}),
|
|
4551
|
+
}), Ai = x({
|
|
4559
4552
|
name: "tg-marker-clusterer",
|
|
4560
4553
|
mixins: [L],
|
|
4561
4554
|
// markers从this.$children中读取, 故需要省略(Omit)
|
|
@@ -4619,14 +4612,14 @@ const _s = x({
|
|
|
4619
4612
|
}
|
|
4620
4613
|
}
|
|
4621
4614
|
});
|
|
4622
|
-
function
|
|
4615
|
+
function $i(i, e, t, r, s, n) {
|
|
4623
4616
|
return Z(), W("div", {
|
|
4624
4617
|
class: Se(i.$options.name)
|
|
4625
4618
|
}, [
|
|
4626
4619
|
R(i.$slots, "default")
|
|
4627
4620
|
], 2);
|
|
4628
4621
|
}
|
|
4629
|
-
const
|
|
4622
|
+
const Ri = /* @__PURE__ */ j(Ai, [["render", $i]]), Os = x({
|
|
4630
4623
|
name: "tg-traffic-layer",
|
|
4631
4624
|
mixins: [L],
|
|
4632
4625
|
// 请直接使用v-if来控制它的显隐
|
|
@@ -4639,12 +4632,12 @@ const Si = /* @__PURE__ */ j(Ii, [["render", Bi]]), Ms = x({
|
|
|
4639
4632
|
},
|
|
4640
4633
|
watch: {},
|
|
4641
4634
|
onCreate() {
|
|
4642
|
-
this.layer = new
|
|
4635
|
+
this.layer = new Yr(), this.$map.addLayer(this.layer);
|
|
4643
4636
|
},
|
|
4644
4637
|
onDestroy() {
|
|
4645
4638
|
this.$map.removeLayer(this.layer);
|
|
4646
4639
|
}
|
|
4647
|
-
}),
|
|
4640
|
+
}), ws = x({
|
|
4648
4641
|
name: "tg-circle",
|
|
4649
4642
|
mixins: [L],
|
|
4650
4643
|
inheritAttrs: !1,
|
|
@@ -4662,7 +4655,7 @@ const Si = /* @__PURE__ */ j(Ii, [["render", Bi]]), Ms = x({
|
|
|
4662
4655
|
},
|
|
4663
4656
|
setup(i, { attrs: e }) {
|
|
4664
4657
|
return {
|
|
4665
|
-
attrs:
|
|
4658
|
+
attrs: Y(e),
|
|
4666
4659
|
overlay: void 0
|
|
4667
4660
|
};
|
|
4668
4661
|
},
|
|
@@ -4699,14 +4692,14 @@ const Si = /* @__PURE__ */ j(Ii, [["render", Bi]]), Ms = x({
|
|
|
4699
4692
|
}
|
|
4700
4693
|
},
|
|
4701
4694
|
onCreate() {
|
|
4702
|
-
this.overlay = this.$map.createCircle(this), this.$map.addOverlay(this.overlay),
|
|
4695
|
+
this.overlay = this.$map.createCircle(this), this.$map.addOverlay(this.overlay), U(this.attrs.listeners, this.overlay);
|
|
4703
4696
|
},
|
|
4704
4697
|
onDestroy() {
|
|
4705
4698
|
this.$map.removeOverlay(this.overlay);
|
|
4706
4699
|
}
|
|
4707
4700
|
});
|
|
4708
|
-
var
|
|
4709
|
-
class
|
|
4701
|
+
var Fe = /* @__PURE__ */ ((i) => (i.map = "map", i.overlay = "overlay", i.overlayMouseTarget = "overlayMouseTarget", i.float = "float", i))(Fe || {});
|
|
4702
|
+
class zi {
|
|
4710
4703
|
constructor(e, t) {
|
|
4711
4704
|
p(this, "baidu");
|
|
4712
4705
|
p(this, "google");
|
|
@@ -4727,7 +4720,7 @@ class Ai {
|
|
|
4727
4720
|
asBaidu() {
|
|
4728
4721
|
if (!this.baidu) {
|
|
4729
4722
|
const e = this;
|
|
4730
|
-
|
|
4723
|
+
or();
|
|
4731
4724
|
class t extends BMap.OverlayV3 {
|
|
4732
4725
|
initialize(n) {
|
|
4733
4726
|
const a = e.create(), c = n.getPanes();
|
|
@@ -4804,17 +4797,17 @@ class Ai {
|
|
|
4804
4797
|
}
|
|
4805
4798
|
this.google = new t(), this.projection = {
|
|
4806
4799
|
fromLatLngToOverlayPoint(r) {
|
|
4807
|
-
return e.google.getProjection().fromLatLngToDivPixel(r.toGoogle(e.map.coordType)) ??
|
|
4800
|
+
return e.google.getProjection().fromLatLngToDivPixel(r.toGoogle(e.map.coordType)) ?? F.ZERO;
|
|
4808
4801
|
},
|
|
4809
4802
|
fromOverlayPointToLatLng(r) {
|
|
4810
|
-
return y.fromGoogle(e.google.getProjection().fromDivPixelToLatLng(new google.maps.Point(r.x, r.y)) ??
|
|
4803
|
+
return y.fromGoogle(e.google.getProjection().fromDivPixelToLatLng(new google.maps.Point(r.x, r.y)) ?? ee.LATLNG_ZERO, e.map.coordType);
|
|
4811
4804
|
}
|
|
4812
4805
|
};
|
|
4813
4806
|
}
|
|
4814
4807
|
return this.google;
|
|
4815
4808
|
}
|
|
4816
4809
|
}
|
|
4817
|
-
class
|
|
4810
|
+
class Ni extends zi {
|
|
4818
4811
|
constructor(e, t, r, s) {
|
|
4819
4812
|
super(e, t), this.content = r, this.position = s;
|
|
4820
4813
|
}
|
|
@@ -4829,11 +4822,11 @@ class $i extends Ai {
|
|
|
4829
4822
|
this.position = e, this.draw();
|
|
4830
4823
|
}
|
|
4831
4824
|
}
|
|
4832
|
-
const
|
|
4825
|
+
const Di = x({
|
|
4833
4826
|
name: "tg-element-overlay",
|
|
4834
4827
|
mixins: [L],
|
|
4835
4828
|
props: {
|
|
4836
|
-
mapPane: G(
|
|
4829
|
+
mapPane: G(Fe, Fe.overlayMouseTarget),
|
|
4837
4830
|
position: z(y)
|
|
4838
4831
|
},
|
|
4839
4832
|
setup() {
|
|
@@ -4855,20 +4848,20 @@ const Ri = x({
|
|
|
4855
4848
|
}
|
|
4856
4849
|
},
|
|
4857
4850
|
onCreate() {
|
|
4858
|
-
this.overlay = new
|
|
4851
|
+
this.overlay = new Ni(this.$map, this, this.content(), this.position), this.$map.addElementOverlay(this.overlay);
|
|
4859
4852
|
},
|
|
4860
4853
|
onDestroy() {
|
|
4861
4854
|
this.$map.removeElementOverlay(this.overlay);
|
|
4862
4855
|
}
|
|
4863
4856
|
});
|
|
4864
|
-
function
|
|
4857
|
+
function Gi(i, e, t, r, s, n) {
|
|
4865
4858
|
return Z(), W("div", le({
|
|
4866
4859
|
class: i.$options.name
|
|
4867
4860
|
}, i.$attrs), [
|
|
4868
4861
|
R(i.$slots, "default")
|
|
4869
4862
|
], 16);
|
|
4870
4863
|
}
|
|
4871
|
-
const
|
|
4864
|
+
const Cs = /* @__PURE__ */ j(Di, [["render", Gi]]), Zi = x({
|
|
4872
4865
|
name: "tg-marker",
|
|
4873
4866
|
mixins: [L],
|
|
4874
4867
|
inheritAttrs: !1,
|
|
@@ -4885,7 +4878,7 @@ const Ts = /* @__PURE__ */ j(Ri, [["render", zi]]), Ni = x({
|
|
|
4885
4878
|
},
|
|
4886
4879
|
setup(i, { attrs: e }) {
|
|
4887
4880
|
return {
|
|
4888
|
-
attrs:
|
|
4881
|
+
attrs: Y(e),
|
|
4889
4882
|
marker: void 0,
|
|
4890
4883
|
label: je(),
|
|
4891
4884
|
info: je()
|
|
@@ -4921,14 +4914,14 @@ const Ts = /* @__PURE__ */ j(Ri, [["render", zi]]), Ni = x({
|
|
|
4921
4914
|
}
|
|
4922
4915
|
},
|
|
4923
4916
|
onCreate() {
|
|
4924
|
-
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),
|
|
4917
|
+
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), U(this.attrs.listeners, this.marker);
|
|
4925
4918
|
},
|
|
4926
4919
|
onDestroy() {
|
|
4927
4920
|
this.$clusterer() ? this.$clusterer().onRemoveMarker(this.marker) : this.$map.removeOverlay(this.marker);
|
|
4928
4921
|
},
|
|
4929
4922
|
methods: {
|
|
4930
4923
|
$clusterer() {
|
|
4931
|
-
return Me(this.$parent,
|
|
4924
|
+
return Me(this.$parent, Ri);
|
|
4932
4925
|
},
|
|
4933
4926
|
onAddLabel(i) {
|
|
4934
4927
|
this.label = i, this.marker && this.marker.setLabel(i.overlay);
|
|
@@ -4947,14 +4940,14 @@ const Ts = /* @__PURE__ */ j(Ri, [["render", zi]]), Ni = x({
|
|
|
4947
4940
|
}
|
|
4948
4941
|
}
|
|
4949
4942
|
});
|
|
4950
|
-
function
|
|
4943
|
+
function Wi(i, e, t, r, s, n) {
|
|
4951
4944
|
return Z(), W("div", le({
|
|
4952
4945
|
class: i.$options.name
|
|
4953
4946
|
}, i.attrs.binds), [
|
|
4954
4947
|
R(i.$slots, "default")
|
|
4955
4948
|
], 16);
|
|
4956
4949
|
}
|
|
4957
|
-
const bt = /* @__PURE__ */ j(
|
|
4950
|
+
const bt = /* @__PURE__ */ j(Zi, [["render", Wi]]), ji = x({
|
|
4958
4951
|
name: "tg-info-box",
|
|
4959
4952
|
mixins: [L],
|
|
4960
4953
|
inheritAttrs: !1,
|
|
@@ -4970,7 +4963,7 @@ const bt = /* @__PURE__ */ j(Ni, [["render", Di]]), Gi = x({
|
|
|
4970
4963
|
emits: void 0,
|
|
4971
4964
|
setup(i, { attrs: e }) {
|
|
4972
4965
|
return {
|
|
4973
|
-
attrs:
|
|
4966
|
+
attrs: Y(e, i),
|
|
4974
4967
|
overlay: void 0
|
|
4975
4968
|
};
|
|
4976
4969
|
},
|
|
@@ -4997,7 +4990,7 @@ const bt = /* @__PURE__ */ j(Ni, [["render", Di]]), Gi = x({
|
|
|
4997
4990
|
onCreate() {
|
|
4998
4991
|
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", () => {
|
|
4999
4992
|
this.$emit("update:show", !1);
|
|
5000
|
-
}),
|
|
4993
|
+
}), U(this.attrs.listeners, this.overlay);
|
|
5001
4994
|
},
|
|
5002
4995
|
onDestroy() {
|
|
5003
4996
|
this.$marker() ? this.$marker().onRemoveInfo(this) : this.overlay.close();
|
|
@@ -5027,14 +5020,14 @@ const bt = /* @__PURE__ */ j(Ni, [["render", Di]]), Gi = x({
|
|
|
5027
5020
|
}
|
|
5028
5021
|
}
|
|
5029
5022
|
});
|
|
5030
|
-
function
|
|
5023
|
+
function Vi(i, e, t, r, s, n) {
|
|
5031
5024
|
return Z(), W("div", le({
|
|
5032
5025
|
class: i.$options.name
|
|
5033
5026
|
}, i.attrs.binds), [
|
|
5034
5027
|
R(i.$slots, "default")
|
|
5035
5028
|
], 16);
|
|
5036
5029
|
}
|
|
5037
|
-
const
|
|
5030
|
+
const xs = /* @__PURE__ */ j(ji, [["render", Vi]]), Hi = x({
|
|
5038
5031
|
name: "tg-info-window",
|
|
5039
5032
|
mixins: [L],
|
|
5040
5033
|
inheritAttrs: !1,
|
|
@@ -5047,7 +5040,7 @@ const Os = /* @__PURE__ */ j(Gi, [["render", Zi]]), Wi = x({
|
|
|
5047
5040
|
},
|
|
5048
5041
|
setup(i, { attrs: e }) {
|
|
5049
5042
|
return {
|
|
5050
|
-
attrs:
|
|
5043
|
+
attrs: Y(e),
|
|
5051
5044
|
overlay: void 0
|
|
5052
5045
|
};
|
|
5053
5046
|
},
|
|
@@ -5090,22 +5083,22 @@ const Os = /* @__PURE__ */ j(Gi, [["render", Zi]]), Wi = x({
|
|
|
5090
5083
|
this.$emit("update:show", !0);
|
|
5091
5084
|
}), this.overlay.addEventListener("close", () => {
|
|
5092
5085
|
this.$emit("update:show", !1);
|
|
5093
|
-
}),
|
|
5086
|
+
}), U(this.attrs.listeners, this.overlay);
|
|
5094
5087
|
},
|
|
5095
5088
|
onDestroy() {
|
|
5096
5089
|
this.$marker() ? this.$marker().onRemoveInfo(this) : this.overlay.close();
|
|
5097
5090
|
}
|
|
5098
5091
|
});
|
|
5099
|
-
function
|
|
5100
|
-
return
|
|
5092
|
+
function Fi(i, e, t, r, s, n) {
|
|
5093
|
+
return Tr((Z(), W("div", le({
|
|
5101
5094
|
class: i.$options.name
|
|
5102
5095
|
}, i.attrs.binds), [
|
|
5103
5096
|
R(i.$slots, "default")
|
|
5104
5097
|
], 16)), [
|
|
5105
|
-
[
|
|
5098
|
+
[Or, i.show]
|
|
5106
5099
|
]);
|
|
5107
5100
|
}
|
|
5108
|
-
const
|
|
5101
|
+
const Es = /* @__PURE__ */ j(Hi, [["render", Fi]]), Ui = x({
|
|
5109
5102
|
name: "tg-label",
|
|
5110
5103
|
mixins: [L],
|
|
5111
5104
|
inheritAttrs: !1,
|
|
@@ -5116,7 +5109,7 @@ const ws = /* @__PURE__ */ j(Wi, [["render", ji]]), Vi = x({
|
|
|
5116
5109
|
},
|
|
5117
5110
|
setup(i, { attrs: e }) {
|
|
5118
5111
|
return {
|
|
5119
|
-
attrs:
|
|
5112
|
+
attrs: Y(e),
|
|
5120
5113
|
overlay: void 0
|
|
5121
5114
|
};
|
|
5122
5115
|
},
|
|
@@ -5155,20 +5148,20 @@ const ws = /* @__PURE__ */ j(Wi, [["render", ji]]), Vi = x({
|
|
|
5155
5148
|
}
|
|
5156
5149
|
},
|
|
5157
5150
|
onCreate() {
|
|
5158
|
-
this.overlay = this.$map.createLabel(this.getOptions()), this.$marker() ? this.$marker().onAddLabel(this) : this.$map.addOverlay(this.overlay),
|
|
5151
|
+
this.overlay = this.$map.createLabel(this.getOptions()), this.$marker() ? this.$marker().onAddLabel(this) : this.$map.addOverlay(this.overlay), U(this.attrs.listeners, this.overlay);
|
|
5159
5152
|
},
|
|
5160
5153
|
onDestroy() {
|
|
5161
5154
|
this.$marker() ? this.$marker().onRemoveLabel(this) : this.$map.removeOverlay(this.overlay);
|
|
5162
5155
|
}
|
|
5163
5156
|
});
|
|
5164
|
-
function
|
|
5157
|
+
function Yi(i, e, t, r, s, n) {
|
|
5165
5158
|
return Z(), W("div", le({
|
|
5166
5159
|
class: i.$options.name
|
|
5167
5160
|
}, i.attrs.binds), [
|
|
5168
5161
|
R(i.$slots, "default")
|
|
5169
5162
|
], 16);
|
|
5170
5163
|
}
|
|
5171
|
-
const
|
|
5164
|
+
const Ls = /* @__PURE__ */ j(Ui, [["render", Yi]]), ks = x({
|
|
5172
5165
|
name: "tg-polygon",
|
|
5173
5166
|
mixins: [L],
|
|
5174
5167
|
inheritAttrs: !1,
|
|
@@ -5185,7 +5178,7 @@ const Cs = /* @__PURE__ */ j(Vi, [["render", Hi]]), xs = x({
|
|
|
5185
5178
|
},
|
|
5186
5179
|
setup(i, { attrs: e }) {
|
|
5187
5180
|
return {
|
|
5188
|
-
attrs:
|
|
5181
|
+
attrs: Y(e),
|
|
5189
5182
|
polygon: void 0
|
|
5190
5183
|
};
|
|
5191
5184
|
},
|
|
@@ -5222,12 +5215,12 @@ const Cs = /* @__PURE__ */ j(Vi, [["render", Hi]]), xs = x({
|
|
|
5222
5215
|
}
|
|
5223
5216
|
},
|
|
5224
5217
|
onCreate() {
|
|
5225
|
-
this.polygon = this.$map.createPolygon(this), this.$map.addOverlay(this.polygon),
|
|
5218
|
+
this.polygon = this.$map.createPolygon(this), this.$map.addOverlay(this.polygon), U(this.attrs.listeners, this.polygon);
|
|
5226
5219
|
},
|
|
5227
5220
|
onDestroy() {
|
|
5228
5221
|
this.$map.removeOverlay(this.polygon);
|
|
5229
5222
|
}
|
|
5230
|
-
}),
|
|
5223
|
+
}), Ps = x({
|
|
5231
5224
|
name: "tg-polyline",
|
|
5232
5225
|
mixins: [L],
|
|
5233
5226
|
inheritAttrs: !1,
|
|
@@ -5242,7 +5235,7 @@ const Cs = /* @__PURE__ */ j(Vi, [["render", Hi]]), xs = x({
|
|
|
5242
5235
|
},
|
|
5243
5236
|
setup(i, { attrs: e }) {
|
|
5244
5237
|
return {
|
|
5245
|
-
attrs:
|
|
5238
|
+
attrs: Y(e),
|
|
5246
5239
|
polyline: void 0
|
|
5247
5240
|
};
|
|
5248
5241
|
},
|
|
@@ -5273,18 +5266,18 @@ const Cs = /* @__PURE__ */ j(Vi, [["render", Hi]]), xs = x({
|
|
|
5273
5266
|
}
|
|
5274
5267
|
},
|
|
5275
5268
|
onCreate() {
|
|
5276
|
-
this.polyline = this.$map.createPolyline(this), this.$map.addOverlay(this.polyline),
|
|
5269
|
+
this.polyline = this.$map.createPolyline(this), this.$map.addOverlay(this.polyline), U(this.attrs.listeners, this.polyline);
|
|
5277
5270
|
},
|
|
5278
5271
|
onDestroy() {
|
|
5279
5272
|
this.$map.removeOverlay(this.polyline);
|
|
5280
5273
|
}
|
|
5281
|
-
}),
|
|
5274
|
+
}), qi = ["beforeUpdate", "updated"], Is = {
|
|
5282
5275
|
install(i, e = {}) {
|
|
5283
5276
|
if (e.enable !== !1) {
|
|
5284
5277
|
const t = x({
|
|
5285
5278
|
beforeCreate() {
|
|
5286
|
-
const r =
|
|
5287
|
-
e.hookNames ? e.hookNames.includes(a) && console.debug("[lifecycle]", r, a) :
|
|
5279
|
+
const r = lr() ?? "", n = (e.nameRegex || /^[A-Z]/).test(r) ? (a) => {
|
|
5280
|
+
e.hookNames ? e.hookNames.includes(a) && console.debug("[lifecycle]", r, a) : qi.includes(a) || console.debug("[lifecycle]", r, a);
|
|
5288
5281
|
} : ue;
|
|
5289
5282
|
n("beforeCreate"), this.__life_impl = n;
|
|
5290
5283
|
},
|
|
@@ -5324,164 +5317,164 @@ const Cs = /* @__PURE__ */ j(Vi, [["render", Hi]]), xs = x({
|
|
|
5324
5317
|
i.mixin(t);
|
|
5325
5318
|
}
|
|
5326
5319
|
}
|
|
5327
|
-
},
|
|
5320
|
+
}, Ki = 6378137;
|
|
5328
5321
|
function pe(i) {
|
|
5329
5322
|
return i * Math.PI / 180;
|
|
5330
5323
|
}
|
|
5331
5324
|
function Bt(i) {
|
|
5332
5325
|
return i * 180 / Math.PI;
|
|
5333
5326
|
}
|
|
5334
|
-
function
|
|
5327
|
+
function Xi(i, e) {
|
|
5335
5328
|
if (i.lat === e.lat && i.lng === e.lng)
|
|
5336
5329
|
return 0;
|
|
5337
5330
|
const t = pe((i.lat + e.lat) / 2), r = pe((i.lat - e.lat) / 2), s = pe((i.lng - e.lng) / 2);
|
|
5338
5331
|
let n = Math.sin(r), a = Math.sin(s), c = Math.sin(t);
|
|
5339
|
-
const o =
|
|
5332
|
+
const o = Ki, l = 1 / 298.257;
|
|
5340
5333
|
n = n * n, a = a * a, c = c * c;
|
|
5341
5334
|
const h = n * (1 - a) + (1 - c) * a, d = (1 - n) * (1 - a) + c * a, u = Math.atan(Math.sqrt(h / d)), _ = Math.sqrt(h * d) / u, b = 2 * u * o, M = (3 * _ - 1) / 2 / d, g = (3 * _ + 1) / 2 / h;
|
|
5342
5335
|
return b * (1 + l * (M * c * (1 - n) - g * (1 - c) * n));
|
|
5343
5336
|
}
|
|
5344
|
-
function
|
|
5337
|
+
function Ji(i, e, t) {
|
|
5345
5338
|
const s = 63567523142e-4, n = 1 / 298.257223563, a = pe(e), c = Math.sin(a), o = Math.cos(a), l = (1 - n) * Math.tan(pe(i.lat)), h = 1 / Math.sqrt(1 + l * l), d = l * h, u = Math.atan2(l, o), _ = h * c, b = 1 - _ * _, M = b * (6378137 * 6378137 - s * s) / (s * s), g = 1 + M / 16384 * (4096 + M * (-768 + M * (320 - 175 * M))), m = M / 1024 * (256 + M * (-128 + M * (74 - 47 * M)));
|
|
5346
5339
|
let v = 0, O = 0, E = 0, w = t / (s * g), q = 2 * Math.PI;
|
|
5347
5340
|
for (; Math.abs(w - q) > 1e-12; ) {
|
|
5348
5341
|
v = Math.cos(2 * u + w), O = Math.sin(w), E = Math.cos(w);
|
|
5349
|
-
const
|
|
5350
|
-
q = w, w = t / (s * g) +
|
|
5342
|
+
const dr = m * O * (v + m / 4 * (E * (-1 + 2 * v * v) - m / 6 * v * (-3 + 4 * O * O) * (-3 + 4 * v * v)));
|
|
5343
|
+
q = w, w = t / (s * g) + dr;
|
|
5351
5344
|
}
|
|
5352
|
-
const
|
|
5345
|
+
const te = d * O - h * E * o, $e = Math.atan2(
|
|
5353
5346
|
d * E + h * O * o,
|
|
5354
|
-
(1 - n) * Math.sqrt(_ * _ +
|
|
5355
|
-
),
|
|
5356
|
-
return { lng: i.lng + Bt(
|
|
5357
|
-
}
|
|
5358
|
-
const
|
|
5359
|
-
getDistance:
|
|
5360
|
-
getDestination:
|
|
5361
|
-
},
|
|
5347
|
+
(1 - n) * Math.sqrt(_ * _ + te * te)
|
|
5348
|
+
), hr = Math.atan2(O * c, h * E - d * O * o), Re = n / 16 * b * (4 + n * (4 - 3 * b)), cr = hr - (1 - Re) * n * _ * (w + Re * O * (v + Re * E * (-1 + 2 * v * v)));
|
|
5349
|
+
return { lng: i.lng + Bt(cr), lat: Bt($e) };
|
|
5350
|
+
}
|
|
5351
|
+
const Bs = {
|
|
5352
|
+
getDistance: Xi,
|
|
5353
|
+
getDestination: Ji
|
|
5354
|
+
}, Ss = {
|
|
5362
5355
|
install(i, e) {
|
|
5363
|
-
|
|
5356
|
+
Wr(e), i.config.unwrapInjectedRef = !0;
|
|
5364
5357
|
const t = i.config.optionMergeStrategies;
|
|
5365
5358
|
t[ve] = t[_e] = (r, s) => r ? [...new Set([].concat(r, s))] : Array.isArray(s) ? s : [s];
|
|
5366
5359
|
}
|
|
5367
5360
|
};
|
|
5368
5361
|
export {
|
|
5369
|
-
|
|
5362
|
+
jt as AbstractControl,
|
|
5370
5363
|
rt as AbstractMap,
|
|
5371
5364
|
xe as Arrays,
|
|
5372
|
-
|
|
5373
|
-
|
|
5365
|
+
qt as Autocomplete,
|
|
5366
|
+
Xr as BaiduAutocomplete,
|
|
5374
5367
|
ot as BaiduCircle,
|
|
5375
5368
|
Ye as BaiduControl,
|
|
5376
5369
|
dt as BaiduInfoBoxOverlay,
|
|
5377
5370
|
ht as BaiduInfoWindow,
|
|
5378
|
-
|
|
5371
|
+
Ke as BaiduMapTypeControl,
|
|
5379
5372
|
ye as BaiduMarker,
|
|
5380
|
-
|
|
5373
|
+
ri as BaiduMarkerClusterer,
|
|
5381
5374
|
Ae as BaiduOverlay,
|
|
5382
|
-
|
|
5375
|
+
ni as BaiduPlacesService,
|
|
5383
5376
|
ft as BaiduPolygon,
|
|
5384
5377
|
vt as BaiduPolyline,
|
|
5385
5378
|
Xe as BaiduScaleControl,
|
|
5386
|
-
|
|
5379
|
+
ai as BaiduSearchBox,
|
|
5387
5380
|
Qe as BaiduZoomControl,
|
|
5388
5381
|
xt as CachedValue,
|
|
5389
|
-
|
|
5382
|
+
k as ControlPosition,
|
|
5390
5383
|
B as ControlPositionConverter,
|
|
5391
|
-
|
|
5392
|
-
|
|
5393
|
-
|
|
5394
|
-
|
|
5384
|
+
J as CoordType,
|
|
5385
|
+
Ur as CustomControl,
|
|
5386
|
+
Fr as FastFindValues,
|
|
5387
|
+
Kr as GoogleAutocomplete,
|
|
5395
5388
|
at as GoogleCircle,
|
|
5396
|
-
|
|
5389
|
+
qe as GoogleControl,
|
|
5397
5390
|
pt as GoogleInfoBoxOverlay,
|
|
5398
5391
|
ct as GoogleInfoWindow,
|
|
5399
5392
|
Oe as GoogleMapTypeControl,
|
|
5400
5393
|
mt as GoogleMarker,
|
|
5401
|
-
|
|
5394
|
+
ii as GoogleMarkerClusterer,
|
|
5402
5395
|
it as GoogleOverlay,
|
|
5403
|
-
|
|
5396
|
+
si as GooglePlacesService,
|
|
5404
5397
|
yt as GooglePolygon,
|
|
5405
5398
|
_t as GooglePolyline,
|
|
5406
5399
|
Je as GoogleScaleControl,
|
|
5407
|
-
|
|
5400
|
+
oi as GoogleSearchBox,
|
|
5408
5401
|
et as GoogleZoomControl,
|
|
5409
|
-
|
|
5402
|
+
Pe as Icon,
|
|
5410
5403
|
lt as InfoWindow,
|
|
5411
5404
|
Ct as KeyValue,
|
|
5412
5405
|
y as LatLng,
|
|
5413
|
-
|
|
5414
|
-
|
|
5406
|
+
V as LatLngBounds,
|
|
5407
|
+
Is as LifecycleLogPlugin,
|
|
5415
5408
|
ve as MIXIN_HOOK_CREATE,
|
|
5416
5409
|
_e as MIXIN_HOOK_DESTROY,
|
|
5417
5410
|
Mt as MIXIN_MAP_NAME,
|
|
5418
5411
|
Ee as MVCArrays,
|
|
5419
5412
|
L as MapMixin,
|
|
5420
|
-
|
|
5421
|
-
|
|
5422
|
-
|
|
5413
|
+
Ht as MapTypeControlType,
|
|
5414
|
+
li as MapZoom,
|
|
5415
|
+
tr as MarkerClusterer,
|
|
5423
5416
|
me as Objects,
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
|
|
5427
|
-
|
|
5428
|
-
|
|
5417
|
+
nr as Overlay,
|
|
5418
|
+
rr as PlacesService,
|
|
5419
|
+
F as Point,
|
|
5420
|
+
ir as SearchBox,
|
|
5421
|
+
Bs as SphericalUtils,
|
|
5429
5422
|
fe as Strings,
|
|
5430
5423
|
Ie as SymbolIcon,
|
|
5431
|
-
|
|
5432
|
-
|
|
5433
|
-
|
|
5434
|
-
|
|
5435
|
-
|
|
5436
|
-
|
|
5437
|
-
|
|
5438
|
-
|
|
5439
|
-
|
|
5424
|
+
ps as SymbolPath,
|
|
5425
|
+
ws as TgCircle,
|
|
5426
|
+
_s as TgCustomControl,
|
|
5427
|
+
Cs as TgElementOverlay,
|
|
5428
|
+
xs as TgInfoBox,
|
|
5429
|
+
Es as TgInfoWindow,
|
|
5430
|
+
Ls as TgLabel,
|
|
5431
|
+
Ei as TgMap,
|
|
5432
|
+
He as TgMapFactory,
|
|
5440
5433
|
$ as TgMapType,
|
|
5441
|
-
|
|
5442
|
-
|
|
5434
|
+
Ms as TgMapTypeControl,
|
|
5435
|
+
vs as TgMapWidget,
|
|
5443
5436
|
bt as TgMarker,
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
|
|
5447
|
-
|
|
5448
|
-
|
|
5449
|
-
|
|
5450
|
-
|
|
5437
|
+
Ri as TgMarkerClusterer,
|
|
5438
|
+
ks as TgPolygon,
|
|
5439
|
+
Ps as TgPolyline,
|
|
5440
|
+
bs as TgScaleControl,
|
|
5441
|
+
Os as TgTrafficLayer,
|
|
5442
|
+
Ts as TgZoomControl,
|
|
5443
|
+
ke as UnionIcon,
|
|
5451
5444
|
se as assert,
|
|
5452
5445
|
Ze as assertNever,
|
|
5453
5446
|
Te as callHook,
|
|
5454
|
-
|
|
5455
|
-
|
|
5456
|
-
|
|
5457
|
-
|
|
5458
|
-
|
|
5459
|
-
|
|
5460
|
-
|
|
5447
|
+
us as computedSaveOnThis,
|
|
5448
|
+
ar as createEmptyVNode,
|
|
5449
|
+
Oi as createPropertyObject,
|
|
5450
|
+
gs as createPropertyObjectTyped,
|
|
5451
|
+
is as debug,
|
|
5452
|
+
Ss as default,
|
|
5453
|
+
ys as eventLogMethods,
|
|
5461
5454
|
N as eventProp,
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
|
|
5467
|
-
|
|
5468
|
-
|
|
5455
|
+
fs as extractVNodeFromSlotsByComponent,
|
|
5456
|
+
ms as findByComponentType,
|
|
5457
|
+
Ji as getDestination,
|
|
5458
|
+
Gt as getTgMapConfig,
|
|
5459
|
+
ss as isDef,
|
|
5460
|
+
os as isInstanceOf,
|
|
5461
|
+
ns as lateinit,
|
|
5469
5462
|
ue as noop,
|
|
5470
5463
|
f as optionalProp,
|
|
5471
|
-
|
|
5464
|
+
ui as path,
|
|
5472
5465
|
z as requiredProp,
|
|
5473
|
-
|
|
5466
|
+
as as safeAs,
|
|
5474
5467
|
Me as safeAsComponent,
|
|
5475
|
-
|
|
5476
|
-
|
|
5468
|
+
Wr as setTgMapConfig,
|
|
5469
|
+
wi as splitAttrs,
|
|
5477
5470
|
G as stringEnumProp,
|
|
5478
|
-
|
|
5471
|
+
Ti as stringUnionPropFromValues,
|
|
5479
5472
|
C as throwError,
|
|
5480
|
-
|
|
5481
|
-
|
|
5473
|
+
Rt as throwUnsupported,
|
|
5474
|
+
rs as todo,
|
|
5482
5475
|
je as typed,
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
|
|
5476
|
+
ls as unwrapStringEnumValue,
|
|
5477
|
+
Y as useSplittedAttrs,
|
|
5478
|
+
Si as useTgMap
|
|
5486
5479
|
};
|
|
5487
5480
|
//# sourceMappingURL=tg-map.js.map
|