tg-map-vue3 3.7.8 → 3.7.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/dist/src/components/controls/TgStreetViewControl.vue.d.ts +19 -0
- package/dist/src/components/index.d.ts +4 -1
- package/dist/src/map/map/baidu-map.d.ts +2 -0
- package/dist/src/map/map/controls/control.d.ts +13 -0
- package/dist/src/map/map/controls/street-view.control.d.ts +20 -0
- package/dist/src/map/map/google-map.d.ts +2 -0
- package/dist/src/map/map/here-map.d.ts +2 -0
- package/dist/src/map/map/map.d.ts +2 -0
- package/dist/src/map/unions.d.ts +1 -0
- package/dist/tg-map.js +716 -657
- 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 +1 -1
package/dist/tg-map.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode('.baidu-info-box-container{transform:translateY(-11px);font-size:13px;font-weight:300;width:100vw}.baidu-info-box-container__border{position:absolute;padding:12px;background-color:#fff;box-shadow:0 2px 7px 1px #0000004d;border-radius:8px;transform:translate(-50%,-100%)}.baidu-info-box-container__inner{overflow:auto}.baidu-info-box-container__close{position:absolute;right:-6px;top:-6px;width:14px;height:14px;margin:8px;opacity:.6;cursor:pointer}.baidu-info-box-container__close:hover{opacity:1}.baidu-info-box-container:after{position:absolute;background-color:#fff;content:"";width:15px;height:15px;left:0px;top:0px;box-shadow:-2px 2px 2px #b2b2b266;transform:translate(-50%,-50%) rotate(-45deg)}.element-overlay{position:absolute}.tg-map{height:100%;position:relative}.tg-map__map{width:100%;height:100%}.tg-map__map--hide-logo-google .gm-style a[target=_blank]:has(> div > img){display:none!important}.tg-map__map--hide-logo-google .gm-style>div:last-child>div:last-child>div{display:none}.tg-map__map--hide-logo-baidu div.anchorBL>a[target=_blank]>img{display:none}.tg-map__map--hide-logo-baidu div.BMap_cpyCtrl{display:none}.tg-map-widget{position:absolute}.tg-map>.tg-custom-control{display:none}.tg-map .tg-element-overlay{display:none}.tg-map__map .tg-element-overlay{display:block}.tg-map .tg-info-box{display:none}.tg-map__map .tg-info-box{display:block}.tg-map .tg-label{display:none}.tg-map__map .tg-label{display:block}')),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var c = (i, t, e) => (
|
|
5
|
-
import { createCommentVNode as
|
|
2
|
+
var zr = Object.defineProperty;
|
|
3
|
+
var Dr = (i, t, e) => t in i ? zr(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
4
|
+
var c = (i, t, e) => (Dr(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
5
|
+
import { createCommentVNode as st, computed as rr, defineComponent as O, markRaw as Nr, watch as dt, openBlock as F, createElementBlock as U, mergeProps as me, createElementVNode as Gr, normalizeClass as Ve, renderSlot as W, normalizeStyle as Zr, getCurrentInstance as Wr, inject as Hr, onMounted as jr, onBeforeUnmount as Vr, toRaw as Fe, withDirectives as Fr, vShow as Ur } from "vue";
|
|
6
6
|
function Y(i, t, e) {
|
|
7
7
|
Object.keys(i).forEach((r) => {
|
|
8
8
|
r.startsWith("update:") || e != null && e.includes(r) || t.addEventListener(r, i[r]);
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
|
-
let
|
|
12
|
-
function
|
|
13
|
-
return
|
|
11
|
+
let Yr = 1;
|
|
12
|
+
function qr() {
|
|
13
|
+
return Yr++;
|
|
14
14
|
}
|
|
15
15
|
function $e(i, t) {
|
|
16
|
-
return t.__id__ || (t.__id__ =
|
|
16
|
+
return t.__id__ || (t.__id__ = qr()), `${i}::${t.__id__}`;
|
|
17
17
|
}
|
|
18
|
-
var
|
|
19
|
-
function
|
|
18
|
+
var ir = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
19
|
+
function ut(i) {
|
|
20
20
|
return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
|
|
21
21
|
}
|
|
22
|
-
var
|
|
22
|
+
var sr = { exports: {} };
|
|
23
23
|
(function(i) {
|
|
24
24
|
(function(t, e) {
|
|
25
25
|
i.exports ? i.exports = e() : t.coordtransform = e();
|
|
26
|
-
})(
|
|
26
|
+
})(ir, function() {
|
|
27
27
|
var t = 52.35987755982988, e = 3.141592653589793, r = 6378245, s = 0.006693421622965943;
|
|
28
|
-
function n(g, y, b,
|
|
29
|
-
this.west = Math.min(g, b), this.north = Math.max(y,
|
|
28
|
+
function n(g, y, b, C) {
|
|
29
|
+
this.west = Math.min(g, b), this.north = Math.max(y, C), this.east = Math.max(g, b), this.south = Math.min(y, C);
|
|
30
30
|
}
|
|
31
31
|
n.prototype.contain = function(g, y) {
|
|
32
32
|
return this.west <= g && this.east >= g && this.north >= y && this.south <= y;
|
|
@@ -50,20 +50,20 @@ var er = { exports: {} };
|
|
|
50
50
|
function o(g, y) {
|
|
51
51
|
for (var b = 0; b < a.length; b++)
|
|
52
52
|
if (a[b].contain(g, y)) {
|
|
53
|
-
for (var
|
|
54
|
-
if (d[
|
|
53
|
+
for (var C = 0; C < d.length; C++)
|
|
54
|
+
if (d[C].contain(g, y))
|
|
55
55
|
return !1;
|
|
56
56
|
return !0;
|
|
57
57
|
}
|
|
58
58
|
return !1;
|
|
59
59
|
}
|
|
60
60
|
function l(g, y) {
|
|
61
|
-
var b = g - 65e-4,
|
|
61
|
+
var b = g - 65e-4, C = y - 6e-3, I = Math.sqrt(b * b + C * C) - 2e-5 * Math.sin(C * t), E = Math.atan2(C, b) - 3e-6 * Math.cos(b * t), ee = I * Math.cos(E), se = I * Math.sin(E);
|
|
62
62
|
return [ee, se];
|
|
63
63
|
}
|
|
64
64
|
function h(g, y) {
|
|
65
|
-
var b = Math.sqrt(g * g + y * y) + 2e-5 * Math.sin(y * t),
|
|
66
|
-
return [
|
|
65
|
+
var b = Math.sqrt(g * g + y * y) + 2e-5 * Math.sin(y * t), C = Math.atan2(y, g) + 3e-6 * Math.cos(g * t), I = b * Math.cos(C) + 65e-4, E = b * Math.sin(C) + 6e-3;
|
|
66
|
+
return [I, E];
|
|
67
67
|
}
|
|
68
68
|
function u(g, y) {
|
|
69
69
|
return o(g, y) ? f(g, y) : [g, y];
|
|
@@ -75,12 +75,12 @@ var er = { exports: {} };
|
|
|
75
75
|
return [g * 2 - b[0], y * 2 - b[1]];
|
|
76
76
|
}
|
|
77
77
|
function f(g, y) {
|
|
78
|
-
var b = _(g - 105, y - 35),
|
|
78
|
+
var b = _(g - 105, y - 35), C = T(g - 105, y - 35), I = y / 180 * e, E = Math.sin(I);
|
|
79
79
|
E = 1 - s * E * E;
|
|
80
80
|
var ee = Math.sqrt(E);
|
|
81
|
-
b = b * 180 / (r * (1 - s) / (E * ee) * e),
|
|
82
|
-
var se = y + b,
|
|
83
|
-
return [
|
|
81
|
+
b = b * 180 / (r * (1 - s) / (E * ee) * e), C = C * 180 / (r / ee * Math.cos(I) * e);
|
|
82
|
+
var se = y + b, Je = g + C;
|
|
83
|
+
return [Je, se];
|
|
84
84
|
}
|
|
85
85
|
function _(g, y) {
|
|
86
86
|
var b = -100 + 2 * g + 3 * y + 0.2 * y * y + 0.1 * g * y + 0.2 * Math.sqrt(Math.abs(g));
|
|
@@ -115,73 +115,73 @@ var er = { exports: {} };
|
|
|
115
115
|
}
|
|
116
116
|
};
|
|
117
117
|
});
|
|
118
|
-
})(
|
|
119
|
-
var
|
|
120
|
-
const ne = /* @__PURE__ */
|
|
118
|
+
})(sr);
|
|
119
|
+
var Kr = sr.exports;
|
|
120
|
+
const ne = /* @__PURE__ */ ut(Kr);
|
|
121
121
|
function ae(i, t) {
|
|
122
122
|
if (!i)
|
|
123
123
|
throw new Error(`AssertionError: ${t}`);
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function nt(i) {
|
|
126
126
|
throw new Error(`Unexpected object: ${i}`);
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function js() {
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function ot(i) {
|
|
131
131
|
return i;
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function Vs(i, t) {
|
|
134
134
|
return i instanceof t;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function Fs(i, t) {
|
|
137
137
|
if (i instanceof t)
|
|
138
138
|
return i;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function at(i, t) {
|
|
141
141
|
return (i == null ? void 0 : i.$options.name) === t.name;
|
|
142
142
|
}
|
|
143
|
-
function
|
|
144
|
-
return
|
|
143
|
+
function nr(i, t) {
|
|
144
|
+
return at(i, t) ? i : void 0;
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function pt(i, t, e) {
|
|
147
147
|
let r = t;
|
|
148
148
|
for (; r; ) {
|
|
149
|
-
if (
|
|
149
|
+
if (at(r, i))
|
|
150
150
|
return r;
|
|
151
|
-
if (e &&
|
|
151
|
+
if (e && at(r, e))
|
|
152
152
|
return;
|
|
153
153
|
r = r.$parent;
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function Us(i) {
|
|
157
157
|
return i;
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function w(i) {
|
|
160
160
|
throw new Error(i);
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function gt(i) {
|
|
163
163
|
throw new Error(`Unsupported: ${i}`);
|
|
164
164
|
}
|
|
165
|
-
function
|
|
165
|
+
function Ys(i) {
|
|
166
166
|
throw new Error(`todo: ${i}`);
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function qs(i) {
|
|
169
169
|
return i;
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function Ce(...i) {
|
|
172
172
|
}
|
|
173
|
-
function
|
|
173
|
+
function Ks(i) {
|
|
174
174
|
return i != null;
|
|
175
175
|
}
|
|
176
|
-
function
|
|
176
|
+
function Xr(i) {
|
|
177
177
|
return i[1] != null;
|
|
178
178
|
}
|
|
179
|
-
function
|
|
179
|
+
function Jr(i) {
|
|
180
180
|
let t = null;
|
|
181
181
|
return () => t ?? (t = i().catch((e) => (t = null, Promise.reject(e))));
|
|
182
182
|
}
|
|
183
|
-
var
|
|
184
|
-
const
|
|
183
|
+
var P = /* @__PURE__ */ ((i) => (i.wgs84 = "wgs84", i.gcj02 = "gcj02", i.bd09 = "bd09", i))(P || {});
|
|
184
|
+
const et = "wgs84", k = class {
|
|
185
185
|
constructor(t, e, r) {
|
|
186
186
|
this.lat = t, this.lng = e, this.coord = r;
|
|
187
187
|
}
|
|
@@ -203,23 +203,23 @@ const Qe = "wgs84", I = class {
|
|
|
203
203
|
}
|
|
204
204
|
/** @param coord Baidu Map的坐标一般都是bd09 */
|
|
205
205
|
static fromBaidu(t, e) {
|
|
206
|
-
return new
|
|
206
|
+
return new k(t.lat, t.lng, e);
|
|
207
207
|
}
|
|
208
208
|
/** @param coord Google Map的坐标依据地图类型不同是不一样的 */
|
|
209
209
|
static fromGoogle(t, e) {
|
|
210
|
-
return new
|
|
210
|
+
return new k(t.lat(), t.lng(), e);
|
|
211
211
|
}
|
|
212
212
|
static fromHere(t, e) {
|
|
213
|
-
return new
|
|
213
|
+
return new k(t.lat, t.lng, e);
|
|
214
214
|
}
|
|
215
215
|
static fromLiteral(t) {
|
|
216
|
-
return new
|
|
216
|
+
return new k(t.lat, t.lng, t.coord || et);
|
|
217
217
|
}
|
|
218
|
-
static fromLngLat(t, e, r =
|
|
219
|
-
return new
|
|
218
|
+
static fromLngLat(t, e, r = et) {
|
|
219
|
+
return new k(e, t, r);
|
|
220
220
|
}
|
|
221
|
-
static create(t, e, r =
|
|
222
|
-
return new
|
|
221
|
+
static create(t, e, r = et) {
|
|
222
|
+
return new k(t, e, r);
|
|
223
223
|
}
|
|
224
224
|
/** 转换坐标到指定坐标系 */
|
|
225
225
|
to(t) {
|
|
@@ -227,7 +227,7 @@ const Qe = "wgs84", I = class {
|
|
|
227
227
|
if (this.coord === e)
|
|
228
228
|
return this;
|
|
229
229
|
const [r, s] = this._convert(e);
|
|
230
|
-
return new
|
|
230
|
+
return new k(s, r, e);
|
|
231
231
|
}
|
|
232
232
|
/**
|
|
233
233
|
* TODO: normalize要不要默认设为true, 和google的行为保持一致?
|
|
@@ -237,7 +237,7 @@ const Qe = "wgs84", I = class {
|
|
|
237
237
|
*/
|
|
238
238
|
toBaidu(t, e = !1) {
|
|
239
239
|
let r = this.lat, s = this.lng;
|
|
240
|
-
return this.coord !== t && ([s, r] = this._convert(t)), e && ([s, r] =
|
|
240
|
+
return this.coord !== t && ([s, r] = this._convert(t)), e && ([s, r] = k._normalize(s, r)), new BMap.Point(s, r);
|
|
241
241
|
}
|
|
242
242
|
/**
|
|
243
243
|
* 转换成google的经纬度, 内部会自动进行标准化
|
|
@@ -276,8 +276,8 @@ const Qe = "wgs84", I = class {
|
|
|
276
276
|
* @see _normalize {@macro latlng_normalize}
|
|
277
277
|
*/
|
|
278
278
|
normalize() {
|
|
279
|
-
const [t, e] =
|
|
280
|
-
return e === this.lat && t === this.lng ? this : new
|
|
279
|
+
const [t, e] = k._normalize(this.lng, this.lat);
|
|
280
|
+
return e === this.lat && t === this.lng ? this : new k(e, t, this.coord);
|
|
281
281
|
}
|
|
282
282
|
equals(t) {
|
|
283
283
|
return this === t ? !0 : this.lat === t.lat && this.lng === t.lng && this.coord === t.coord;
|
|
@@ -286,8 +286,8 @@ const Qe = "wgs84", I = class {
|
|
|
286
286
|
return JSON.stringify(this);
|
|
287
287
|
}
|
|
288
288
|
};
|
|
289
|
-
let v =
|
|
290
|
-
c(v, "ZERO",
|
|
289
|
+
let v = k;
|
|
290
|
+
c(v, "ZERO", k.create(0, 0));
|
|
291
291
|
const re = class {
|
|
292
292
|
/**
|
|
293
293
|
* 不推荐直接创建LatLngBounds, sw和ne的大小关系可能没法保证, 推荐用LatLngBounds.Builder或者LatLngBounds.from等静态方法来创建
|
|
@@ -310,7 +310,7 @@ const re = class {
|
|
|
310
310
|
return e.build();
|
|
311
311
|
}
|
|
312
312
|
static from(...t) {
|
|
313
|
-
return this.fromArray(t) ??
|
|
313
|
+
return this.fromArray(t) ?? w("positions中没有点");
|
|
314
314
|
}
|
|
315
315
|
static fromGoogle(t, e) {
|
|
316
316
|
return new re(
|
|
@@ -415,13 +415,13 @@ var V;
|
|
|
415
415
|
}
|
|
416
416
|
i.getCoordType = e;
|
|
417
417
|
})(V || (V = {}));
|
|
418
|
-
var
|
|
418
|
+
var lt;
|
|
419
419
|
((i) => {
|
|
420
420
|
function t(e) {
|
|
421
421
|
return e.scrollWidth > e.clientWidth || e.scrollHeight > e.clientHeight;
|
|
422
422
|
}
|
|
423
423
|
i.isScrollable = t;
|
|
424
|
-
})(
|
|
424
|
+
})(lt || (lt = {}));
|
|
425
425
|
var he;
|
|
426
426
|
((i) => {
|
|
427
427
|
function t(d, o) {
|
|
@@ -481,19 +481,19 @@ var ce;
|
|
|
481
481
|
}
|
|
482
482
|
i.listenChanged = r;
|
|
483
483
|
})(ce || (ce = {}));
|
|
484
|
-
function
|
|
484
|
+
function or(i, t, e) {
|
|
485
485
|
return i.addListener(t, e).remove;
|
|
486
486
|
}
|
|
487
|
-
function
|
|
487
|
+
function Qr(i, t, e) {
|
|
488
488
|
return i.addEventListener(t, e), () => i.removeEventListener(t, e);
|
|
489
489
|
}
|
|
490
|
-
function
|
|
490
|
+
function ei(i, t, e, r) {
|
|
491
491
|
return i.addEventListener(t, e, r), () => i.removeEventListener(t, e, r);
|
|
492
492
|
}
|
|
493
|
-
function
|
|
493
|
+
function Ut(i, t, e) {
|
|
494
494
|
return i.addEventListener(t, e), () => i.removeEventListener(t, e);
|
|
495
495
|
}
|
|
496
|
-
class
|
|
496
|
+
class ar {
|
|
497
497
|
constructor(t, e) {
|
|
498
498
|
c(this, "eventMap", /* @__PURE__ */ new Map());
|
|
499
499
|
c(this, "target", void 0);
|
|
@@ -505,7 +505,7 @@ class ir {
|
|
|
505
505
|
}
|
|
506
506
|
class Ue {
|
|
507
507
|
constructor(t, e) {
|
|
508
|
-
c(this, "eventHub", new
|
|
508
|
+
c(this, "eventHub", new lr());
|
|
509
509
|
this.delegate = t, this.options = e;
|
|
510
510
|
}
|
|
511
511
|
notify(t) {
|
|
@@ -532,14 +532,14 @@ class Ue {
|
|
|
532
532
|
this.delegate.removeEventListener(t, e);
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
|
-
const
|
|
535
|
+
const Ft = class extends ar {
|
|
536
536
|
addEventListener(t, e) {
|
|
537
537
|
const r = $e(t, e);
|
|
538
538
|
if (this.eventMap.get(r)) {
|
|
539
539
|
console.warn("listener已经添加过了", r, e);
|
|
540
540
|
return;
|
|
541
541
|
}
|
|
542
|
-
const s = this.inner.addListener(
|
|
542
|
+
const s = this.inner.addListener(Ft.EVENT_TYPE_MAP[t] || t, (n) => {
|
|
543
543
|
const a = {
|
|
544
544
|
type: t,
|
|
545
545
|
target: this.target,
|
|
@@ -554,7 +554,7 @@ const Zt = class extends ir {
|
|
|
554
554
|
s ? (s.remove(), this.eventMap.delete(r)) : console.warn("移除失败, 不存在该listener", r, e);
|
|
555
555
|
}
|
|
556
556
|
};
|
|
557
|
-
let ie =
|
|
557
|
+
let ie = Ft;
|
|
558
558
|
// 事件类型映射: tg => google
|
|
559
559
|
c(ie, "EVENT_TYPE_MAP", {
|
|
560
560
|
"center-changed": "center_changed",
|
|
@@ -572,7 +572,7 @@ c(ie, "EVENT_TYPE_MAP", {
|
|
|
572
572
|
"map-mouseup": "mouseup",
|
|
573
573
|
"map-dblclick": "dblclick"
|
|
574
574
|
});
|
|
575
|
-
const We = class extends
|
|
575
|
+
const We = class extends ar {
|
|
576
576
|
addEventListener(t, e) {
|
|
577
577
|
const r = $e(t, e);
|
|
578
578
|
if (this.eventMap.get(r)) {
|
|
@@ -605,7 +605,7 @@ c(le, "EVENT_TYPE_MAP", {
|
|
|
605
605
|
"zoom-changed": "zoomend",
|
|
606
606
|
"map-type-changed": "maptypechange"
|
|
607
607
|
});
|
|
608
|
-
class
|
|
608
|
+
class lr {
|
|
609
609
|
constructor() {
|
|
610
610
|
c(this, "typeMap", /* @__PURE__ */ new Map());
|
|
611
611
|
}
|
|
@@ -626,7 +626,7 @@ class sr {
|
|
|
626
626
|
e && e.forEach((r) => r.call(t.target, t));
|
|
627
627
|
}
|
|
628
628
|
}
|
|
629
|
-
class
|
|
629
|
+
class Yt {
|
|
630
630
|
/**
|
|
631
631
|
* `keys`和`values`数组中可以有相同的值, 若存在相同值, 则index越小的优先级越高
|
|
632
632
|
*/
|
|
@@ -638,13 +638,13 @@ class Ht {
|
|
|
638
638
|
this.keyToValue.set(t[r], e[r]), this.valueToKey.set(e[r], t[r]);
|
|
639
639
|
}
|
|
640
640
|
toKey(t) {
|
|
641
|
-
return this.valueToKey.get(t) ??
|
|
641
|
+
return this.valueToKey.get(t) ?? w();
|
|
642
642
|
}
|
|
643
643
|
toValue(t) {
|
|
644
|
-
return this.keyToValue.get(t) ??
|
|
644
|
+
return this.keyToValue.get(t) ?? w();
|
|
645
645
|
}
|
|
646
646
|
}
|
|
647
|
-
class
|
|
647
|
+
class ti {
|
|
648
648
|
constructor(t, e = 10) {
|
|
649
649
|
c(this, "map", /* @__PURE__ */ new Map());
|
|
650
650
|
this.values = t, this.maxSize4Debug = e;
|
|
@@ -670,7 +670,7 @@ class Jr {
|
|
|
670
670
|
return this.getValueMap(t).get(e);
|
|
671
671
|
}
|
|
672
672
|
get(t, e) {
|
|
673
|
-
return this.getOrNull(t, e) ??
|
|
673
|
+
return this.getOrNull(t, e) ?? w(`key(${e})不存在与valueMap(${this.getValueMap(t)})中`);
|
|
674
674
|
}
|
|
675
675
|
}
|
|
676
676
|
class _e {
|
|
@@ -682,7 +682,7 @@ class _e {
|
|
|
682
682
|
return this.value === void 0 && (this.value = this.creator()), this.value;
|
|
683
683
|
}
|
|
684
684
|
}
|
|
685
|
-
var
|
|
685
|
+
var x = /* @__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))(x || {}), D;
|
|
686
686
|
((i) => {
|
|
687
687
|
let t, e;
|
|
688
688
|
const r = [
|
|
@@ -701,7 +701,7 @@ var S = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
|
|
|
701
701
|
/* RIGHT_BOTTOM */
|
|
702
702
|
];
|
|
703
703
|
function s() {
|
|
704
|
-
return t || (t = new
|
|
704
|
+
return t || (t = new Yt(r, [
|
|
705
705
|
/* | @tg/map |名字相同| baidu | */
|
|
706
706
|
/* TOP_LEFT = */
|
|
707
707
|
BMAP_ANCHOR_TOP_LEFT,
|
|
@@ -731,7 +731,7 @@ var S = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
|
|
|
731
731
|
}
|
|
732
732
|
i.getBaidu = s;
|
|
733
733
|
function n() {
|
|
734
|
-
return e || (e = new
|
|
734
|
+
return e || (e = new Yt(r, [
|
|
735
735
|
google.maps.ControlPosition.TOP_LEFT,
|
|
736
736
|
google.maps.ControlPosition.TOP_CENTER,
|
|
737
737
|
google.maps.ControlPosition.TOP_RIGHT,
|
|
@@ -747,17 +747,38 @@ var S = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
|
|
|
747
747
|
])), e;
|
|
748
748
|
}
|
|
749
749
|
i.getGoogle = n;
|
|
750
|
-
})(
|
|
751
|
-
class
|
|
750
|
+
})(D || (D = {}));
|
|
751
|
+
class ri {
|
|
752
752
|
constructor(t) {
|
|
753
753
|
/** 实际添加到地图中的control对象 */
|
|
754
754
|
c(this, "inner");
|
|
755
755
|
this.position = t;
|
|
756
756
|
}
|
|
757
757
|
}
|
|
758
|
-
class
|
|
758
|
+
class mt {
|
|
759
759
|
}
|
|
760
|
-
class
|
|
760
|
+
class ii extends mt {
|
|
761
|
+
constructor(t, e) {
|
|
762
|
+
super(), this.visible = t, this.position = e;
|
|
763
|
+
}
|
|
764
|
+
isVisible() {
|
|
765
|
+
return this.visible;
|
|
766
|
+
}
|
|
767
|
+
setVisible(t) {
|
|
768
|
+
this.visible = t;
|
|
769
|
+
}
|
|
770
|
+
getPosition() {
|
|
771
|
+
return this.position;
|
|
772
|
+
}
|
|
773
|
+
setPosition(t) {
|
|
774
|
+
this.position = t;
|
|
775
|
+
}
|
|
776
|
+
addTo(t) {
|
|
777
|
+
}
|
|
778
|
+
removeFrom(t) {
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
class ft extends mt {
|
|
761
782
|
constructor(t, e) {
|
|
762
783
|
super(), this.inner = t, this.position = e;
|
|
763
784
|
}
|
|
@@ -768,10 +789,10 @@ class pt extends nr {
|
|
|
768
789
|
t ? this.inner.show() : this.inner.hide();
|
|
769
790
|
}
|
|
770
791
|
getPosition() {
|
|
771
|
-
return this.position ??
|
|
792
|
+
return this.position ?? D.getBaidu().toKey(this.inner.getAnchor());
|
|
772
793
|
}
|
|
773
794
|
setPosition(t) {
|
|
774
|
-
this.position = t, this.inner.setAnchor(
|
|
795
|
+
this.position = t, this.inner.setAnchor(D.getBaidu().toValue(t));
|
|
775
796
|
}
|
|
776
797
|
addTo(t) {
|
|
777
798
|
t.innerMap.addControl(this.inner);
|
|
@@ -780,7 +801,7 @@ class pt extends nr {
|
|
|
780
801
|
t.innerMap.removeControl(this.inner);
|
|
781
802
|
}
|
|
782
803
|
}
|
|
783
|
-
class
|
|
804
|
+
class Ye extends mt {
|
|
784
805
|
constructor(e, r) {
|
|
785
806
|
super();
|
|
786
807
|
c(this, "visible", !1);
|
|
@@ -807,7 +828,7 @@ class gt extends nr {
|
|
|
807
828
|
}
|
|
808
829
|
onCreateOptions() {
|
|
809
830
|
return {
|
|
810
|
-
position:
|
|
831
|
+
position: D.getGoogle().toValue(this.position)
|
|
811
832
|
};
|
|
812
833
|
}
|
|
813
834
|
tryUpdateOptions() {
|
|
@@ -817,7 +838,7 @@ class gt extends nr {
|
|
|
817
838
|
});
|
|
818
839
|
}
|
|
819
840
|
}
|
|
820
|
-
var
|
|
841
|
+
var hr = /* @__PURE__ */ ((i) => (i.normal = "normal", i.satellite = "satellite", i.hybrid = "hybrid", i))(hr || {});
|
|
821
842
|
class A {
|
|
822
843
|
constructor(t, e, r, s) {
|
|
823
844
|
this.id = t, this.baidu = e, this.google = r, this.googleCoordType = s;
|
|
@@ -826,7 +847,7 @@ class A {
|
|
|
826
847
|
return this.id;
|
|
827
848
|
}
|
|
828
849
|
getBaiduCoordType() {
|
|
829
|
-
return
|
|
850
|
+
return P.bd09;
|
|
830
851
|
}
|
|
831
852
|
asBaiduMapType() {
|
|
832
853
|
return this.baidu();
|
|
@@ -839,10 +860,10 @@ class A {
|
|
|
839
860
|
return this.google();
|
|
840
861
|
}
|
|
841
862
|
asGoogleMapType() {
|
|
842
|
-
|
|
863
|
+
gt("google的内置地图没有对应的实例");
|
|
843
864
|
}
|
|
844
865
|
}
|
|
845
|
-
class
|
|
866
|
+
class Xs {
|
|
846
867
|
constructor(t, e) {
|
|
847
868
|
c(this, "baiduLayerCached", new _e(() => {
|
|
848
869
|
const t = new BMap.TileLayer({});
|
|
@@ -891,10 +912,10 @@ class Us {
|
|
|
891
912
|
return this.googleCached.get();
|
|
892
913
|
}
|
|
893
914
|
asGoogleLayer() {
|
|
894
|
-
|
|
915
|
+
gt("这个方法不会被调用");
|
|
895
916
|
}
|
|
896
917
|
}
|
|
897
|
-
class
|
|
918
|
+
class si {
|
|
898
919
|
constructor() {
|
|
899
920
|
c(this, "baiduCache", new _e(() => new BMap.TrafficLayer()));
|
|
900
921
|
c(this, "googleCache", new _e(() => new google.maps.TrafficLayer()));
|
|
@@ -908,19 +929,19 @@ class ei {
|
|
|
908
929
|
}
|
|
909
930
|
var $;
|
|
910
931
|
((i) => {
|
|
911
|
-
i.NORMAL = new A("normal", () => BMAP_NORMAL_MAP, () => google.maps.MapTypeId.ROADMAP,
|
|
932
|
+
i.NORMAL = new A("normal", () => BMAP_NORMAL_MAP, () => google.maps.MapTypeId.ROADMAP, P.gcj02), i.SATELLITE = new A("satellite", () => BMAP_SATELLITE_MAP, () => google.maps.MapTypeId.SATELLITE, P.wgs84), i.HYBRID = new A("hybrid", () => BMAP_HYBRID_MAP, () => google.maps.MapTypeId.HYBRID, P.gcj02), i.TERRAIN = new A("terrain", () => (
|
|
912
933
|
/* 三维 */
|
|
913
934
|
BMAP_PERSPECTIVE_MAP
|
|
914
935
|
), () => (
|
|
915
936
|
/* 地形 */
|
|
916
937
|
google.maps.MapTypeId.TERRAIN
|
|
917
|
-
),
|
|
938
|
+
), P.wgs84), i.BUILD_IN_MAP_TYPES = new ti([i.NORMAL, i.SATELLITE, i.HYBRID, i.TERRAIN]);
|
|
918
939
|
})($ || ($ = {}));
|
|
919
|
-
var
|
|
920
|
-
const
|
|
921
|
-
class
|
|
940
|
+
var cr = /* @__PURE__ */ ((i) => (i.DEFAULT = "default", i.HORIZONTAL = "horizontal", i.DROPDOWN = "dropdown", i))(cr || {});
|
|
941
|
+
const dr = [$.NORMAL, $.SATELLITE, $.HYBRID];
|
|
942
|
+
class yt extends ft {
|
|
922
943
|
static create(t) {
|
|
923
|
-
const e = t.mapTypes ??
|
|
944
|
+
const e = t.mapTypes ?? dr, r = {
|
|
924
945
|
default: BMAP_MAPTYPE_CONTROL_HORIZONTAL,
|
|
925
946
|
horizontal: BMAP_MAPTYPE_CONTROL_HORIZONTAL,
|
|
926
947
|
dropdown: BMAP_MAPTYPE_CONTROL_DROPDOWN
|
|
@@ -928,11 +949,11 @@ class mt extends pt {
|
|
|
928
949
|
type: t.type && r[t.type],
|
|
929
950
|
mapTypes: e.map((n) => n.asBaiduMapType())
|
|
930
951
|
});
|
|
931
|
-
return t.position && s.setAnchor(
|
|
952
|
+
return t.position && s.setAnchor(D.getBaidu().toValue(t.position)), new yt(s, t.position);
|
|
932
953
|
}
|
|
933
954
|
}
|
|
934
|
-
const oe = class extends
|
|
935
|
-
constructor(t = "default", e =
|
|
955
|
+
const oe = class extends Ye {
|
|
956
|
+
constructor(t = "default", e = x.TOP_LEFT, r = dr) {
|
|
936
957
|
super("mapType", e), this.type = t, this.mapTypes = r, oe.type2google || (oe.type2google = {
|
|
937
958
|
default: google.maps.MapTypeControlStyle.DEFAULT,
|
|
938
959
|
horizontal: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
|
|
@@ -954,41 +975,54 @@ const oe = class extends gt {
|
|
|
954
975
|
};
|
|
955
976
|
let Se = oe;
|
|
956
977
|
c(Se, "type2google");
|
|
957
|
-
class
|
|
978
|
+
class vt extends ft {
|
|
958
979
|
static create(t) {
|
|
959
980
|
const e = new BMap.ScaleControl({
|
|
960
|
-
anchor: t.position &&
|
|
981
|
+
anchor: t.position && D.getBaidu().toValue(t.position)
|
|
961
982
|
});
|
|
962
|
-
return new
|
|
983
|
+
return new vt(e, t.position);
|
|
963
984
|
}
|
|
964
985
|
}
|
|
965
|
-
class
|
|
986
|
+
class _t extends Ye {
|
|
966
987
|
static create(t) {
|
|
967
|
-
return new
|
|
988
|
+
return new _t(t.position);
|
|
968
989
|
}
|
|
969
|
-
constructor(t =
|
|
990
|
+
constructor(t = x.BOTTOM_RIGHT) {
|
|
970
991
|
super("scale", t);
|
|
971
992
|
}
|
|
972
993
|
}
|
|
973
|
-
class
|
|
994
|
+
class bt extends ii {
|
|
995
|
+
static create(t) {
|
|
996
|
+
return new bt(!0, t.position ?? x.RIGHT_BOTTOM);
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
class Tt extends Ye {
|
|
1000
|
+
static create(t) {
|
|
1001
|
+
return new Tt(t.position);
|
|
1002
|
+
}
|
|
1003
|
+
constructor(t = x.RIGHT_BOTTOM) {
|
|
1004
|
+
super("streetView", t);
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
class Mt extends ft {
|
|
974
1008
|
static create(t) {
|
|
975
1009
|
const e = new BMap.NavigationControl({
|
|
976
1010
|
type: BMAP_NAVIGATION_CONTROL_ZOOM,
|
|
977
1011
|
// enableGeolocation: true,
|
|
978
|
-
anchor: t.position &&
|
|
1012
|
+
anchor: t.position && D.getBaidu().toValue(t.position)
|
|
979
1013
|
});
|
|
980
|
-
return new
|
|
1014
|
+
return new Mt(e, t.position);
|
|
981
1015
|
}
|
|
982
1016
|
}
|
|
983
|
-
class
|
|
1017
|
+
class Ct extends Ye {
|
|
984
1018
|
static create(t) {
|
|
985
|
-
return new
|
|
1019
|
+
return new Ct(t.position);
|
|
986
1020
|
}
|
|
987
|
-
constructor(t =
|
|
1021
|
+
constructor(t = x.RIGHT_BOTTOM) {
|
|
988
1022
|
super("zoom", t);
|
|
989
1023
|
}
|
|
990
1024
|
}
|
|
991
|
-
function
|
|
1025
|
+
function ni(i) {
|
|
992
1026
|
let t, e, r;
|
|
993
1027
|
const s = "The Google Maps JavaScript API", n = "google", a = "importLibrary", d = "__ib__", o = document, l = window, h = l[n] || (l[n] = {}), u = h.maps || (h.maps = {}), p = /* @__PURE__ */ new Set(), f = new URLSearchParams(), _ = () => t || (t = new Promise(async (T, g) => {
|
|
994
1028
|
var y;
|
|
@@ -999,17 +1033,17 @@ function ti(i) {
|
|
|
999
1033
|
}));
|
|
1000
1034
|
u[a] ? console.warn(s + " only loads once. Ignoring:", i) : u[a] = (T, ...g) => p.add(T) && _().then(() => u[a](T, ...g));
|
|
1001
1035
|
}
|
|
1002
|
-
let
|
|
1036
|
+
let oi, ai;
|
|
1003
1037
|
const J = {
|
|
1004
1038
|
/** Google的坐标0点 */
|
|
1005
1039
|
get LATLNG_ZERO() {
|
|
1006
|
-
return
|
|
1040
|
+
return oi ?? (oi = new google.maps.LatLng({ lat: 0, lng: 0 }));
|
|
1007
1041
|
},
|
|
1008
1042
|
get BOUNDS_ZERO() {
|
|
1009
|
-
return
|
|
1043
|
+
return ai ?? (ai = new google.maps.LatLngBounds(this.LATLNG_ZERO, this.LATLNG_ZERO));
|
|
1010
1044
|
}
|
|
1011
1045
|
};
|
|
1012
|
-
function
|
|
1046
|
+
function ur(i, t = { country: "", province: "", city: "", district: "", street: "", streetNumber: "" }) {
|
|
1013
1047
|
for (const e of i)
|
|
1014
1048
|
for (const r of e.types)
|
|
1015
1049
|
switch (r) {
|
|
@@ -1034,9 +1068,9 @@ function hr(i, t = { country: "", province: "", city: "", district: "", street:
|
|
|
1034
1068
|
}
|
|
1035
1069
|
return t;
|
|
1036
1070
|
}
|
|
1037
|
-
function
|
|
1071
|
+
function pr(i, t) {
|
|
1038
1072
|
var r;
|
|
1039
|
-
const e = i.address_components &&
|
|
1073
|
+
const e = i.address_components && ur(i.address_components);
|
|
1040
1074
|
return {
|
|
1041
1075
|
country: (e == null ? void 0 : e.country) ?? "",
|
|
1042
1076
|
province: (e == null ? void 0 : e.province) ?? "",
|
|
@@ -1047,9 +1081,9 @@ function cr(i, t) {
|
|
|
1047
1081
|
title: i.name ?? ""
|
|
1048
1082
|
};
|
|
1049
1083
|
}
|
|
1050
|
-
class
|
|
1084
|
+
class gr {
|
|
1051
1085
|
}
|
|
1052
|
-
class
|
|
1086
|
+
class li extends gr {
|
|
1053
1087
|
constructor(e, r) {
|
|
1054
1088
|
super();
|
|
1055
1089
|
c(this, "inner");
|
|
@@ -1065,7 +1099,7 @@ class si extends dr {
|
|
|
1065
1099
|
this.inner.setBounds(e.toGoogle(this.map.coordType));
|
|
1066
1100
|
}
|
|
1067
1101
|
addResultListener(e) {
|
|
1068
|
-
return
|
|
1102
|
+
return or(this.inner, "place_changed", () => {
|
|
1069
1103
|
const r = this.inner.getPlace(), s = {
|
|
1070
1104
|
title: r.name ?? "",
|
|
1071
1105
|
province: "",
|
|
@@ -1075,11 +1109,11 @@ class si extends dr {
|
|
|
1075
1109
|
streetNumber: "",
|
|
1076
1110
|
country: ""
|
|
1077
1111
|
};
|
|
1078
|
-
r.address_components &&
|
|
1112
|
+
r.address_components && ur(r.address_components, s), e(s);
|
|
1079
1113
|
});
|
|
1080
1114
|
}
|
|
1081
1115
|
}
|
|
1082
|
-
class
|
|
1116
|
+
class hi extends gr {
|
|
1083
1117
|
constructor(e, r) {
|
|
1084
1118
|
super();
|
|
1085
1119
|
c(this, "inner");
|
|
@@ -1093,7 +1127,7 @@ class ni extends dr {
|
|
|
1093
1127
|
const s = () => {
|
|
1094
1128
|
this.inner.setLocation(this.map.innerMap);
|
|
1095
1129
|
};
|
|
1096
|
-
this.removeableArray.push(
|
|
1130
|
+
this.removeableArray.push(Ut(this.map, "center-changed", s)), this.removeableArray.push(Ut(this.map, "zoom-changed", s));
|
|
1097
1131
|
}
|
|
1098
1132
|
}
|
|
1099
1133
|
setBounds(e) {
|
|
@@ -1101,14 +1135,14 @@ class ni extends dr {
|
|
|
1101
1135
|
}
|
|
1102
1136
|
addResultListener(e) {
|
|
1103
1137
|
let r = 0;
|
|
1104
|
-
const s =
|
|
1138
|
+
const s = Qr(this.inner, "confirm", (a) => {
|
|
1105
1139
|
const d = a.item.value;
|
|
1106
1140
|
r = Date.now(), e(Object.assign({
|
|
1107
1141
|
title: d.business,
|
|
1108
1142
|
country: ""
|
|
1109
1143
|
// Baidu的自动完成只支持中国
|
|
1110
1144
|
}, d));
|
|
1111
|
-
}), n =
|
|
1145
|
+
}), n = ei(this.input, "keyup", (a) => {
|
|
1112
1146
|
a.key === "Enter" && Date.now() - r > 100 && e({
|
|
1113
1147
|
title: this.input.value,
|
|
1114
1148
|
country: "",
|
|
@@ -1124,20 +1158,20 @@ class ni extends dr {
|
|
|
1124
1158
|
};
|
|
1125
1159
|
}
|
|
1126
1160
|
}
|
|
1127
|
-
class
|
|
1161
|
+
class mr {
|
|
1128
1162
|
constructor(t) {
|
|
1129
1163
|
this.options = t;
|
|
1130
1164
|
}
|
|
1131
1165
|
}
|
|
1132
1166
|
function be(i, t, e) {
|
|
1133
|
-
const r = new URL(t, i), s = new URLSearchParams(Object.entries(e).filter(
|
|
1167
|
+
const r = new URL(t, i), s = new URLSearchParams(Object.entries(e).filter(Xr));
|
|
1134
1168
|
return r.search = "?" + s.toString(), r;
|
|
1135
1169
|
}
|
|
1136
|
-
function
|
|
1170
|
+
function tt() {
|
|
1137
1171
|
const i = window.location.hostname.split(".").filter((t) => !ue.isInt(t));
|
|
1138
1172
|
return i.length === 3 ? i.join(".") : [...i, "tg", "map", "urls"].slice(0, 3).join(".");
|
|
1139
1173
|
}
|
|
1140
|
-
const He = class extends
|
|
1174
|
+
const He = class extends mr {
|
|
1141
1175
|
/** @see https://developers.google.com/maps/documentation/urls/get-started#directions-action */
|
|
1142
1176
|
directions(t, e, r) {
|
|
1143
1177
|
return be(He.BASE_URL, "dir/", {
|
|
@@ -1145,8 +1179,8 @@ const He = class extends ur {
|
|
|
1145
1179
|
// {@template google_map_normal_gcj02}
|
|
1146
1180
|
// google地图的普通地图, 在国内其实上是gcj02坐标, 卫星地图是wgs84坐标, 因为这里打开的是基础地图, 故使用gcj02
|
|
1147
1181
|
// {@endtemplate}
|
|
1148
|
-
origin: V.toString(t,
|
|
1149
|
-
destination: V.toString(e,
|
|
1182
|
+
origin: V.toString(t, P.gcj02),
|
|
1183
|
+
destination: V.toString(e, P.gcj02),
|
|
1150
1184
|
travelmode: r
|
|
1151
1185
|
});
|
|
1152
1186
|
}
|
|
@@ -1155,29 +1189,29 @@ const He = class extends ur {
|
|
|
1155
1189
|
return be(He.BASE_URL, "search/", {
|
|
1156
1190
|
api: "1",
|
|
1157
1191
|
// {@macro google_map_normal_gcj02}
|
|
1158
|
-
query: V.toString(t,
|
|
1192
|
+
query: V.toString(t, P.gcj02)
|
|
1159
1193
|
});
|
|
1160
1194
|
}
|
|
1161
1195
|
};
|
|
1162
1196
|
let Ae = He;
|
|
1163
1197
|
c(Ae, "BASE_URL", "https://www.google.com/maps/");
|
|
1164
|
-
const Me = class extends
|
|
1198
|
+
const Me = class extends mr {
|
|
1165
1199
|
/**
|
|
1166
1200
|
* 导航
|
|
1167
1201
|
* @see https://lbsyun.baidu.com/faq/api?title=webapi/uri/web#:~:text=%E6%9C%8D%E5%8A%A1%E5%9C%B0%E5%9D%80-,http%3A//api.map.baidu.com/direction,-//PC%26Webapp%E6%9C%8D%E5%8A%A1
|
|
1168
1202
|
* */
|
|
1169
1203
|
directions(t, e, r = "driving") {
|
|
1170
|
-
const s = V.getCoordType(e) ?? V.getCoordType(t) ??
|
|
1204
|
+
const s = V.getCoordType(e) ?? V.getCoordType(t) ?? P.bd09, n = V.toString(e, s);
|
|
1171
1205
|
return be(Me.BASE_URL, "direction", {
|
|
1172
1206
|
// baidu地图, 一定要有起点, 故这里用终点当起点, 防止导航失败
|
|
1173
1207
|
origin: V.toString(t, s) ?? (typeof e != "string" ? `name:请选择起点|latlng:${n}` : n),
|
|
1174
1208
|
destination: n,
|
|
1175
1209
|
// 默认就是bd09
|
|
1176
|
-
coord_type: s ===
|
|
1210
|
+
coord_type: s === P.bd09 ? void 0 : s,
|
|
1177
1211
|
mode: r,
|
|
1178
1212
|
output: "html",
|
|
1179
1213
|
region: "中国",
|
|
1180
|
-
src:
|
|
1214
|
+
src: tt()
|
|
1181
1215
|
});
|
|
1182
1216
|
}
|
|
1183
1217
|
search(t) {
|
|
@@ -1187,7 +1221,7 @@ const Me = class extends ur {
|
|
|
1187
1221
|
* 显示经纬度, {@link markerApi}中途跳转的url, 一定能够定位到
|
|
1188
1222
|
* */
|
|
1189
1223
|
latlngApi(t) {
|
|
1190
|
-
const e = t.to(
|
|
1224
|
+
const e = t.to(P.bd09);
|
|
1191
1225
|
return new URL(`https://map.baidu.com/?latlng=${e.lat},${e.lng}`);
|
|
1192
1226
|
}
|
|
1193
1227
|
/**
|
|
@@ -1197,11 +1231,11 @@ const Me = class extends ur {
|
|
|
1197
1231
|
markerApi(t, e, r) {
|
|
1198
1232
|
return be(Me.BASE_URL, "marker", {
|
|
1199
1233
|
location: `${t.lat},${t.lng}`,
|
|
1200
|
-
coord_type: t.coord ===
|
|
1234
|
+
coord_type: t.coord === P.bd09 ? void 0 : t.coord,
|
|
1201
1235
|
title: e,
|
|
1202
1236
|
content: r,
|
|
1203
1237
|
output: "html",
|
|
1204
|
-
src:
|
|
1238
|
+
src: tt()
|
|
1205
1239
|
});
|
|
1206
1240
|
}
|
|
1207
1241
|
/**
|
|
@@ -1215,18 +1249,18 @@ const Me = class extends ur {
|
|
|
1215
1249
|
} : {
|
|
1216
1250
|
location: `${t.lat},${t.lng}`,
|
|
1217
1251
|
// 默认就是bd09
|
|
1218
|
-
coord_type: t.coord ===
|
|
1252
|
+
coord_type: t.coord === P.bd09 ? void 0 : t.coord
|
|
1219
1253
|
},
|
|
1220
1254
|
output: "html",
|
|
1221
|
-
src:
|
|
1255
|
+
src: tt()
|
|
1222
1256
|
});
|
|
1223
1257
|
}
|
|
1224
1258
|
};
|
|
1225
1259
|
let Re = Me;
|
|
1226
1260
|
c(Re, "BASE_URL", "https://api.map.baidu.com/");
|
|
1227
|
-
let
|
|
1261
|
+
let ci = class fr {
|
|
1228
1262
|
constructor(t, e, r) {
|
|
1229
|
-
this.extend(
|
|
1263
|
+
this.extend(fr, google.maps.OverlayView), this.map_ = t, this.MARKER_CLUSTER_IMAGE_PATH_ = "../images/m", this.MARKER_CLUSTER_IMAGE_EXTENSION_ = "png", this.markers_ = [], this.clusters_ = [], this.sizes = [53, 56, 66, 78, 90], this.styles_ = [], this.ready_ = !1;
|
|
1230
1264
|
var s = r || {};
|
|
1231
1265
|
this.zIndex_ = s.zIndex || google.maps.Marker.MAX_ZINDEX + 1, this.gridSize_ = s.gridSize || 60, this.minClusterSize_ = s.minimumClusterSize || 2, this.maxZoom_ = s.maxZoom || null, this.styles_ = s.styles || [], this.imagePath_ = s.imagePath || this.MARKER_CLUSTER_IMAGE_PATH_, this.imageExtension_ = s.imageExtension || this.MARKER_CLUSTER_IMAGE_EXTENSION_, this.zoomOnClick_ = !0, s.zoomOnClick != null && (this.zoomOnClick_ = s.zoomOnClick), this.averageCenter_ = !1, s.averageCenter != null && (this.averageCenter_ = s.averageCenter), this.setupStyles_(), this.setMap(t), this.prevZoom_ = this.map_.getZoom();
|
|
1232
1266
|
var n = this;
|
|
@@ -1645,7 +1679,7 @@ let oi = class pr {
|
|
|
1645
1679
|
if (r && r.isMarkerInClusterBounds(t))
|
|
1646
1680
|
r.addMarker(t);
|
|
1647
1681
|
else {
|
|
1648
|
-
var o = new
|
|
1682
|
+
var o = new di(this);
|
|
1649
1683
|
o.addMarker(t), this.clusters_.push(o);
|
|
1650
1684
|
}
|
|
1651
1685
|
}
|
|
@@ -1662,9 +1696,9 @@ let oi = class pr {
|
|
|
1662
1696
|
), e = this.getExtendedBounds(t), r = 0, s; s = this.markers_[r]; r++)
|
|
1663
1697
|
!s.isAdded && this.isMarkerInBounds_(s, e) && this.addToClosestCluster_(s);
|
|
1664
1698
|
}
|
|
1665
|
-
},
|
|
1699
|
+
}, di = class {
|
|
1666
1700
|
constructor(t) {
|
|
1667
|
-
this.markerClusterer_ = t, this.map_ = t.getMap(), this.gridSize_ = t.getGridSize(), this.minClusterSize_ = t.getMinClusterSize(), this.averageCenter_ = t.isAverageCenter(), this.center_ = null, this.markers_ = [], this.bounds_ = null, this.clusterIcon_ = new
|
|
1701
|
+
this.markerClusterer_ = t, this.map_ = t.getMap(), this.gridSize_ = t.getGridSize(), this.minClusterSize_ = t.getMinClusterSize(), this.averageCenter_ = t.isAverageCenter(), this.center_ = null, this.markers_ = [], this.bounds_ = null, this.clusterIcon_ = new Ot(
|
|
1668
1702
|
this,
|
|
1669
1703
|
t.getStyles(),
|
|
1670
1704
|
t.getGridSize()
|
|
@@ -1798,9 +1832,9 @@ let oi = class pr {
|
|
|
1798
1832
|
this.clusterIcon_.setCenter(this.center_), this.clusterIcon_.setSums(a), this.clusterIcon_.show();
|
|
1799
1833
|
}
|
|
1800
1834
|
};
|
|
1801
|
-
class
|
|
1835
|
+
class Ot {
|
|
1802
1836
|
constructor(t, e, r) {
|
|
1803
|
-
t.getMarkerClusterer().extend(
|
|
1837
|
+
t.getMarkerClusterer().extend(Ot, google.maps.OverlayView), this.styles_ = e, this.padding_ = r || 0, this.cluster_ = t, this.center_ = null, this.map_ = t.getMap(), this.div_ = null, this.sums_ = null, this.visible_ = !1, this.setMap(this.map_);
|
|
1804
1838
|
}
|
|
1805
1839
|
/**
|
|
1806
1840
|
* Triggers the clusterclick event and zoom's if the option is set.
|
|
@@ -1931,11 +1965,11 @@ class bt {
|
|
|
1931
1965
|
), e.join("");
|
|
1932
1966
|
}
|
|
1933
1967
|
}
|
|
1934
|
-
var
|
|
1968
|
+
var yr = { exports: {} };
|
|
1935
1969
|
(function(i, t) {
|
|
1936
1970
|
(function(e, r) {
|
|
1937
1971
|
i.exports = r();
|
|
1938
|
-
})(
|
|
1972
|
+
})(ir, function() {
|
|
1939
1973
|
var e, r = e = r || { version: "1.3.8" }, s = {};
|
|
1940
1974
|
r.guid = "$BAIDU$", s[r.guid] = s[r.guid] || {}, r.dom = r.dom || {}, r.dom.g = function(o) {
|
|
1941
1975
|
return typeof o == "string" || o instanceof String ? document.getElementById(o) : o && o.nodeName && (o.nodeType == 1 || o.nodeType == 9) ? o : null;
|
|
@@ -2124,25 +2158,25 @@ var gr = { exports: {} };
|
|
|
2124
2158
|
});
|
|
2125
2159
|
}, d;
|
|
2126
2160
|
});
|
|
2127
|
-
})(
|
|
2128
|
-
var
|
|
2129
|
-
const
|
|
2130
|
-
var
|
|
2131
|
-
t =
|
|
2161
|
+
})(yr);
|
|
2162
|
+
var ui = yr.exports;
|
|
2163
|
+
const qt = /* @__PURE__ */ ut(ui);
|
|
2164
|
+
var vr = function(i, t, e) {
|
|
2165
|
+
t = pi(t);
|
|
2132
2166
|
var r = i.pointToPixel(t.getNorthEast()), s = i.pointToPixel(t.getSouthWest());
|
|
2133
2167
|
r.x += e, r.y -= e, s.x -= e, s.y += e;
|
|
2134
2168
|
var n = i.pixelToPoint(r), a = i.pixelToPoint(s);
|
|
2135
2169
|
return new BMap.Bounds(a, n);
|
|
2136
|
-
},
|
|
2137
|
-
var t =
|
|
2170
|
+
}, pi = function(i) {
|
|
2171
|
+
var t = Be(i.getNorthEast().lng, -180, 180), e = Be(i.getSouthWest().lng, -180, 180), r = Be(i.getNorthEast().lat, -74, 74), s = Be(i.getSouthWest().lat, -74, 74);
|
|
2138
2172
|
return new BMap.Bounds(new BMap.Point(e, s), new BMap.Point(t, r));
|
|
2139
|
-
},
|
|
2173
|
+
}, Be = function(i, t, e) {
|
|
2140
2174
|
return t && (i = Math.max(i, t)), e && (i = Math.min(i, e)), i;
|
|
2141
|
-
},
|
|
2175
|
+
}, _r = function(i) {
|
|
2142
2176
|
return Object.prototype.toString.call(i) === "[object Array]";
|
|
2143
|
-
},
|
|
2177
|
+
}, br = function(i, t) {
|
|
2144
2178
|
var e = -1;
|
|
2145
|
-
if (
|
|
2179
|
+
if (_r(t)) {
|
|
2146
2180
|
if (t.indexOf)
|
|
2147
2181
|
e = t.indexOf(i);
|
|
2148
2182
|
else
|
|
@@ -2170,7 +2204,7 @@ var mr = function(i, t, e) {
|
|
|
2170
2204
|
r._redraw();
|
|
2171
2205
|
});
|
|
2172
2206
|
var s = e.markers;
|
|
2173
|
-
|
|
2207
|
+
_r(s) && this.addMarkers(s);
|
|
2174
2208
|
}
|
|
2175
2209
|
};
|
|
2176
2210
|
M.prototype.addMarkers = function(i) {
|
|
@@ -2181,7 +2215,7 @@ M.prototype.addMarkers = function(i) {
|
|
|
2181
2215
|
}
|
|
2182
2216
|
};
|
|
2183
2217
|
M.prototype._pushMarkerTo = function(i) {
|
|
2184
|
-
var t =
|
|
2218
|
+
var t = br(i, this._markers);
|
|
2185
2219
|
t === -1 && (i.isInCluster = !1, this._markers.push(i));
|
|
2186
2220
|
};
|
|
2187
2221
|
M.prototype.addMarker = function(i) {
|
|
@@ -2190,7 +2224,7 @@ M.prototype.addMarker = function(i) {
|
|
|
2190
2224
|
M.prototype._createClusters = function() {
|
|
2191
2225
|
var i = this._map.getBounds();
|
|
2192
2226
|
if (i.getCenter()) {
|
|
2193
|
-
for (var t =
|
|
2227
|
+
for (var t = vr(this._map, i, this._gridSize), e = 0, r; r = this._markers[e]; e++)
|
|
2194
2228
|
!r.isInCluster && t.containsPoint(r.getPosition()) && this._addToClosestCluster(r);
|
|
2195
2229
|
for (var s = this._markers.length, e = 0; e < s; e++)
|
|
2196
2230
|
this._clusters[e] && this._clusters[e].render();
|
|
@@ -2209,7 +2243,7 @@ M.prototype._addToClosestCluster = function(i) {
|
|
|
2209
2243
|
if (e && e.isMarkerInClusterBounds(i))
|
|
2210
2244
|
e.addMarker(i);
|
|
2211
2245
|
else {
|
|
2212
|
-
var s = new
|
|
2246
|
+
var s = new G(this);
|
|
2213
2247
|
s.addMarker(i), this._clusters.push(s);
|
|
2214
2248
|
}
|
|
2215
2249
|
};
|
|
@@ -2230,7 +2264,7 @@ M.prototype._removeMarkersFromMap = function() {
|
|
|
2230
2264
|
}
|
|
2231
2265
|
};
|
|
2232
2266
|
M.prototype._removeMarker = function(i) {
|
|
2233
|
-
var t =
|
|
2267
|
+
var t = br(i, this._markers);
|
|
2234
2268
|
return t === -1 ? !1 : (this._map.removeOverlay(i), this._markers.splice(t, 1), !0);
|
|
2235
2269
|
};
|
|
2236
2270
|
M.prototype.removeMarker = function(i) {
|
|
@@ -2304,9 +2338,9 @@ M.prototype.setTextCalculator = function(i) {
|
|
|
2304
2338
|
M.prototype.setStylesIndexCalculator = function(i) {
|
|
2305
2339
|
this._stylesIndexCalculator = i;
|
|
2306
2340
|
};
|
|
2307
|
-
function
|
|
2341
|
+
function G(i) {
|
|
2308
2342
|
var t = this;
|
|
2309
|
-
this._markerClusterer = i, this._map = i.getMap(), this._minClusterSize = i.getMinClusterSize(), this._isAverageCenter = i.isAverageCenter(), this._center = null, this._markers = [], this._gridBounds = null, this._isReal = !1, this._clusterMarker = new
|
|
2343
|
+
this._markerClusterer = i, this._map = i.getMap(), this._minClusterSize = i.getMinClusterSize(), this._isAverageCenter = i.isAverageCenter(), this._center = null, this._markers = [], this._gridBounds = null, this._isReal = !1, this._clusterMarker = new qt(this._center, this._markers.length, {
|
|
2310
2344
|
styles: this._markerClusterer.getStyles(),
|
|
2311
2345
|
zIndex: i._zIndex
|
|
2312
2346
|
}), this._clusterMarker.getStyleByText = function(e, r) {
|
|
@@ -2314,12 +2348,12 @@ function N(i) {
|
|
|
2314
2348
|
var s = t._markerClusterer._stylesIndexCalculator(t._markers, r.length);
|
|
2315
2349
|
return r[s];
|
|
2316
2350
|
}
|
|
2317
|
-
return
|
|
2351
|
+
return qt.prototype.getStyleByText.call(this, e, r);
|
|
2318
2352
|
}, this._clusterMarker.addEventListener && this._clusterMarker.addEventListener("click", function(e) {
|
|
2319
2353
|
t._map.setViewport(t.getBounds());
|
|
2320
2354
|
});
|
|
2321
2355
|
}
|
|
2322
|
-
|
|
2356
|
+
G.prototype.addMarker = function(i) {
|
|
2323
2357
|
if (this.isMarkerInCluster(i))
|
|
2324
2358
|
return !1;
|
|
2325
2359
|
if (!this._center)
|
|
@@ -2330,7 +2364,7 @@ N.prototype.addMarker = function(i) {
|
|
|
2330
2364
|
}
|
|
2331
2365
|
return i.isInCluster = !0, this._markers.push(i), !0;
|
|
2332
2366
|
};
|
|
2333
|
-
|
|
2367
|
+
G.prototype.render = function() {
|
|
2334
2368
|
var i = this._markers.length;
|
|
2335
2369
|
if (i < this._minClusterSize)
|
|
2336
2370
|
for (var t = 0; t < i; t++)
|
|
@@ -2338,7 +2372,7 @@ N.prototype.render = function() {
|
|
|
2338
2372
|
else
|
|
2339
2373
|
this._map.addOverlay(this._clusterMarker), this._isReal = !0, this.updateClusterMarker();
|
|
2340
2374
|
};
|
|
2341
|
-
|
|
2375
|
+
G.prototype.isMarkerInCluster = function(i) {
|
|
2342
2376
|
if (this._markers.indexOf)
|
|
2343
2377
|
return this._markers.indexOf(i) != -1;
|
|
2344
2378
|
for (var t = 0, e; e = this._markers[t]; t++)
|
|
@@ -2346,17 +2380,17 @@ N.prototype.isMarkerInCluster = function(i) {
|
|
|
2346
2380
|
return !0;
|
|
2347
2381
|
return !1;
|
|
2348
2382
|
};
|
|
2349
|
-
|
|
2383
|
+
G.prototype.isMarkerInClusterBounds = function(i) {
|
|
2350
2384
|
return this._gridBounds.containsPoint(i.getPosition());
|
|
2351
2385
|
};
|
|
2352
|
-
|
|
2386
|
+
G.prototype.isReal = function(i) {
|
|
2353
2387
|
return this._isReal;
|
|
2354
2388
|
};
|
|
2355
|
-
|
|
2389
|
+
G.prototype.updateGridBounds = function() {
|
|
2356
2390
|
var i = new BMap.Bounds(this._center, this._center);
|
|
2357
|
-
this._gridBounds =
|
|
2391
|
+
this._gridBounds = vr(this._map, i, this._markerClusterer.getGridSize());
|
|
2358
2392
|
};
|
|
2359
|
-
|
|
2393
|
+
G.prototype.updateClusterMarker = function() {
|
|
2360
2394
|
if (this._map.getZoom() > this._markerClusterer.getMaxZoom()) {
|
|
2361
2395
|
this._clusterMarker && this._map.removeOverlay(this._clusterMarker);
|
|
2362
2396
|
for (var i = 0, t; t = this._markers[i]; i++)
|
|
@@ -2369,19 +2403,19 @@ N.prototype.updateClusterMarker = function() {
|
|
|
2369
2403
|
}
|
|
2370
2404
|
this._clusterMarker.setPosition(this._center), this._clusterMarker.setText(this._markerClusterer._textCalculator(this._markers));
|
|
2371
2405
|
};
|
|
2372
|
-
|
|
2406
|
+
G.prototype.remove = function() {
|
|
2373
2407
|
for (var i = 0, t; t = this._markers[i]; i++) {
|
|
2374
2408
|
var e = this._markers[i].getLabel();
|
|
2375
2409
|
this._markers[i].getMap() && this._map.removeOverlay(this._markers[i]), this._markers[i].setLabel(e);
|
|
2376
2410
|
}
|
|
2377
2411
|
this._map.removeOverlay(this._clusterMarker), this._markers.length = 0, delete this._markers;
|
|
2378
2412
|
};
|
|
2379
|
-
|
|
2413
|
+
G.prototype.getBounds = function() {
|
|
2380
2414
|
for (var i = new BMap.Bounds(this._center, this._center), t = 0, e; e = this._markers[t]; t++)
|
|
2381
2415
|
i.extend(e.getPosition());
|
|
2382
2416
|
return i;
|
|
2383
2417
|
};
|
|
2384
|
-
|
|
2418
|
+
G.prototype.getCenter = function() {
|
|
2385
2419
|
return this._center;
|
|
2386
2420
|
};
|
|
2387
2421
|
var ze;
|
|
@@ -2410,7 +2444,7 @@ var ze;
|
|
|
2410
2444
|
}
|
|
2411
2445
|
i.toGoogle = e;
|
|
2412
2446
|
})(ze || (ze = {}));
|
|
2413
|
-
class
|
|
2447
|
+
class Tr {
|
|
2414
2448
|
constructor(t) {
|
|
2415
2449
|
this.map = t;
|
|
2416
2450
|
}
|
|
@@ -2435,7 +2469,7 @@ class vr {
|
|
|
2435
2469
|
return this.inner.removeMarkers(t.map((e) => e.innerOverlay));
|
|
2436
2470
|
}
|
|
2437
2471
|
}
|
|
2438
|
-
class
|
|
2472
|
+
class gi extends Tr {
|
|
2439
2473
|
constructor(e, r) {
|
|
2440
2474
|
var n;
|
|
2441
2475
|
super(e);
|
|
@@ -2457,12 +2491,12 @@ class ci extends vr {
|
|
|
2457
2491
|
this.inner._redraw();
|
|
2458
2492
|
}
|
|
2459
2493
|
}
|
|
2460
|
-
class
|
|
2494
|
+
class mi extends Tr {
|
|
2461
2495
|
constructor(e, r) {
|
|
2462
2496
|
var n, a;
|
|
2463
2497
|
super(e);
|
|
2464
2498
|
c(this, "inner");
|
|
2465
|
-
this.inner = new
|
|
2499
|
+
this.inner = new ci(
|
|
2466
2500
|
e.innerMap,
|
|
2467
2501
|
// google的构造器中的markers,不会触发重绘, 第一次绘制通过监听地图的'idle'事件触发, 可以直接设置
|
|
2468
2502
|
(n = r.markers) == null ? void 0 : n.map((d) => d.innerOverlay),
|
|
@@ -2486,11 +2520,11 @@ class di extends vr {
|
|
|
2486
2520
|
this.inner.repaint();
|
|
2487
2521
|
}
|
|
2488
2522
|
}
|
|
2489
|
-
class
|
|
2523
|
+
class Mr {
|
|
2490
2524
|
constructor() {
|
|
2491
2525
|
}
|
|
2492
2526
|
}
|
|
2493
|
-
class
|
|
2527
|
+
class fi extends Mr {
|
|
2494
2528
|
constructor(e, r) {
|
|
2495
2529
|
super();
|
|
2496
2530
|
c(this, "inner");
|
|
@@ -2524,7 +2558,7 @@ class ui extends _r {
|
|
|
2524
2558
|
switch (d) {
|
|
2525
2559
|
case google.maps.places.PlacesServiceStatus.ZERO_RESULTS:
|
|
2526
2560
|
case google.maps.places.PlacesServiceStatus.OK: {
|
|
2527
|
-
const o = (a ?? []).map((l) =>
|
|
2561
|
+
const o = (a ?? []).map((l) => pr(l, this.map));
|
|
2528
2562
|
s(o);
|
|
2529
2563
|
break;
|
|
2530
2564
|
}
|
|
@@ -2536,7 +2570,7 @@ class ui extends _r {
|
|
|
2536
2570
|
});
|
|
2537
2571
|
}
|
|
2538
2572
|
}
|
|
2539
|
-
class
|
|
2573
|
+
class yi extends Mr {
|
|
2540
2574
|
constructor(e, r) {
|
|
2541
2575
|
super();
|
|
2542
2576
|
c(this, "searchRequestMap", /* @__PURE__ */ new Map());
|
|
@@ -2568,7 +2602,7 @@ class pi extends _r {
|
|
|
2568
2602
|
return new Promise((s, n) => {
|
|
2569
2603
|
const a = new BMap.LocalSearch(e ?? this.map.innerMap, {
|
|
2570
2604
|
onSearchComplete: (d) => {
|
|
2571
|
-
Array.isArray(d) &&
|
|
2605
|
+
Array.isArray(d) && gt("当前只支持一次搜索一条数据");
|
|
2572
2606
|
const o = a.getStatus();
|
|
2573
2607
|
switch (o) {
|
|
2574
2608
|
case BMAP_STATUS_SUCCESS: {
|
|
@@ -2602,7 +2636,7 @@ class pi extends _r {
|
|
|
2602
2636
|
});
|
|
2603
2637
|
}
|
|
2604
2638
|
}
|
|
2605
|
-
class
|
|
2639
|
+
class Cr {
|
|
2606
2640
|
constructor(t, e) {
|
|
2607
2641
|
c(this, "onData");
|
|
2608
2642
|
c(this, "onError");
|
|
@@ -2614,26 +2648,26 @@ class br {
|
|
|
2614
2648
|
* @mustCallSuper 子类必须调用一次`super.setSearchListener`, 用来保存{@link onData}和{@link onError}
|
|
2615
2649
|
* */
|
|
2616
2650
|
setSearchListener(t, e) {
|
|
2617
|
-
return this.onData &&
|
|
2651
|
+
return this.onData && w("setSearchListener只能调用一次"), this.onData = t, this.onError = e, Ce;
|
|
2618
2652
|
}
|
|
2619
2653
|
}
|
|
2620
|
-
class
|
|
2654
|
+
class vi extends Cr {
|
|
2621
2655
|
constructor(e, r) {
|
|
2622
2656
|
super(e, r.input);
|
|
2623
2657
|
c(this, "searchBox");
|
|
2624
2658
|
this.searchBox = new google.maps.places.SearchBox(r.input), this.searchBox.bindTo("bounds", e.innerMap);
|
|
2625
2659
|
}
|
|
2626
2660
|
setSearchListener(e, r) {
|
|
2627
|
-
return super.setSearchListener(e, r),
|
|
2661
|
+
return super.setSearchListener(e, r), or(this.searchBox, "places_changed", () => {
|
|
2628
2662
|
const s = this.searchBox.getPlaces();
|
|
2629
|
-
e((s ?? []).map((n) =>
|
|
2663
|
+
e((s ?? []).map((n) => pr(n, this.map)));
|
|
2630
2664
|
});
|
|
2631
2665
|
}
|
|
2632
2666
|
search() {
|
|
2633
2667
|
this.input.value && (google.maps.event.trigger(this.input, "focus", {}), google.maps.event.trigger(this.input, "keydown", { keyCode: 13 }));
|
|
2634
2668
|
}
|
|
2635
2669
|
}
|
|
2636
|
-
class
|
|
2670
|
+
class _i extends Cr {
|
|
2637
2671
|
constructor(e, r) {
|
|
2638
2672
|
super(e, r.input);
|
|
2639
2673
|
c(this, "autocomplete");
|
|
@@ -2652,8 +2686,8 @@ class mi extends br {
|
|
|
2652
2686
|
this.placesService.search(e).then(this.onData, this.onError);
|
|
2653
2687
|
}
|
|
2654
2688
|
}
|
|
2655
|
-
var
|
|
2656
|
-
class
|
|
2689
|
+
var bi = /* @__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))(bi || {});
|
|
2690
|
+
class wt {
|
|
2657
2691
|
constructor(t) {
|
|
2658
2692
|
c(this, "latestInfoWindow");
|
|
2659
2693
|
/** 使用{@link setEventTargetDelegate}初始化 */
|
|
@@ -2700,67 +2734,67 @@ class Tt {
|
|
|
2700
2734
|
this.innerMap.setZoom(t);
|
|
2701
2735
|
}
|
|
2702
2736
|
}
|
|
2703
|
-
var
|
|
2704
|
-
return
|
|
2737
|
+
var Ti = function(t) {
|
|
2738
|
+
return Mi(t) && !Ci(t);
|
|
2705
2739
|
};
|
|
2706
|
-
function
|
|
2740
|
+
function Mi(i) {
|
|
2707
2741
|
return !!i && typeof i == "object";
|
|
2708
2742
|
}
|
|
2709
|
-
function
|
|
2743
|
+
function Ci(i) {
|
|
2710
2744
|
var t = Object.prototype.toString.call(i);
|
|
2711
|
-
return t === "[object RegExp]" || t === "[object Date]" ||
|
|
2745
|
+
return t === "[object RegExp]" || t === "[object Date]" || Ei(i);
|
|
2712
2746
|
}
|
|
2713
|
-
var
|
|
2714
|
-
function
|
|
2715
|
-
return i.$$typeof ===
|
|
2747
|
+
var Oi = typeof Symbol == "function" && Symbol.for, wi = Oi ? Symbol.for("react.element") : 60103;
|
|
2748
|
+
function Ei(i) {
|
|
2749
|
+
return i.$$typeof === wi;
|
|
2716
2750
|
}
|
|
2717
|
-
function
|
|
2751
|
+
function Li(i) {
|
|
2718
2752
|
return Array.isArray(i) ? [] : {};
|
|
2719
2753
|
}
|
|
2720
|
-
function
|
|
2721
|
-
return t.clone !== !1 && t.isMergeableObject(i) ? de(
|
|
2754
|
+
function Oe(i, t) {
|
|
2755
|
+
return t.clone !== !1 && t.isMergeableObject(i) ? de(Li(i), i, t) : i;
|
|
2722
2756
|
}
|
|
2723
|
-
function
|
|
2757
|
+
function xi(i, t, e) {
|
|
2724
2758
|
return i.concat(t).map(function(r) {
|
|
2725
|
-
return
|
|
2759
|
+
return Oe(r, e);
|
|
2726
2760
|
});
|
|
2727
2761
|
}
|
|
2728
|
-
function
|
|
2762
|
+
function Pi(i, t) {
|
|
2729
2763
|
if (!t.customMerge)
|
|
2730
2764
|
return de;
|
|
2731
2765
|
var e = t.customMerge(i);
|
|
2732
2766
|
return typeof e == "function" ? e : de;
|
|
2733
2767
|
}
|
|
2734
|
-
function
|
|
2768
|
+
function Ii(i) {
|
|
2735
2769
|
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(i).filter(function(t) {
|
|
2736
2770
|
return Object.propertyIsEnumerable.call(i, t);
|
|
2737
2771
|
}) : [];
|
|
2738
2772
|
}
|
|
2739
|
-
function
|
|
2740
|
-
return Object.keys(i).concat(
|
|
2773
|
+
function Kt(i) {
|
|
2774
|
+
return Object.keys(i).concat(Ii(i));
|
|
2741
2775
|
}
|
|
2742
|
-
function
|
|
2776
|
+
function Or(i, t) {
|
|
2743
2777
|
try {
|
|
2744
2778
|
return t in i;
|
|
2745
2779
|
} catch {
|
|
2746
2780
|
return !1;
|
|
2747
2781
|
}
|
|
2748
2782
|
}
|
|
2749
|
-
function
|
|
2750
|
-
return
|
|
2783
|
+
function Bi(i, t) {
|
|
2784
|
+
return Or(i, t) && !(Object.hasOwnProperty.call(i, t) && Object.propertyIsEnumerable.call(i, t));
|
|
2751
2785
|
}
|
|
2752
|
-
function
|
|
2786
|
+
function ki(i, t, e) {
|
|
2753
2787
|
var r = {};
|
|
2754
|
-
return e.isMergeableObject(i) &&
|
|
2755
|
-
r[s] =
|
|
2756
|
-
}),
|
|
2757
|
-
|
|
2788
|
+
return e.isMergeableObject(i) && Kt(i).forEach(function(s) {
|
|
2789
|
+
r[s] = Oe(i[s], e);
|
|
2790
|
+
}), Kt(t).forEach(function(s) {
|
|
2791
|
+
Bi(i, s) || (Or(i, s) && e.isMergeableObject(t[s]) ? r[s] = Pi(s, e)(i[s], t[s], e) : r[s] = Oe(t[s], e));
|
|
2758
2792
|
}), r;
|
|
2759
2793
|
}
|
|
2760
2794
|
function de(i, t, e) {
|
|
2761
|
-
e = e || {}, e.arrayMerge = e.arrayMerge ||
|
|
2795
|
+
e = e || {}, e.arrayMerge = e.arrayMerge || xi, e.isMergeableObject = e.isMergeableObject || Ti, e.cloneUnlessOtherwiseSpecified = Oe;
|
|
2762
2796
|
var r = Array.isArray(t), s = Array.isArray(i), n = r === s;
|
|
2763
|
-
return n ? r ? e.arrayMerge(i, t, e) :
|
|
2797
|
+
return n ? r ? e.arrayMerge(i, t, e) : ki(i, t, e) : Oe(t, e);
|
|
2764
2798
|
}
|
|
2765
2799
|
de.all = function(t, e) {
|
|
2766
2800
|
if (!Array.isArray(t))
|
|
@@ -2769,15 +2803,15 @@ de.all = function(t, e) {
|
|
|
2769
2803
|
return de(r, s, e);
|
|
2770
2804
|
}, {});
|
|
2771
2805
|
};
|
|
2772
|
-
var
|
|
2773
|
-
const
|
|
2806
|
+
var Si = de, Ai = Si;
|
|
2807
|
+
const wr = /* @__PURE__ */ ut(Ai);
|
|
2774
2808
|
/*!
|
|
2775
2809
|
* isobject <https://github.com/jonschlinkert/isobject>
|
|
2776
2810
|
*
|
|
2777
2811
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
2778
2812
|
* Released under the MIT License.
|
|
2779
2813
|
*/
|
|
2780
|
-
function
|
|
2814
|
+
function Ri(i) {
|
|
2781
2815
|
return i != null && typeof i == "object" && Array.isArray(i) === !1;
|
|
2782
2816
|
}
|
|
2783
2817
|
/*!
|
|
@@ -2786,12 +2820,12 @@ function Ii(i) {
|
|
|
2786
2820
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
2787
2821
|
* Released under the MIT License.
|
|
2788
2822
|
*/
|
|
2789
|
-
function
|
|
2790
|
-
return
|
|
2823
|
+
function Xt(i) {
|
|
2824
|
+
return Ri(i) === !0 && Object.prototype.toString.call(i) === "[object Object]";
|
|
2791
2825
|
}
|
|
2792
|
-
function
|
|
2826
|
+
function Er(i) {
|
|
2793
2827
|
var t, e;
|
|
2794
|
-
return !(
|
|
2828
|
+
return !(Xt(i) === !1 || (t = i.constructor, typeof t != "function") || (e = t.prototype, Xt(e) === !1) || e.hasOwnProperty("isPrototypeOf") === !1);
|
|
2795
2829
|
}
|
|
2796
2830
|
var Q;
|
|
2797
2831
|
((i) => {
|
|
@@ -2808,7 +2842,7 @@ var Q;
|
|
|
2808
2842
|
}
|
|
2809
2843
|
i.toJsonSafely = r;
|
|
2810
2844
|
function s(h) {
|
|
2811
|
-
|
|
2845
|
+
Er(h) && Object.keys(h).forEach((u) => {
|
|
2812
2846
|
h[u] === void 0 ? delete h[u] : s(h[u]);
|
|
2813
2847
|
});
|
|
2814
2848
|
}
|
|
@@ -2819,14 +2853,14 @@ var Q;
|
|
|
2819
2853
|
}
|
|
2820
2854
|
i.putIfAbsent = n;
|
|
2821
2855
|
function a(h, ...u) {
|
|
2822
|
-
const p =
|
|
2856
|
+
const p = Jt(u), f = {};
|
|
2823
2857
|
for (const _ in h)
|
|
2824
2858
|
p(_) || (f[_] = h[_]);
|
|
2825
2859
|
return f;
|
|
2826
2860
|
}
|
|
2827
2861
|
i.omit = a;
|
|
2828
2862
|
function d(h, ...u) {
|
|
2829
|
-
const p =
|
|
2863
|
+
const p = Jt(u), f = {};
|
|
2830
2864
|
for (const _ in h)
|
|
2831
2865
|
p(_) && (f[_] = h[_]);
|
|
2832
2866
|
return f;
|
|
@@ -2849,7 +2883,7 @@ var Q;
|
|
|
2849
2883
|
}
|
|
2850
2884
|
i.del = l;
|
|
2851
2885
|
})(Q || (Q = {}));
|
|
2852
|
-
function
|
|
2886
|
+
function Jt(i) {
|
|
2853
2887
|
if (i.length <= 4)
|
|
2854
2888
|
return i.includes.bind(i);
|
|
2855
2889
|
{
|
|
@@ -2858,19 +2892,19 @@ function Ut(i) {
|
|
|
2858
2892
|
}
|
|
2859
2893
|
}
|
|
2860
2894
|
Q.toJsonSafely;
|
|
2861
|
-
const
|
|
2862
|
-
var j = /* @__PURE__ */ ((i) => (i.auto = "auto", i.none = "none", i.greedy = "greedy", i.cooperative = "cooperative", i))(j || {}),
|
|
2895
|
+
const $i = ["single", "multi"];
|
|
2896
|
+
var j = /* @__PURE__ */ ((i) => (i.auto = "auto", i.none = "none", i.greedy = "greedy", i.cooperative = "cooperative", i))(j || {}), ht;
|
|
2863
2897
|
((i) => {
|
|
2864
2898
|
function t(e) {
|
|
2865
2899
|
Q.deleteUndefinedPropertyOnPlainObjectDeeply(e);
|
|
2866
2900
|
const r = { center: v.ZERO, zoom: 5 };
|
|
2867
|
-
return
|
|
2868
|
-
isMergeableObject:
|
|
2901
|
+
return wr(r, e || {}, {
|
|
2902
|
+
isMergeableObject: Er
|
|
2869
2903
|
});
|
|
2870
2904
|
}
|
|
2871
2905
|
i.create = t;
|
|
2872
|
-
})(
|
|
2873
|
-
class
|
|
2906
|
+
})(ht || (ht = {}));
|
|
2907
|
+
class Lr {
|
|
2874
2908
|
constructor(t, e) {
|
|
2875
2909
|
c(this, "_delegate");
|
|
2876
2910
|
this.innerOverlay = t, this.coordType = e;
|
|
@@ -2888,7 +2922,7 @@ class Cr {
|
|
|
2888
2922
|
this.map.removeOverlay(this);
|
|
2889
2923
|
}
|
|
2890
2924
|
}
|
|
2891
|
-
class
|
|
2925
|
+
class Et extends Lr {
|
|
2892
2926
|
constructor(t, e, r) {
|
|
2893
2927
|
super(t, e), this.map = r;
|
|
2894
2928
|
}
|
|
@@ -2902,7 +2936,7 @@ class Mt extends Cr {
|
|
|
2902
2936
|
this.innerOverlay.setVisible(t);
|
|
2903
2937
|
}
|
|
2904
2938
|
}
|
|
2905
|
-
class
|
|
2939
|
+
class qe extends Lr {
|
|
2906
2940
|
constructor(t, e, r) {
|
|
2907
2941
|
super(t, e), this.map = r;
|
|
2908
2942
|
}
|
|
@@ -2924,7 +2958,7 @@ class Ye extends Cr {
|
|
|
2924
2958
|
return t !== void 0 && (t || this.setVisible(!1)), this;
|
|
2925
2959
|
}
|
|
2926
2960
|
}
|
|
2927
|
-
const je = class extends
|
|
2961
|
+
const je = class extends qe {
|
|
2928
2962
|
constructor(t, e, r, s) {
|
|
2929
2963
|
super(t, e, r), this.state = s;
|
|
2930
2964
|
}
|
|
@@ -2950,15 +2984,15 @@ const je = class extends Ye {
|
|
|
2950
2984
|
this.innerOverlay.setFillOpacity(t + je.OPACITY_DELTA);
|
|
2951
2985
|
}
|
|
2952
2986
|
};
|
|
2953
|
-
let
|
|
2987
|
+
let S = je;
|
|
2954
2988
|
/**
|
|
2955
2989
|
* baidu地图的透明度属性有如下问题:
|
|
2956
2990
|
* - 在透明度为0时, 无法隐藏掉颜色
|
|
2957
2991
|
* - 透明度为0.7和0.8时, 在maintain的发布模式下, polyline的线条会不可见 (原因未知, 在tg-map中无法复现)
|
|
2958
2992
|
* 故统一加个0.001, 规避这些问题...
|
|
2959
2993
|
*/
|
|
2960
|
-
c(
|
|
2961
|
-
class
|
|
2994
|
+
c(S, "OPACITY_DELTA", 1e-3);
|
|
2995
|
+
class Ke extends Et {
|
|
2962
2996
|
isEditable() {
|
|
2963
2997
|
return this.innerOverlay.getEditable();
|
|
2964
2998
|
}
|
|
@@ -2981,7 +3015,7 @@ class qe extends Mt {
|
|
|
2981
3015
|
this.innerOverlay.setOptions({ fillOpacity: t });
|
|
2982
3016
|
}
|
|
2983
3017
|
}
|
|
2984
|
-
class
|
|
3018
|
+
class Lt extends S {
|
|
2985
3019
|
constructor() {
|
|
2986
3020
|
super(...arguments);
|
|
2987
3021
|
c(this, "prevCenter");
|
|
@@ -3008,11 +3042,11 @@ class Ot extends B {
|
|
|
3008
3042
|
enableEditing: !1,
|
|
3009
3043
|
// options.editable,
|
|
3010
3044
|
strokeColor: e.strokeColor,
|
|
3011
|
-
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity +
|
|
3045
|
+
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity + S.OPACITY_DELTA : void 0,
|
|
3012
3046
|
strokeWeight: e.strokeWeight,
|
|
3013
3047
|
fillColor: e.fillColor,
|
|
3014
|
-
fillOpacity: e.fillOpacity != null ? e.fillOpacity +
|
|
3015
|
-
}), n = new
|
|
3048
|
+
fillOpacity: e.fillOpacity != null ? e.fillOpacity + S.OPACITY_DELTA : void 0
|
|
3049
|
+
}), n = new Lt(s, r, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
3016
3050
|
return n.state.editable && setTimeout(() => {
|
|
3017
3051
|
n.state.editable && s.enableEditing();
|
|
3018
3052
|
}, 0), n;
|
|
@@ -3043,7 +3077,7 @@ class Ot extends B {
|
|
|
3043
3077
|
return this.innerOverlay.getRadius();
|
|
3044
3078
|
}
|
|
3045
3079
|
}
|
|
3046
|
-
class
|
|
3080
|
+
class xt extends Ke {
|
|
3047
3081
|
static create(t) {
|
|
3048
3082
|
const e = this.coordType, r = new google.maps.Circle({
|
|
3049
3083
|
center: t.center.toGoogle(e),
|
|
@@ -3057,7 +3091,7 @@ class Ct extends qe {
|
|
|
3057
3091
|
fillOpacity: t.fillOpacity,
|
|
3058
3092
|
visible: t.visible
|
|
3059
3093
|
});
|
|
3060
|
-
return new
|
|
3094
|
+
return new xt(r, e, this);
|
|
3061
3095
|
}
|
|
3062
3096
|
setCenter(t) {
|
|
3063
3097
|
this.coordType = this.map.coordType, this.innerOverlay.setCenter(t.toGoogle(this.coordType));
|
|
@@ -3072,10 +3106,10 @@ class Ct extends qe {
|
|
|
3072
3106
|
return this.innerOverlay.getRadius();
|
|
3073
3107
|
}
|
|
3074
3108
|
}
|
|
3075
|
-
function
|
|
3109
|
+
function xr() {
|
|
3076
3110
|
BMap.OverlayV3 || (BMap.OverlayV3 = BMap.Overlay);
|
|
3077
3111
|
}
|
|
3078
|
-
const
|
|
3112
|
+
const Qt = {
|
|
3079
3113
|
/** {@link BMap.Point.equals} 无效, 故需要自己写一个 */
|
|
3080
3114
|
equals(i, t) {
|
|
3081
3115
|
return i.lat === t.lat && i.lng === t.lng;
|
|
@@ -3085,12 +3119,12 @@ var X;
|
|
|
3085
3119
|
((i) => {
|
|
3086
3120
|
i.ZERO = { x: 0, y: 0 };
|
|
3087
3121
|
})(X || (X = {}));
|
|
3088
|
-
let
|
|
3089
|
-
function
|
|
3090
|
-
return
|
|
3122
|
+
let rt;
|
|
3123
|
+
function zi(i, t, e, r, s, n) {
|
|
3124
|
+
return rt || (rt = Di()), new rt(i, t, e, r, s, n);
|
|
3091
3125
|
}
|
|
3092
|
-
function
|
|
3093
|
-
|
|
3126
|
+
function Di() {
|
|
3127
|
+
xr();
|
|
3094
3128
|
const i = new BMap.Point(0, 0);
|
|
3095
3129
|
return class extends BMap.OverlayV3 {
|
|
3096
3130
|
constructor(r, s = i, n = X.ZERO, a, d = 654, o = "") {
|
|
@@ -3156,7 +3190,7 @@ function Ai() {
|
|
|
3156
3190
|
}
|
|
3157
3191
|
};
|
|
3158
3192
|
}
|
|
3159
|
-
class
|
|
3193
|
+
class Pt {
|
|
3160
3194
|
constructor(t) {
|
|
3161
3195
|
this.delegate = t, this.delegate.setTarget(this);
|
|
3162
3196
|
}
|
|
@@ -3167,7 +3201,7 @@ class wt {
|
|
|
3167
3201
|
this.delegate.removeEventListener(t, e);
|
|
3168
3202
|
}
|
|
3169
3203
|
}
|
|
3170
|
-
class
|
|
3204
|
+
class It extends Pt {
|
|
3171
3205
|
constructor(t, e, r) {
|
|
3172
3206
|
super(new le(t, e)), this.inner = t, this.map = e, this.state = r;
|
|
3173
3207
|
}
|
|
@@ -3177,7 +3211,7 @@ class Et extends wt {
|
|
|
3177
3211
|
offset: t.offset && new BMap.Size(t.offset.x, t.offset.y),
|
|
3178
3212
|
enableAutoPan: !t.disableAutoPan
|
|
3179
3213
|
});
|
|
3180
|
-
return new
|
|
3214
|
+
return new It(r, this, { position: e });
|
|
3181
3215
|
}
|
|
3182
3216
|
isOpen() {
|
|
3183
3217
|
return this.inner.isOpen();
|
|
@@ -3196,10 +3230,10 @@ class Et extends wt {
|
|
|
3196
3230
|
this.state.position = t, this.inner.isOpen() && this.open();
|
|
3197
3231
|
}
|
|
3198
3232
|
}
|
|
3199
|
-
class
|
|
3233
|
+
class Bt extends Pt {
|
|
3200
3234
|
constructor(e, r) {
|
|
3201
3235
|
super(new ie(e, r));
|
|
3202
|
-
c(this, "eventHub", new
|
|
3236
|
+
c(this, "eventHub", new lr());
|
|
3203
3237
|
c(this, "isOpened", !1);
|
|
3204
3238
|
this.inner = e, this.map = r, e.addListener("closeclick", () => {
|
|
3205
3239
|
this.isOpened = !1, this.eventHub.hasListener("close") && this.eventHub.notify({ type: "close", target: this });
|
|
@@ -3216,7 +3250,7 @@ class Lt extends wt {
|
|
|
3216
3250
|
position: r.toGoogle(this.coordType),
|
|
3217
3251
|
disableAutoPan: e.disableAutoPan
|
|
3218
3252
|
});
|
|
3219
|
-
return new
|
|
3253
|
+
return new Bt(s, this);
|
|
3220
3254
|
}
|
|
3221
3255
|
isOpen() {
|
|
3222
3256
|
return this.isOpened;
|
|
@@ -3254,13 +3288,13 @@ class Lt extends wt {
|
|
|
3254
3288
|
this.inner.setPosition(e.toGoogle(this.map.coordType));
|
|
3255
3289
|
}
|
|
3256
3290
|
}
|
|
3257
|
-
class
|
|
3291
|
+
class kt extends qe {
|
|
3258
3292
|
constructor(t, e, r) {
|
|
3259
3293
|
super(t, e, r), this.baiduMap = r;
|
|
3260
3294
|
}
|
|
3261
3295
|
static create(t) {
|
|
3262
3296
|
var s;
|
|
3263
|
-
const e = this.coordType, r =
|
|
3297
|
+
const e = this.coordType, r = zi(
|
|
3264
3298
|
t.content,
|
|
3265
3299
|
(s = t.position) == null ? void 0 : s.toBaidu(e),
|
|
3266
3300
|
t.offset,
|
|
@@ -3268,7 +3302,7 @@ class xt extends Ye {
|
|
|
3268
3302
|
t.maxWidth,
|
|
3269
3303
|
t.borderClass
|
|
3270
3304
|
);
|
|
3271
|
-
return new
|
|
3305
|
+
return new kt(r, e, this);
|
|
3272
3306
|
}
|
|
3273
3307
|
open(t) {
|
|
3274
3308
|
this.innerOverlay.open(this.baiduMap.innerMap, t == null ? void 0 : t.innerOverlay);
|
|
@@ -3289,7 +3323,7 @@ class xt extends Ye {
|
|
|
3289
3323
|
this.innerOverlay.setZIndex(t);
|
|
3290
3324
|
}
|
|
3291
3325
|
}
|
|
3292
|
-
class
|
|
3326
|
+
class St extends Pt {
|
|
3293
3327
|
constructor(t, e, r) {
|
|
3294
3328
|
super(new ie(t, r)), this.inner = t, this.coordType = e, this.map = r;
|
|
3295
3329
|
}
|
|
@@ -3306,7 +3340,7 @@ class Pt extends wt {
|
|
|
3306
3340
|
var d;
|
|
3307
3341
|
const a = (d = t.content.parentElement) == null ? void 0 : d.parentElement;
|
|
3308
3342
|
a && a.className.includes("gm-style-iw-c") && !a.className.includes(s) && (a.className += ` ${s}`);
|
|
3309
|
-
}), new
|
|
3343
|
+
}), new St(r, e, this);
|
|
3310
3344
|
}
|
|
3311
3345
|
open(t) {
|
|
3312
3346
|
this.inner.open(this.map.innerMap, t == null ? void 0 : t.innerOverlay);
|
|
@@ -3356,7 +3390,7 @@ var ue;
|
|
|
3356
3390
|
}
|
|
3357
3391
|
i.isInt = s;
|
|
3358
3392
|
})(ue || (ue = {}));
|
|
3359
|
-
const
|
|
3393
|
+
const Ni = {
|
|
3360
3394
|
/** @see https://nodejs.org/docs/v10.3.0/api/path.html#path_path_basename_path_ext */
|
|
3361
3395
|
basename(i, t) {
|
|
3362
3396
|
const e = i.endsWith("/") ? i.slice(0, -1) : i, r = e.lastIndexOf("/"), s = r >= 0 ? e.substring(r + 1) : e;
|
|
@@ -3376,7 +3410,7 @@ var we = /* @__PURE__ */ ((i) => (i.map = "map", i.overlay = "overlay", i.overla
|
|
|
3376
3410
|
case "map":
|
|
3377
3411
|
return s.mapPane;
|
|
3378
3412
|
default:
|
|
3379
|
-
|
|
3413
|
+
nt(r);
|
|
3380
3414
|
}
|
|
3381
3415
|
}
|
|
3382
3416
|
i.toGoogle = t;
|
|
@@ -3391,12 +3425,12 @@ var we = /* @__PURE__ */ ((i) => (i.map = "map", i.overlay = "overlay", i.overla
|
|
|
3391
3425
|
case "map":
|
|
3392
3426
|
return s.mapPane;
|
|
3393
3427
|
default:
|
|
3394
|
-
|
|
3428
|
+
nt(r);
|
|
3395
3429
|
}
|
|
3396
3430
|
}
|
|
3397
3431
|
i.toBaidu = e;
|
|
3398
3432
|
})(Ee || (Ee = {}));
|
|
3399
|
-
class
|
|
3433
|
+
class Gi {
|
|
3400
3434
|
constructor(t, e) {
|
|
3401
3435
|
c(this, "baidu");
|
|
3402
3436
|
c(this, "google");
|
|
@@ -3417,7 +3451,7 @@ class $i {
|
|
|
3417
3451
|
asBaidu() {
|
|
3418
3452
|
if (!this.baidu) {
|
|
3419
3453
|
const t = this;
|
|
3420
|
-
|
|
3454
|
+
xr();
|
|
3421
3455
|
class e extends BMap.OverlayV3 {
|
|
3422
3456
|
initialize(n) {
|
|
3423
3457
|
var o;
|
|
@@ -3446,7 +3480,7 @@ class $i {
|
|
|
3446
3480
|
const t = this;
|
|
3447
3481
|
class e extends google.maps.OverlayView {
|
|
3448
3482
|
onAdd() {
|
|
3449
|
-
const s = t.create(), n = this.getPanes() ??
|
|
3483
|
+
const s = t.create(), n = this.getPanes() ?? w("onAdd回调中一定会有panes");
|
|
3450
3484
|
Ee.toGoogle(t.mapPane, n).appendChild(s);
|
|
3451
3485
|
}
|
|
3452
3486
|
draw() {
|
|
@@ -3469,11 +3503,11 @@ class $i {
|
|
|
3469
3503
|
return this.google;
|
|
3470
3504
|
}
|
|
3471
3505
|
}
|
|
3472
|
-
let
|
|
3473
|
-
function
|
|
3474
|
-
return
|
|
3506
|
+
let it;
|
|
3507
|
+
function Zi(i, t, e, r, s) {
|
|
3508
|
+
return it || (it = Wi()), new it(i, t, e, r, s);
|
|
3475
3509
|
}
|
|
3476
|
-
function
|
|
3510
|
+
function Wi() {
|
|
3477
3511
|
return class extends google.maps.OverlayView {
|
|
3478
3512
|
constructor(e, r, s, n = we.overlayMouseTarget, a) {
|
|
3479
3513
|
super();
|
|
@@ -3490,7 +3524,7 @@ function Di() {
|
|
|
3490
3524
|
r !== e && (r ? this.container.replaceChild(r, e) : this.container.appendChild(e));
|
|
3491
3525
|
}
|
|
3492
3526
|
onAdd() {
|
|
3493
|
-
const e = this.getPanes() ??
|
|
3527
|
+
const e = this.getPanes() ?? w("onAdd回调中一定能够获取panes");
|
|
3494
3528
|
Ee.toGoogle(this._mapPane, e).appendChild(this.container);
|
|
3495
3529
|
}
|
|
3496
3530
|
draw() {
|
|
@@ -3542,7 +3576,7 @@ var pe;
|
|
|
3542
3576
|
}
|
|
3543
3577
|
i.toElement = e;
|
|
3544
3578
|
})(pe || (pe = {}));
|
|
3545
|
-
class
|
|
3579
|
+
class At extends qe {
|
|
3546
3580
|
constructor(e, r, s, n) {
|
|
3547
3581
|
super(e, r, s);
|
|
3548
3582
|
c(this, "icon");
|
|
@@ -3562,7 +3596,7 @@ class kt extends Ye {
|
|
|
3562
3596
|
padding: "0px",
|
|
3563
3597
|
backgroundColor: "unset"
|
|
3564
3598
|
});
|
|
3565
|
-
const n = new
|
|
3599
|
+
const n = new At(s, r, this, e.content);
|
|
3566
3600
|
return s.__label__ = n, n;
|
|
3567
3601
|
}
|
|
3568
3602
|
setContentInternal(e, r = !1) {
|
|
@@ -3642,17 +3676,17 @@ class kt extends Ye {
|
|
|
3642
3676
|
this.iconAnchor && (n -= this.iconAnchor.width, a -= this.iconAnchor.height), r && (n += r.width, a += r.height), this.innerOverlay.setOffset(new BMap.Size(n, a)), this.icon = e, this.iconAnchor = r;
|
|
3643
3677
|
}
|
|
3644
3678
|
}
|
|
3645
|
-
class
|
|
3679
|
+
class Rt extends Et {
|
|
3646
3680
|
static create(t) {
|
|
3647
3681
|
var s;
|
|
3648
|
-
const e = this.coordType, r =
|
|
3682
|
+
const e = this.coordType, r = Zi(
|
|
3649
3683
|
pe.toElement(t.content),
|
|
3650
3684
|
(s = t.position) == null ? void 0 : s.toGoogle(e),
|
|
3651
3685
|
t.offset,
|
|
3652
3686
|
t.mapPane,
|
|
3653
3687
|
t.zIndex
|
|
3654
3688
|
);
|
|
3655
|
-
return new
|
|
3689
|
+
return new Rt(r, e, this);
|
|
3656
3690
|
}
|
|
3657
3691
|
setZIndex(t) {
|
|
3658
3692
|
this.innerOverlay.setZIndex(t);
|
|
@@ -3735,7 +3769,7 @@ var ge;
|
|
|
3735
3769
|
}
|
|
3736
3770
|
i.toBaidu = e;
|
|
3737
3771
|
})(ge || (ge = {}));
|
|
3738
|
-
const
|
|
3772
|
+
const tn = {
|
|
3739
3773
|
CIRCLE: { baidu: () => BMap_Symbol_SHAPE_CIRCLE, google: () => google.maps.SymbolPath.CIRCLE },
|
|
3740
3774
|
BACKWARD_CLOSED_ARROW: { baidu: () => BMap_Symbol_SHAPE_BACKWARD_CLOSED_ARROW, google: () => google.maps.SymbolPath.BACKWARD_CLOSED_ARROW },
|
|
3741
3775
|
BACKWARD_OPEN_ARROW: { baidu: () => BMap_Symbol_SHAPE_BACKWARD_OPEN_ARROW, google: () => google.maps.SymbolPath.BACKWARD_OPEN_ARROW },
|
|
@@ -3763,7 +3797,7 @@ var Ge;
|
|
|
3763
3797
|
}
|
|
3764
3798
|
i.toBaidu = e;
|
|
3765
3799
|
})(Ge || (Ge = {}));
|
|
3766
|
-
class Le extends
|
|
3800
|
+
class Le extends qe {
|
|
3767
3801
|
constructor(t, e, r, s) {
|
|
3768
3802
|
super(t, e, r), this.state = s;
|
|
3769
3803
|
}
|
|
@@ -3830,7 +3864,7 @@ class Le extends Ye {
|
|
|
3830
3864
|
return (t = this.innerOverlay.getLabel()) == null ? void 0 : t.__label__;
|
|
3831
3865
|
}
|
|
3832
3866
|
}
|
|
3833
|
-
class
|
|
3867
|
+
class $t extends Et {
|
|
3834
3868
|
constructor() {
|
|
3835
3869
|
super(...arguments);
|
|
3836
3870
|
c(this, "label");
|
|
@@ -3853,7 +3887,7 @@ class Bt extends Mt {
|
|
|
3853
3887
|
// InfoWindow相对marker的position的偏移量, 若不指定, 则偏移到marker的icon的上部中央
|
|
3854
3888
|
anchorPoint: new google.maps.Point(0, 0)
|
|
3855
3889
|
};
|
|
3856
|
-
return new
|
|
3890
|
+
return new $t(new google.maps.Marker(n), r, this);
|
|
3857
3891
|
}
|
|
3858
3892
|
getPosition() {
|
|
3859
3893
|
return v.fromGoogle(this.innerOverlay.getPosition(), this.coordType);
|
|
@@ -3906,7 +3940,7 @@ class Bt extends Mt {
|
|
|
3906
3940
|
this.label = void 0, this.labelPositionListener = void 0, this.labelVisibleListener = void 0, this.labelMapChangedListener = void 0;
|
|
3907
3941
|
}
|
|
3908
3942
|
}
|
|
3909
|
-
class
|
|
3943
|
+
class zt extends S {
|
|
3910
3944
|
constructor() {
|
|
3911
3945
|
super(...arguments);
|
|
3912
3946
|
c(this, "eventHubDelegate");
|
|
@@ -3942,7 +3976,7 @@ class St extends B {
|
|
|
3942
3976
|
});
|
|
3943
3977
|
}
|
|
3944
3978
|
}
|
|
3945
|
-
class
|
|
3979
|
+
class Dt extends zt {
|
|
3946
3980
|
constructor() {
|
|
3947
3981
|
super(...arguments);
|
|
3948
3982
|
c(this, "pathEditedEventType", "path-edited");
|
|
@@ -3953,11 +3987,11 @@ class At extends St {
|
|
|
3953
3987
|
enableClicking: e.clickable,
|
|
3954
3988
|
enableEditing: e.editable,
|
|
3955
3989
|
strokeColor: e.strokeColor,
|
|
3956
|
-
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity +
|
|
3990
|
+
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity + S.OPACITY_DELTA : void 0,
|
|
3957
3991
|
strokeWeight: e.strokeWeight,
|
|
3958
3992
|
icons: (n = e.icons) == null ? void 0 : n.map(Ge.toBaidu)
|
|
3959
3993
|
});
|
|
3960
|
-
return new
|
|
3994
|
+
return new Dt(s, r, this, {
|
|
3961
3995
|
editable: !!e.editable,
|
|
3962
3996
|
symbolIcons: (a = e.icons) == null ? void 0 : a.map((d) => d.icon)
|
|
3963
3997
|
}).visibleOptionInternal(e.visible);
|
|
@@ -3985,7 +4019,7 @@ class At extends St {
|
|
|
3985
4019
|
}).forEach((s) => this.map.innerMap.removeOverlay(s));
|
|
3986
4020
|
}
|
|
3987
4021
|
}
|
|
3988
|
-
class
|
|
4022
|
+
class Nt extends Ke {
|
|
3989
4023
|
constructor() {
|
|
3990
4024
|
super(...arguments);
|
|
3991
4025
|
c(this, "pathChangedListeners");
|
|
@@ -4003,7 +4037,7 @@ class Rt extends qe {
|
|
|
4003
4037
|
visible: e.visible,
|
|
4004
4038
|
icons: (n = e.icons) == null ? void 0 : n.map(Ge.toGoogle)
|
|
4005
4039
|
});
|
|
4006
|
-
return new
|
|
4040
|
+
return new Nt(s, r, this);
|
|
4007
4041
|
}
|
|
4008
4042
|
setupPathChangedListeners() {
|
|
4009
4043
|
const e = () => {
|
|
@@ -4034,7 +4068,7 @@ class Rt extends qe {
|
|
|
4034
4068
|
this.coordType = this.map.coordType, this.innerOverlay.setPath(e.map((s) => s.toGoogle(this.coordType))), (r = this.eventHubDelegate) != null && r.hasListener("path-edited") && this.setupPathChangedListeners();
|
|
4035
4069
|
}
|
|
4036
4070
|
}
|
|
4037
|
-
class
|
|
4071
|
+
class Gt extends zt {
|
|
4038
4072
|
constructor() {
|
|
4039
4073
|
super(...arguments);
|
|
4040
4074
|
c(this, "pathEditedEventType", "paths-edited");
|
|
@@ -4046,12 +4080,12 @@ class $t extends St {
|
|
|
4046
4080
|
enableClicking: e.clickable,
|
|
4047
4081
|
enableEditing: e.editable,
|
|
4048
4082
|
strokeColor: e.strokeColor,
|
|
4049
|
-
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity +
|
|
4083
|
+
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity + S.OPACITY_DELTA : void 0,
|
|
4050
4084
|
strokeWeight: e.strokeWeight,
|
|
4051
4085
|
fillColor: e.fillColor,
|
|
4052
|
-
fillOpacity: e.fillOpacity != null ? e.fillOpacity +
|
|
4086
|
+
fillOpacity: e.fillOpacity != null ? e.fillOpacity + S.OPACITY_DELTA : void 0
|
|
4053
4087
|
});
|
|
4054
|
-
return new
|
|
4088
|
+
return new Gt(n, r, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
4055
4089
|
}
|
|
4056
4090
|
getPaths() {
|
|
4057
4091
|
return [this.innerOverlay.getPath().map((e) => v.fromBaidu(e, this.coordType))];
|
|
@@ -4060,7 +4094,7 @@ class $t extends St {
|
|
|
4060
4094
|
e.length > 1 && console.warn("baidu不支持多path, 只会显示paths[0]"), this.coordType = this.map.coordType, this.setPathInternal((e[0] || []).map((r) => r.toBaidu(this.coordType)));
|
|
4061
4095
|
}
|
|
4062
4096
|
}
|
|
4063
|
-
class
|
|
4097
|
+
class Zt extends Ke {
|
|
4064
4098
|
constructor() {
|
|
4065
4099
|
super(...arguments);
|
|
4066
4100
|
c(this, "pathChangedListeners");
|
|
@@ -4078,7 +4112,7 @@ class zt extends qe {
|
|
|
4078
4112
|
fillOpacity: e.fillOpacity,
|
|
4079
4113
|
visible: e.visible
|
|
4080
4114
|
});
|
|
4081
|
-
return new
|
|
4115
|
+
return new Zt(s, r, this);
|
|
4082
4116
|
}
|
|
4083
4117
|
setupPathChangedListeners() {
|
|
4084
4118
|
const e = () => {
|
|
@@ -4114,7 +4148,7 @@ class zt extends qe {
|
|
|
4114
4148
|
this.coordType = this.map.coordType, this.innerOverlay.setPaths(e.map((s) => s.map((n) => n.toGoogle(this.coordType)))), (r = this.eventHubDelegate) != null && r.hasListener("paths-edited") && this.setupPathChangedListeners();
|
|
4115
4149
|
}
|
|
4116
4150
|
}
|
|
4117
|
-
class
|
|
4151
|
+
class Wt extends zt {
|
|
4118
4152
|
constructor(e, r, s, n) {
|
|
4119
4153
|
super(e, r, s, n);
|
|
4120
4154
|
c(this, "pathEditedEventType", "bounds-changed");
|
|
@@ -4129,7 +4163,7 @@ class Dt extends St {
|
|
|
4129
4163
|
if (r.length === 4)
|
|
4130
4164
|
if (a > r.length) {
|
|
4131
4165
|
for (let o = 0; o < a; o++)
|
|
4132
|
-
if (r[o] == null || !
|
|
4166
|
+
if (r[o] == null || !Qt.equals(s[o], r[o])) {
|
|
4133
4167
|
const l = s[(o - 2 + a) % a], h = s[(o - 1 + a) % a], u = s[o], p = s[(o + 1) % a], f = s[(o + 2) % a];
|
|
4134
4168
|
let _;
|
|
4135
4169
|
h.lat === p.lat ? _ = new BMap.Point(h.lng, u.lat) : h.lng === p.lng ? _ = new BMap.Point(u.lng, h.lat) : _ = u, n = [l, f, _];
|
|
@@ -4137,7 +4171,7 @@ class Dt extends St {
|
|
|
4137
4171
|
}
|
|
4138
4172
|
} else if (a === r.length) {
|
|
4139
4173
|
for (let o = 0; o < a; o++)
|
|
4140
|
-
if (!
|
|
4174
|
+
if (!Qt.equals(s[o], r[o])) {
|
|
4141
4175
|
n = [
|
|
4142
4176
|
s[o],
|
|
4143
4177
|
s[(o + 2) % 4]
|
|
@@ -4157,12 +4191,12 @@ class Dt extends St {
|
|
|
4157
4191
|
enableClicking: e.clickable,
|
|
4158
4192
|
enableEditing: e.editable,
|
|
4159
4193
|
strokeColor: e.strokeColor,
|
|
4160
|
-
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity +
|
|
4194
|
+
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity + S.OPACITY_DELTA : void 0,
|
|
4161
4195
|
strokeWeight: e.strokeWeight,
|
|
4162
4196
|
fillColor: e.fillColor,
|
|
4163
|
-
fillOpacity: e.fillOpacity != null ? e.fillOpacity +
|
|
4197
|
+
fillOpacity: e.fillOpacity != null ? e.fillOpacity + S.OPACITY_DELTA : void 0
|
|
4164
4198
|
});
|
|
4165
|
-
return new
|
|
4199
|
+
return new Wt(s, r, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
4166
4200
|
}
|
|
4167
4201
|
getBounds() {
|
|
4168
4202
|
return R.fromBaidu(this.innerOverlay.getBounds(), this.coordType);
|
|
@@ -4174,7 +4208,7 @@ class Dt extends St {
|
|
|
4174
4208
|
}) : this.setPathInternal(r.map((s) => s.toBaidu(this.coordType)));
|
|
4175
4209
|
}
|
|
4176
4210
|
}
|
|
4177
|
-
class
|
|
4211
|
+
class Ht extends Ke {
|
|
4178
4212
|
static create(t) {
|
|
4179
4213
|
const e = this.coordType, r = new google.maps.Rectangle({
|
|
4180
4214
|
bounds: t.bounds.toGoogle(e),
|
|
@@ -4187,7 +4221,7 @@ class Nt extends qe {
|
|
|
4187
4221
|
fillOpacity: t.fillOpacity,
|
|
4188
4222
|
visible: t.visible
|
|
4189
4223
|
});
|
|
4190
|
-
return new
|
|
4224
|
+
return new Ht(r, e, this);
|
|
4191
4225
|
}
|
|
4192
4226
|
getBounds() {
|
|
4193
4227
|
return R.fromGoogle(this.innerOverlay.getBounds() ?? J.BOUNDS_ZERO, this.coordType);
|
|
@@ -4198,24 +4232,25 @@ class Nt extends qe {
|
|
|
4198
4232
|
}
|
|
4199
4233
|
}
|
|
4200
4234
|
const te = 1;
|
|
4201
|
-
class
|
|
4235
|
+
class Hi extends wt {
|
|
4202
4236
|
constructor(e, r) {
|
|
4203
4237
|
var s;
|
|
4204
4238
|
super(e);
|
|
4205
4239
|
c(this, "buildInMapTypeId2BIMT");
|
|
4206
4240
|
c(this, "baiduMapType2BIMT");
|
|
4207
4241
|
c(this, "map");
|
|
4208
|
-
c(this, "createLabel",
|
|
4209
|
-
c(this, "createCircle",
|
|
4210
|
-
c(this, "createPolygon",
|
|
4211
|
-
c(this, "createPolyline",
|
|
4212
|
-
c(this, "createRectangle",
|
|
4213
|
-
c(this, "createInfoWindow",
|
|
4214
|
-
c(this, "createInfoBox",
|
|
4242
|
+
c(this, "createLabel", At.create);
|
|
4243
|
+
c(this, "createCircle", Lt.create);
|
|
4244
|
+
c(this, "createPolygon", Gt.create);
|
|
4245
|
+
c(this, "createPolyline", Dt.create);
|
|
4246
|
+
c(this, "createRectangle", Wt.create);
|
|
4247
|
+
c(this, "createInfoWindow", It.create);
|
|
4248
|
+
c(this, "createInfoBox", kt.create);
|
|
4215
4249
|
c(this, "createMarker", Le.create);
|
|
4216
|
-
c(this, "createMapTypeControl",
|
|
4217
|
-
c(this, "createZoomControl",
|
|
4218
|
-
c(this, "
|
|
4250
|
+
c(this, "createMapTypeControl", yt.create);
|
|
4251
|
+
c(this, "createZoomControl", Mt.create);
|
|
4252
|
+
c(this, "createStreetViewControl", bt.create);
|
|
4253
|
+
c(this, "createScaleControl", vt.create);
|
|
4219
4254
|
this.buildInMapTypeId2BIMT = $.BUILD_IN_MAP_TYPES.getValueMap(A.prototype.getId), this.baiduMapType2BIMT = $.BUILD_IN_MAP_TYPES.getValueMap(A.prototype.asBaiduMapType), this.map = new BMap.Map(e, {
|
|
4220
4255
|
minZoom: r.minZoom && r.minZoom + te,
|
|
4221
4256
|
maxZoom: r.maxZoom && r.maxZoom + te,
|
|
@@ -4231,7 +4266,7 @@ class Ni extends Tt {
|
|
|
4231
4266
|
});
|
|
4232
4267
|
}
|
|
4233
4268
|
setGestureHandling(e = j.auto) {
|
|
4234
|
-
switch (e === j.auto && (e = this.element.parentElement &&
|
|
4269
|
+
switch (e === j.auto && (e = this.element.parentElement && lt.isScrollable(this.element.parentElement) ? j.cooperative : j.greedy), e) {
|
|
4235
4270
|
case j.cooperative:
|
|
4236
4271
|
this.map.disableScrollWheelZoom(), this.map.enableDragging(), this.map.enableDoubleClickZoom();
|
|
4237
4272
|
break;
|
|
@@ -4302,14 +4337,14 @@ class Ni extends Tt {
|
|
|
4302
4337
|
setBuildInMapTypeId(e) {
|
|
4303
4338
|
var s;
|
|
4304
4339
|
const r = (s = this.buildInMapTypeId2BIMT.get(e)) == null ? void 0 : s.asBaiduMapType();
|
|
4305
|
-
this.map.setMapType(r ??
|
|
4340
|
+
this.map.setMapType(r ?? w("理论上来说不可能为空"));
|
|
4306
4341
|
}
|
|
4307
4342
|
setMapType(e) {
|
|
4308
4343
|
this.map.setMapType(e.asBaiduMapType());
|
|
4309
4344
|
}
|
|
4310
4345
|
getMapType() {
|
|
4311
4346
|
const e = this.map.getMapType(), r = this.baiduMapType2BIMT.get(e);
|
|
4312
|
-
return r || (e.__baidu_map_type__ ??
|
|
4347
|
+
return r || (e.__baidu_map_type__ ?? w("实现asBaiduMapType()时, 忘了给实例设置__baidu_map_type__?"));
|
|
4313
4348
|
}
|
|
4314
4349
|
addLayer(e) {
|
|
4315
4350
|
this.map.addTileLayer(e.asBaiduLayer());
|
|
@@ -4349,7 +4384,7 @@ class Ni extends Tt {
|
|
|
4349
4384
|
const r = class extends BMap.Control {
|
|
4350
4385
|
constructor() {
|
|
4351
4386
|
super(...arguments);
|
|
4352
|
-
c(this, "defaultAnchor",
|
|
4387
|
+
c(this, "defaultAnchor", D.getBaidu().toValue(e.position));
|
|
4353
4388
|
c(this, "defaultOffset", new BMap.Size(0, 0));
|
|
4354
4389
|
}
|
|
4355
4390
|
initialize(n) {
|
|
@@ -4364,46 +4399,46 @@ class Ni extends Tt {
|
|
|
4364
4399
|
e.inner && (ae(e.inner instanceof BMap.Control, `control.inner(${e.inner})需要是BMap.Control`), this.map.removeControl(e.inner));
|
|
4365
4400
|
}
|
|
4366
4401
|
createMarkerClusterer(e) {
|
|
4367
|
-
return new
|
|
4402
|
+
return new gi(this, e);
|
|
4368
4403
|
}
|
|
4369
4404
|
createAutocomplete(e) {
|
|
4370
|
-
return new
|
|
4405
|
+
return new hi(this, e);
|
|
4371
4406
|
}
|
|
4372
4407
|
createSearchBox(e) {
|
|
4373
|
-
return new
|
|
4408
|
+
return new _i(this, e);
|
|
4374
4409
|
}
|
|
4375
4410
|
createPlacesService(e) {
|
|
4376
|
-
return new
|
|
4411
|
+
return new yi(this, e);
|
|
4377
4412
|
}
|
|
4378
4413
|
createMapUrls(e) {
|
|
4379
4414
|
return new Re(e);
|
|
4380
4415
|
}
|
|
4381
4416
|
}
|
|
4382
|
-
class
|
|
4417
|
+
class ji extends wt {
|
|
4383
4418
|
constructor(e, r) {
|
|
4384
4419
|
var n, a;
|
|
4385
4420
|
super(e);
|
|
4386
4421
|
c(this, "buildInMapTypeId2BIMT");
|
|
4387
4422
|
c(this, "googleMapTypeId2BIMT");
|
|
4388
4423
|
c(this, "map");
|
|
4389
|
-
c(this, "createLabel",
|
|
4390
|
-
c(this, "createCircle",
|
|
4391
|
-
c(this, "createPolygon",
|
|
4392
|
-
c(this, "createPolyline",
|
|
4393
|
-
c(this, "createRectangle",
|
|
4394
|
-
c(this, "createInfoWindow",
|
|
4395
|
-
c(this, "createInfoBox",
|
|
4396
|
-
c(this, "createMarker",
|
|
4424
|
+
c(this, "createLabel", Rt.create);
|
|
4425
|
+
c(this, "createCircle", xt.create);
|
|
4426
|
+
c(this, "createPolygon", Zt.create);
|
|
4427
|
+
c(this, "createPolyline", Nt.create);
|
|
4428
|
+
c(this, "createRectangle", Ht.create);
|
|
4429
|
+
c(this, "createInfoWindow", Bt.create);
|
|
4430
|
+
c(this, "createInfoBox", St.create);
|
|
4431
|
+
c(this, "createMarker", $t.create);
|
|
4397
4432
|
c(this, "createMapTypeControl", Se.create);
|
|
4398
|
-
c(this, "createZoomControl",
|
|
4399
|
-
c(this, "
|
|
4433
|
+
c(this, "createZoomControl", Ct.create);
|
|
4434
|
+
c(this, "createStreetViewControl", Tt.create);
|
|
4435
|
+
c(this, "createScaleControl", _t.create);
|
|
4400
4436
|
this.mapOptions = r, this.buildInMapTypeId2BIMT = $.BUILD_IN_MAP_TYPES.getValueMap(A.prototype.getId), this.googleMapTypeId2BIMT = $.BUILD_IN_MAP_TYPES.getValueMap(A.prototype.getGoogleMapTypeId);
|
|
4401
4437
|
const s = r.buildInMapTypeId && this.buildInMapTypeId2BIMT.get(r.buildInMapTypeId);
|
|
4402
4438
|
this.map = new google.maps.Map(e, {
|
|
4403
4439
|
center: r.center.toGoogle((s ?? $.NORMAL).getGoogleCoordType()),
|
|
4404
4440
|
zoom: r.zoom,
|
|
4405
4441
|
disableDefaultUI: !0,
|
|
4406
|
-
streetViewControl: !0,
|
|
4407
4442
|
gestureHandling: r.gestureHandling,
|
|
4408
4443
|
minZoom: r.minZoom,
|
|
4409
4444
|
maxZoom: r.maxZoom,
|
|
@@ -4473,14 +4508,14 @@ class Gi extends Tt {
|
|
|
4473
4508
|
setBuildInMapTypeId(e) {
|
|
4474
4509
|
var s;
|
|
4475
4510
|
const r = (s = this.buildInMapTypeId2BIMT.get(e)) == null ? void 0 : s.getGoogleMapTypeId();
|
|
4476
|
-
this.map.setMapTypeId(r ??
|
|
4511
|
+
this.map.setMapTypeId(r ?? w("理论上来说不可能为空"));
|
|
4477
4512
|
}
|
|
4478
4513
|
setMapType(e) {
|
|
4479
4514
|
e instanceof A ? this.map.setMapTypeId(e.getGoogleMapTypeId()) : (this.map.mapTypes.set(e.id, e.asGoogleMapType()), this.map.setMapTypeId(e.id));
|
|
4480
4515
|
}
|
|
4481
4516
|
getMapType() {
|
|
4482
4517
|
const e = this.map.getMapTypeId() ?? google.maps.MapTypeId.ROADMAP, r = this.googleMapTypeId2BIMT.get(e);
|
|
4483
|
-
return r || (this.map.mapTypes.get(e).__google_map_type__ ??
|
|
4518
|
+
return r || (this.map.mapTypes.get(e).__google_map_type__ ?? w(`实现${e}的asGoogleMapType()时, 忘了给实例设置__google_map_type__?`));
|
|
4484
4519
|
}
|
|
4485
4520
|
addOverlayMapType(e) {
|
|
4486
4521
|
this.map.overlayMapTypes.push(e.asGoogleMapType());
|
|
@@ -4520,31 +4555,31 @@ class Gi extends Tt {
|
|
|
4520
4555
|
e.innerOverlay.setMap(null);
|
|
4521
4556
|
}
|
|
4522
4557
|
addCustomControl(e) {
|
|
4523
|
-
e.inner || (e.inner = e.onCreateElement(), this.map.controls[
|
|
4558
|
+
e.inner || (e.inner = e.onCreateElement(), this.map.controls[D.getGoogle().toValue(e.position)].push(e.inner));
|
|
4524
4559
|
}
|
|
4525
4560
|
removeCustomControl(e) {
|
|
4526
4561
|
if (e.inner) {
|
|
4527
|
-
const r = this.map.controls[
|
|
4562
|
+
const r = this.map.controls[D.getGoogle().toValue(e.position)];
|
|
4528
4563
|
ce.remove(r, e.inner);
|
|
4529
4564
|
}
|
|
4530
4565
|
}
|
|
4531
4566
|
createMarkerClusterer(e) {
|
|
4532
|
-
return new
|
|
4567
|
+
return new mi(this, e);
|
|
4533
4568
|
}
|
|
4534
4569
|
createAutocomplete(e) {
|
|
4535
|
-
return new
|
|
4570
|
+
return new li(this, e);
|
|
4536
4571
|
}
|
|
4537
4572
|
createSearchBox(e) {
|
|
4538
|
-
return new
|
|
4573
|
+
return new vi(this, e);
|
|
4539
4574
|
}
|
|
4540
4575
|
createPlacesService(e) {
|
|
4541
|
-
return new
|
|
4576
|
+
return new fi(this, e);
|
|
4542
4577
|
}
|
|
4543
4578
|
createMapUrls(e) {
|
|
4544
4579
|
return new Ae(e);
|
|
4545
4580
|
}
|
|
4546
4581
|
}
|
|
4547
|
-
const Ze = ["3.0"],
|
|
4582
|
+
const Ze = ["3.0"], Vi = {
|
|
4548
4583
|
baidu: {
|
|
4549
4584
|
version: "3.0",
|
|
4550
4585
|
// 在build时会被静态替换, 导致使用者不能无法设置它
|
|
@@ -4563,22 +4598,22 @@ const Ze = ["3.0"], Zi = {
|
|
|
4563
4598
|
key: ""
|
|
4564
4599
|
}
|
|
4565
4600
|
};
|
|
4566
|
-
let
|
|
4567
|
-
function
|
|
4568
|
-
return
|
|
4601
|
+
let Pr;
|
|
4602
|
+
function Ir() {
|
|
4603
|
+
return Pr || w("请先安装: Vue<PartialTgMapConfig>.use(TgMap, {})");
|
|
4569
4604
|
}
|
|
4570
|
-
function
|
|
4571
|
-
i != null && (
|
|
4605
|
+
function Fi(i) {
|
|
4606
|
+
i != null && (Pr = wr(Vi, i));
|
|
4572
4607
|
}
|
|
4573
|
-
class
|
|
4608
|
+
class Ui extends wt {
|
|
4574
4609
|
constructor(e, r) {
|
|
4575
4610
|
var a;
|
|
4576
4611
|
super(e);
|
|
4577
4612
|
c(this, "map");
|
|
4578
4613
|
c(this, "defaultLayers");
|
|
4579
4614
|
this.mapOptions = r;
|
|
4580
|
-
const s =
|
|
4581
|
-
Ze.includes(s.version) ||
|
|
4615
|
+
const s = Ir().here;
|
|
4616
|
+
Ze.includes(s.version) || w(`不支持${s.version}, HereMap当前只支持如下版本: ${Ze}`);
|
|
4582
4617
|
const n = new H.service.Platform({
|
|
4583
4618
|
app_id: s.key.split(",")[0],
|
|
4584
4619
|
app_code: s.key.split(",")[1]
|
|
@@ -4592,7 +4627,7 @@ class Hi extends Tt {
|
|
|
4592
4627
|
return this.map;
|
|
4593
4628
|
}
|
|
4594
4629
|
get coordType() {
|
|
4595
|
-
return
|
|
4630
|
+
return P.wgs84;
|
|
4596
4631
|
}
|
|
4597
4632
|
getCenter() {
|
|
4598
4633
|
return v.fromHere(this.map.getCenter(), this.coordType);
|
|
@@ -4718,43 +4753,46 @@ class Hi extends Tt {
|
|
|
4718
4753
|
createZoomControl(e) {
|
|
4719
4754
|
throw new Error("Method not implemented.");
|
|
4720
4755
|
}
|
|
4756
|
+
createStreetViewControl(e) {
|
|
4757
|
+
throw new Error("Method not implemented.");
|
|
4758
|
+
}
|
|
4721
4759
|
createScaleControl(e) {
|
|
4722
4760
|
throw new Error("Method not implemented.");
|
|
4723
4761
|
}
|
|
4724
4762
|
}
|
|
4725
|
-
var
|
|
4763
|
+
var Z = /* @__PURE__ */ ((i) => (i.google = "google", i.baidu = "baidu", i.here = "here", i))(Z || {}), ct;
|
|
4726
4764
|
((i) => {
|
|
4727
4765
|
function t(e, r, s) {
|
|
4728
|
-
const n =
|
|
4766
|
+
const n = ht.create(s);
|
|
4729
4767
|
switch (e) {
|
|
4730
4768
|
case "google":
|
|
4731
|
-
return new
|
|
4769
|
+
return new ji(r, n);
|
|
4732
4770
|
case "baidu":
|
|
4733
|
-
return new Ni(r, n);
|
|
4734
|
-
case "here":
|
|
4735
4771
|
return new Hi(r, n);
|
|
4772
|
+
case "here":
|
|
4773
|
+
return new Ui(r, n);
|
|
4736
4774
|
}
|
|
4737
4775
|
}
|
|
4738
4776
|
i.createMap = t;
|
|
4739
|
-
})(
|
|
4740
|
-
const
|
|
4741
|
-
function
|
|
4742
|
-
return Q.putIfAbsent(
|
|
4777
|
+
})(ct || (ct = {}));
|
|
4778
|
+
const Yi = {};
|
|
4779
|
+
function qi(i) {
|
|
4780
|
+
return Q.putIfAbsent(Yi, i, () => Jr(() => Ki({ type: i, config: Ir()[i] })))();
|
|
4743
4781
|
}
|
|
4744
|
-
function
|
|
4745
|
-
const e = window, r =
|
|
4782
|
+
function Ki({ type: i, config: t }) {
|
|
4783
|
+
const e = window, r = Xi(i);
|
|
4746
4784
|
if (Q.get(e, r))
|
|
4747
4785
|
return Promise.resolve();
|
|
4748
|
-
switch (i !==
|
|
4749
|
-
case
|
|
4750
|
-
return {}.VITE_FALSE ? (
|
|
4786
|
+
switch (i !== Z.here && !t.key && w(`请先配置${i}地图的key`), i) {
|
|
4787
|
+
case Z.google:
|
|
4788
|
+
return {}.VITE_FALSE ? (ni({
|
|
4751
4789
|
key: t.key,
|
|
4752
4790
|
v: "3.52"
|
|
4753
4791
|
// v: config.version,
|
|
4754
|
-
}), google.maps.importLibrary("core")) :
|
|
4755
|
-
case
|
|
4756
|
-
return
|
|
4757
|
-
case
|
|
4792
|
+
}), google.maps.importLibrary("core")) : er(`https://maps.googleapis.com/maps/api/js?key=${t.key}&language=${t.language}&v=${t.version}&libraries=${t.libraries.join(",")}`);
|
|
4793
|
+
case Z.baidu:
|
|
4794
|
+
return er(`https://api.map.baidu.com/api?v=${t.version}&ak=${t.key}`);
|
|
4795
|
+
case Z.here:
|
|
4758
4796
|
return ye(fe("core", t.version)).then(() => Promise.all([
|
|
4759
4797
|
// 其他大多数模块都可以同时载入
|
|
4760
4798
|
ye(fe("service", t.version)),
|
|
@@ -4763,26 +4801,26 @@ function Fi({ type: i, config: t }) {
|
|
|
4763
4801
|
ye(fe("ui", t.version))
|
|
4764
4802
|
])).catch((s) => (Q.del(e, r), Promise.reject(s)));
|
|
4765
4803
|
default:
|
|
4766
|
-
|
|
4804
|
+
nt(i);
|
|
4767
4805
|
}
|
|
4768
4806
|
}
|
|
4769
4807
|
function fe(i, t = Ze[0]) {
|
|
4770
4808
|
return `https://js.api.here.com/v3/${t}/mapsjs-${i}.js`;
|
|
4771
4809
|
}
|
|
4772
|
-
function
|
|
4810
|
+
function Xi(i) {
|
|
4773
4811
|
switch (i) {
|
|
4774
|
-
case
|
|
4812
|
+
case Z.google:
|
|
4775
4813
|
return "google.maps";
|
|
4776
|
-
case
|
|
4814
|
+
case Z.baidu:
|
|
4777
4815
|
return "BMap";
|
|
4778
|
-
case
|
|
4816
|
+
case Z.here:
|
|
4779
4817
|
return "H";
|
|
4780
4818
|
}
|
|
4781
4819
|
}
|
|
4782
|
-
let
|
|
4783
|
-
function
|
|
4820
|
+
let Ji = 0;
|
|
4821
|
+
function er(i, t = "callback") {
|
|
4784
4822
|
return new Promise((e, r) => {
|
|
4785
|
-
const s = `__callback${
|
|
4823
|
+
const s = `__callback${Ji++}`;
|
|
4786
4824
|
window[s] = e;
|
|
4787
4825
|
const n = document.createElement("script");
|
|
4788
4826
|
n.src = `${i}&${t}=${s}`, n.onerror = r, document.body.appendChild(n);
|
|
@@ -4794,21 +4832,21 @@ function ye(i) {
|
|
|
4794
4832
|
r.src = i, r.onload = t, r.onerror = e, document.body.appendChild(r);
|
|
4795
4833
|
});
|
|
4796
4834
|
}
|
|
4797
|
-
function
|
|
4835
|
+
function z(i, t) {
|
|
4798
4836
|
return {
|
|
4799
4837
|
type: String,
|
|
4800
4838
|
default: t,
|
|
4801
4839
|
validator: (e) => Object.values(i).includes(e)
|
|
4802
4840
|
};
|
|
4803
4841
|
}
|
|
4804
|
-
function
|
|
4842
|
+
function Qi(i, t) {
|
|
4805
4843
|
return {
|
|
4806
4844
|
type: String,
|
|
4807
4845
|
default: t,
|
|
4808
4846
|
validator: (e) => i.includes(e)
|
|
4809
4847
|
};
|
|
4810
4848
|
}
|
|
4811
|
-
function
|
|
4849
|
+
function N(i) {
|
|
4812
4850
|
return {
|
|
4813
4851
|
type: i,
|
|
4814
4852
|
required: !0
|
|
@@ -4820,7 +4858,7 @@ function m(i, t) {
|
|
|
4820
4858
|
default: t
|
|
4821
4859
|
};
|
|
4822
4860
|
}
|
|
4823
|
-
function
|
|
4861
|
+
function rn(i) {
|
|
4824
4862
|
const t = {};
|
|
4825
4863
|
return Object.entries(i).forEach(([e, r]) => {
|
|
4826
4864
|
const s = `__${e}`;
|
|
@@ -4840,34 +4878,34 @@ function Js(i) {
|
|
|
4840
4878
|
const ve = {
|
|
4841
4879
|
enumerable: !0,
|
|
4842
4880
|
configurable: !0,
|
|
4843
|
-
get:
|
|
4844
|
-
set:
|
|
4881
|
+
get: Ce,
|
|
4882
|
+
set: Ce
|
|
4845
4883
|
};
|
|
4846
|
-
function
|
|
4884
|
+
function es(i) {
|
|
4847
4885
|
return Object.keys(i).forEach((t) => {
|
|
4848
4886
|
const e = i[t];
|
|
4849
4887
|
let r = !1;
|
|
4850
|
-
typeof e == "function" ? (ve.get = e, ve.set =
|
|
4888
|
+
typeof e == "function" ? (ve.get = e, ve.set = Ce, r = !0) : typeof e == "object" && typeof e.get == "function" && (ve.get = e.get, ve.set = e.set, r = !0), r && (i[t] = Object.defineProperty(i, t, ve));
|
|
4851
4889
|
}), i;
|
|
4852
4890
|
}
|
|
4853
|
-
function
|
|
4854
|
-
return
|
|
4891
|
+
function sn(i) {
|
|
4892
|
+
return es(i);
|
|
4855
4893
|
}
|
|
4856
|
-
function
|
|
4857
|
-
return
|
|
4894
|
+
function jt() {
|
|
4895
|
+
return st();
|
|
4858
4896
|
}
|
|
4859
|
-
function
|
|
4897
|
+
function ke(i, t) {
|
|
4860
4898
|
const e = i.$options[t];
|
|
4861
4899
|
if (e)
|
|
4862
4900
|
for (const r of e)
|
|
4863
4901
|
r.call(i);
|
|
4864
4902
|
}
|
|
4865
|
-
function
|
|
4903
|
+
function nn(i, t) {
|
|
4866
4904
|
for (const e of i)
|
|
4867
4905
|
if (e.$options.name === t.name)
|
|
4868
4906
|
return e;
|
|
4869
4907
|
}
|
|
4870
|
-
function
|
|
4908
|
+
function on(i, t) {
|
|
4871
4909
|
if (!i.default)
|
|
4872
4910
|
return;
|
|
4873
4911
|
const e = i.default();
|
|
@@ -4875,7 +4913,7 @@ function tn(i, t) {
|
|
|
4875
4913
|
if ((r == null ? void 0 : r.type).name === t.name)
|
|
4876
4914
|
return r;
|
|
4877
4915
|
}
|
|
4878
|
-
function
|
|
4916
|
+
function ts(i, t) {
|
|
4879
4917
|
const e = {}, r = {}, s = {};
|
|
4880
4918
|
return Object.keys(i).forEach((n) => {
|
|
4881
4919
|
n.startsWith("on") ? e[ue.pascal2kebab(n.substring(2))] = i[n] : r[n] = i[n];
|
|
@@ -4891,12 +4929,12 @@ function Xi(i, t) {
|
|
|
4891
4929
|
};
|
|
4892
4930
|
}
|
|
4893
4931
|
function q(i, t) {
|
|
4894
|
-
return
|
|
4932
|
+
return rr(() => ts(i, t));
|
|
4895
4933
|
}
|
|
4896
4934
|
function L() {
|
|
4897
4935
|
return Function;
|
|
4898
4936
|
}
|
|
4899
|
-
const
|
|
4937
|
+
const an = () => {
|
|
4900
4938
|
let i, t;
|
|
4901
4939
|
function e(s) {
|
|
4902
4940
|
console.log(s), i = s && s.type, t = Date.now();
|
|
@@ -4905,33 +4943,33 @@ const rn = () => {
|
|
|
4905
4943
|
((s && s.type) !== i || Date.now() - (t ?? 0) > 1e3) && e(s);
|
|
4906
4944
|
}
|
|
4907
4945
|
return { eventLog: e, eventLogLess: r };
|
|
4908
|
-
},
|
|
4909
|
-
inject: [
|
|
4946
|
+
}, Vt = "$map", xe = "onCreate", Pe = "onDestroy", B = O({
|
|
4947
|
+
inject: [Vt],
|
|
4910
4948
|
mounted() {
|
|
4911
|
-
|
|
4949
|
+
ke(this, xe);
|
|
4912
4950
|
},
|
|
4913
4951
|
beforeUnmount() {
|
|
4914
|
-
|
|
4952
|
+
ke(this, Pe);
|
|
4915
4953
|
},
|
|
4916
4954
|
methods: {
|
|
4917
4955
|
recreate() {
|
|
4918
|
-
|
|
4956
|
+
ke(this, Pe), ke(this, xe);
|
|
4919
4957
|
}
|
|
4920
4958
|
},
|
|
4921
4959
|
render() {
|
|
4922
|
-
return
|
|
4960
|
+
return jt();
|
|
4923
4961
|
}
|
|
4924
|
-
}),
|
|
4962
|
+
}), rs = O({
|
|
4925
4963
|
name: "tg-map",
|
|
4926
4964
|
provide() {
|
|
4927
4965
|
return {
|
|
4928
|
-
[
|
|
4966
|
+
[Vt]: rr(() => this.map)
|
|
4929
4967
|
};
|
|
4930
4968
|
},
|
|
4931
4969
|
inheritAttrs: !1,
|
|
4932
4970
|
props: {
|
|
4933
4971
|
/** type没做响应式, 但外部可以把type作为tg-map的key, 让type修改时完全重建tg-map */
|
|
4934
|
-
type: Z
|
|
4972
|
+
type: z(Z, Z.google),
|
|
4935
4973
|
/**
|
|
4936
4974
|
* 当对该属性使用双向绑定时, 改变center将触发update:center又反过来触发center改变, 最终导致无限循环...
|
|
4937
4975
|
* 当前通过setCenter()时判断center是否有改变来避免该问题, 但为了避免可能存在的问题, 另外设计了如下机制:
|
|
@@ -4940,7 +4978,7 @@ const rn = () => {
|
|
|
4940
4978
|
* - :last-center.sync="center": 获取tg-map销毁时的最后的center的值, 使用这种方式可以做到type切换时保留中心点位置
|
|
4941
4979
|
* @see AbstractMapEventMap.center-changed
|
|
4942
4980
|
* */
|
|
4943
|
-
center:
|
|
4981
|
+
center: N(v),
|
|
4944
4982
|
/**
|
|
4945
4983
|
* 同步center的延时
|
|
4946
4984
|
* @default 300
|
|
@@ -4957,17 +4995,17 @@ const rn = () => {
|
|
|
4957
4995
|
* @see center
|
|
4958
4996
|
*/
|
|
4959
4997
|
lastCenter: m(v),
|
|
4960
|
-
zoom:
|
|
4998
|
+
zoom: N(Number),
|
|
4961
4999
|
/**
|
|
4962
5000
|
* 该属性不会响应式更新, 要让它立即生效, 请参考{@link file://./../views/map/InfoDemo.vue#L3}
|
|
4963
5001
|
* @see MapOptions.infoWindowMode
|
|
4964
5002
|
*/
|
|
4965
|
-
infoWindowMode:
|
|
4966
|
-
gestureHandling:
|
|
5003
|
+
infoWindowMode: Qi($i),
|
|
5004
|
+
gestureHandling: z(j),
|
|
4967
5005
|
minZoom: m(Number),
|
|
4968
5006
|
maxZoom: m(Number),
|
|
4969
5007
|
mapStyle: m(Object),
|
|
4970
|
-
mapTypeId:
|
|
5008
|
+
mapTypeId: z(hr),
|
|
4971
5009
|
/** 地图类型对象, 优先级比mapTypeId高 */
|
|
4972
5010
|
mapType: m(Object),
|
|
4973
5011
|
hideLogo: m(Boolean),
|
|
@@ -4990,7 +5028,7 @@ const rn = () => {
|
|
|
4990
5028
|
},
|
|
4991
5029
|
data() {
|
|
4992
5030
|
return {
|
|
4993
|
-
map:
|
|
5031
|
+
map: ot(),
|
|
4994
5032
|
isDestroyed: !1
|
|
4995
5033
|
};
|
|
4996
5034
|
},
|
|
@@ -5028,7 +5066,7 @@ const rn = () => {
|
|
|
5028
5066
|
async mounted() {
|
|
5029
5067
|
const i = this.type;
|
|
5030
5068
|
try {
|
|
5031
|
-
await
|
|
5069
|
+
await qi(i);
|
|
5032
5070
|
} catch (s) {
|
|
5033
5071
|
this.$emit("error", s);
|
|
5034
5072
|
return;
|
|
@@ -5037,7 +5075,7 @@ const rn = () => {
|
|
|
5037
5075
|
console.warn(`tg-map(type=${i})已销毁, 不需要继续执行`);
|
|
5038
5076
|
return;
|
|
5039
5077
|
}
|
|
5040
|
-
const t =
|
|
5078
|
+
const t = ct.createMap(
|
|
5041
5079
|
i,
|
|
5042
5080
|
this.$refs.map,
|
|
5043
5081
|
/* options: */
|
|
@@ -5052,12 +5090,12 @@ const rn = () => {
|
|
|
5052
5090
|
buildInMapTypeId: this.mapTypeId
|
|
5053
5091
|
}
|
|
5054
5092
|
);
|
|
5055
|
-
if (this.map =
|
|
5093
|
+
if (this.map = Nr(t), this.mapType && t.setMapType(this.mapType), "ready" in this.attrs.listeners && console.error("地图载入完成的事件已经从ready改为了load, 请手动修改"), Y(
|
|
5056
5094
|
this.attrs.listeners,
|
|
5057
5095
|
t,
|
|
5058
5096
|
/* excludes: */
|
|
5059
5097
|
["load"]
|
|
5060
|
-
), this.$emit("load", t),
|
|
5098
|
+
), this.$emit("load", t), dt([
|
|
5061
5099
|
() => this.zoom,
|
|
5062
5100
|
() => this.center
|
|
5063
5101
|
//
|
|
@@ -5091,22 +5129,22 @@ const K = (i, t) => {
|
|
|
5091
5129
|
e[r] = s;
|
|
5092
5130
|
return e;
|
|
5093
5131
|
};
|
|
5094
|
-
function
|
|
5132
|
+
function is(i, t, e, r, s, n) {
|
|
5095
5133
|
return F(), U("div", me({ class: "tg-map" }, i.attrs.binds), [
|
|
5096
|
-
|
|
5134
|
+
Gr("div", {
|
|
5097
5135
|
ref: "map",
|
|
5098
5136
|
class: Ve({
|
|
5099
5137
|
"tg-map__map": !0,
|
|
5100
5138
|
[`tg-map__map--hide-logo-${i.type}`]: i.hideLogo
|
|
5101
5139
|
})
|
|
5102
5140
|
}, null, 2),
|
|
5103
|
-
|
|
5104
|
-
i.map ? W(i.$slots, "default", { key: 1 }) :
|
|
5141
|
+
st("", !0),
|
|
5142
|
+
i.map ? W(i.$slots, "default", { key: 1 }) : st("", !0),
|
|
5105
5143
|
W(i.$slots, "overlay")
|
|
5106
5144
|
], 16);
|
|
5107
5145
|
}
|
|
5108
|
-
const
|
|
5109
|
-
function
|
|
5146
|
+
const Ie = /* @__PURE__ */ K(rs, [["render", is]]);
|
|
5147
|
+
function ss(i) {
|
|
5110
5148
|
if (i == null)
|
|
5111
5149
|
return;
|
|
5112
5150
|
let t;
|
|
@@ -5117,7 +5155,7 @@ function es(i) {
|
|
|
5117
5155
|
t = i;
|
|
5118
5156
|
return `${t}px`;
|
|
5119
5157
|
}
|
|
5120
|
-
const
|
|
5158
|
+
const ns = O({
|
|
5121
5159
|
name: "tg-map-widget",
|
|
5122
5160
|
props: {
|
|
5123
5161
|
left: {
|
|
@@ -5143,22 +5181,22 @@ const ts = w({
|
|
|
5143
5181
|
}
|
|
5144
5182
|
},
|
|
5145
5183
|
methods: {
|
|
5146
|
-
dimen:
|
|
5184
|
+
dimen: ss
|
|
5147
5185
|
}
|
|
5148
5186
|
});
|
|
5149
|
-
function
|
|
5187
|
+
function os(i, t, e, r, s, n) {
|
|
5150
5188
|
return F(), U("div", {
|
|
5151
5189
|
class: Ve(i.$options.name),
|
|
5152
|
-
style:
|
|
5190
|
+
style: Zr({ left: i.dimen(i.left), top: i.dimen(i.topValue), right: i.dimen(i.right), bottom: i.dimen(i.bottom) })
|
|
5153
5191
|
}, [
|
|
5154
5192
|
W(i.$slots, "default")
|
|
5155
5193
|
], 6);
|
|
5156
5194
|
}
|
|
5157
|
-
const
|
|
5195
|
+
const as = /* @__PURE__ */ K(ns, [["render", os]]), ls = O({
|
|
5158
5196
|
name: "tg-custom-control",
|
|
5159
|
-
mixins: [
|
|
5197
|
+
mixins: [B],
|
|
5160
5198
|
props: {
|
|
5161
|
-
position:
|
|
5199
|
+
position: z(x, x.RIGHT_BOTTOM)
|
|
5162
5200
|
},
|
|
5163
5201
|
setup() {
|
|
5164
5202
|
return {
|
|
@@ -5171,8 +5209,8 @@ const is = /* @__PURE__ */ K(ts, [["render", rs]]), ss = w({
|
|
|
5171
5209
|
}
|
|
5172
5210
|
},
|
|
5173
5211
|
onCreate() {
|
|
5174
|
-
|
|
5175
|
-
const { $el: i } = this, t = class extends
|
|
5212
|
+
nr(this.$parent, Ie) || console.warn("请将tg-custom-control放到tg-map中");
|
|
5213
|
+
const { $el: i } = this, t = class extends ri {
|
|
5176
5214
|
onCreateElement() {
|
|
5177
5215
|
return i;
|
|
5178
5216
|
}
|
|
@@ -5183,19 +5221,19 @@ const is = /* @__PURE__ */ K(ts, [["render", rs]]), ss = w({
|
|
|
5183
5221
|
this.$map.removeCustomControl(this.control);
|
|
5184
5222
|
}
|
|
5185
5223
|
});
|
|
5186
|
-
function
|
|
5224
|
+
function hs(i, t, e, r, s, n) {
|
|
5187
5225
|
return F(), U("div", {
|
|
5188
5226
|
class: Ve(i.$options.name)
|
|
5189
5227
|
}, [
|
|
5190
5228
|
W(i.$slots, "default")
|
|
5191
5229
|
], 2);
|
|
5192
5230
|
}
|
|
5193
|
-
const
|
|
5231
|
+
const cs = /* @__PURE__ */ K(ls, [["render", hs]]), ds = O({
|
|
5194
5232
|
name: "tg-map-type-control",
|
|
5195
|
-
mixins: [
|
|
5233
|
+
mixins: [B],
|
|
5196
5234
|
props: {
|
|
5197
|
-
position:
|
|
5198
|
-
type:
|
|
5235
|
+
position: z(x, x.TOP_LEFT),
|
|
5236
|
+
type: z(cr),
|
|
5199
5237
|
mapTypes: m(Array)
|
|
5200
5238
|
},
|
|
5201
5239
|
setup() {
|
|
@@ -5223,11 +5261,11 @@ const os = /* @__PURE__ */ K(ss, [["render", ns]]), as = w({
|
|
|
5223
5261
|
onDestroy() {
|
|
5224
5262
|
this.$map.removeControl(this.control);
|
|
5225
5263
|
}
|
|
5226
|
-
}),
|
|
5264
|
+
}), us = O({
|
|
5227
5265
|
name: "tg-scale-control",
|
|
5228
|
-
mixins: [
|
|
5266
|
+
mixins: [B],
|
|
5229
5267
|
props: {
|
|
5230
|
-
position:
|
|
5268
|
+
position: z(x, x.BOTTOM_RIGHT)
|
|
5231
5269
|
},
|
|
5232
5270
|
setup() {
|
|
5233
5271
|
return {
|
|
@@ -5246,32 +5284,32 @@ const os = /* @__PURE__ */ K(ss, [["render", ns]]), as = w({
|
|
|
5246
5284
|
this.$map.removeControl(this.control);
|
|
5247
5285
|
}
|
|
5248
5286
|
});
|
|
5249
|
-
function
|
|
5287
|
+
function Br() {
|
|
5250
5288
|
var e;
|
|
5251
|
-
const i = (e =
|
|
5289
|
+
const i = (e = Wr()) == null ? void 0 : e.type;
|
|
5252
5290
|
let t = (i == null ? void 0 : i.name) ?? (i == null ? void 0 : i.__name);
|
|
5253
5291
|
if (!t) {
|
|
5254
5292
|
const r = i == null ? void 0 : i.__file;
|
|
5255
|
-
r && (t =
|
|
5293
|
+
r && (t = Ni.basename(r, ".vue"));
|
|
5256
5294
|
}
|
|
5257
5295
|
return t;
|
|
5258
5296
|
}
|
|
5259
|
-
function
|
|
5260
|
-
const i =
|
|
5297
|
+
function kr() {
|
|
5298
|
+
const i = Hr(Vt);
|
|
5261
5299
|
let t, e;
|
|
5262
|
-
return i == null &&
|
|
5300
|
+
return i == null && w(`<${Br() || "unknown"}>必须作为<tg-map>的子代组件`), {
|
|
5263
5301
|
mapRef: i,
|
|
5264
5302
|
/** 读取map对象, 只要放在<tg-map>里面的组件(除#overlay插槽外)都能够立即读取到map对象 */
|
|
5265
5303
|
get map() {
|
|
5266
|
-
return i.value ??
|
|
5304
|
+
return i.value ?? w("map尚未初始化");
|
|
5267
5305
|
},
|
|
5268
5306
|
/** 地图元素创建回调 */
|
|
5269
5307
|
[xe](r) {
|
|
5270
|
-
|
|
5308
|
+
jr(r), t && w(`${xe}只能调用一次`), t = r;
|
|
5271
5309
|
},
|
|
5272
5310
|
/** 地图元素销毁回调 */
|
|
5273
5311
|
[Pe](r) {
|
|
5274
|
-
|
|
5312
|
+
Vr(r), e && w(`${Pe}只能调用一次`), e = r;
|
|
5275
5313
|
},
|
|
5276
5314
|
/** 重新创建地图元素 */
|
|
5277
5315
|
recreate() {
|
|
@@ -5279,25 +5317,41 @@ function hs() {
|
|
|
5279
5317
|
}
|
|
5280
5318
|
};
|
|
5281
5319
|
}
|
|
5282
|
-
const
|
|
5320
|
+
const ps = O({
|
|
5321
|
+
name: "tg-street-view-control",
|
|
5322
|
+
props: {
|
|
5323
|
+
position: z(x, x.RIGHT_BOTTOM)
|
|
5324
|
+
},
|
|
5325
|
+
setup(i) {
|
|
5326
|
+
let t = void 0;
|
|
5327
|
+
const { map: e, onCreate: r, onDestroy: s } = kr();
|
|
5328
|
+
return r(() => {
|
|
5329
|
+
t = e.createStreetViewControl(i), e.addControl(t);
|
|
5330
|
+
}), s(() => {
|
|
5331
|
+
e.removeControl(t);
|
|
5332
|
+
}), dt(() => i.position, (n) => {
|
|
5333
|
+
t.setPosition(n);
|
|
5334
|
+
}), jt;
|
|
5335
|
+
}
|
|
5336
|
+
}), gs = O({
|
|
5283
5337
|
name: "tg-zoom-control",
|
|
5284
5338
|
props: {
|
|
5285
|
-
position:
|
|
5339
|
+
position: z(x, x.RIGHT_BOTTOM)
|
|
5286
5340
|
},
|
|
5287
5341
|
setup(i) {
|
|
5288
5342
|
let t = void 0;
|
|
5289
|
-
const { map: e, onCreate: r, onDestroy: s } =
|
|
5343
|
+
const { map: e, onCreate: r, onDestroy: s } = kr();
|
|
5290
5344
|
return r(() => {
|
|
5291
5345
|
t = e.createZoomControl(i), e.addControl(t);
|
|
5292
5346
|
}), s(() => {
|
|
5293
5347
|
e.removeControl(t);
|
|
5294
|
-
}),
|
|
5348
|
+
}), dt(() => i.position, (n) => {
|
|
5295
5349
|
t.setPosition(n);
|
|
5296
|
-
}),
|
|
5350
|
+
}), jt;
|
|
5297
5351
|
}
|
|
5298
|
-
}),
|
|
5352
|
+
}), ms = O({
|
|
5299
5353
|
name: "tg-marker-clusterer",
|
|
5300
|
-
mixins: [
|
|
5354
|
+
mixins: [B],
|
|
5301
5355
|
// markers从this.$children中读取, 故需要省略(Omit)
|
|
5302
5356
|
props: {
|
|
5303
5357
|
gridSize: m(Number),
|
|
@@ -5359,16 +5413,16 @@ const cs = w({
|
|
|
5359
5413
|
}
|
|
5360
5414
|
}
|
|
5361
5415
|
});
|
|
5362
|
-
function
|
|
5416
|
+
function fs(i, t, e, r, s, n) {
|
|
5363
5417
|
return F(), U("div", {
|
|
5364
5418
|
class: Ve(i.$options.name)
|
|
5365
5419
|
}, [
|
|
5366
5420
|
W(i.$slots, "default")
|
|
5367
5421
|
], 2);
|
|
5368
5422
|
}
|
|
5369
|
-
const
|
|
5423
|
+
const Sr = /* @__PURE__ */ K(ms, [["render", fs]]), ys = O({
|
|
5370
5424
|
name: "tg-traffic-layer",
|
|
5371
|
-
mixins: [
|
|
5425
|
+
mixins: [B],
|
|
5372
5426
|
// 请直接使用v-if来控制它的显隐
|
|
5373
5427
|
// 没有属性时, 写`{}`类型推断会有问题, 故注释掉
|
|
5374
5428
|
// props: {} satisfies Props<{}>,
|
|
@@ -5379,18 +5433,18 @@ const kr = /* @__PURE__ */ K(ds, [["render", us]]), ps = w({
|
|
|
5379
5433
|
},
|
|
5380
5434
|
watch: {},
|
|
5381
5435
|
onCreate() {
|
|
5382
|
-
this.layer = new
|
|
5436
|
+
this.layer = new si(), this.$map.addLayer(this.layer);
|
|
5383
5437
|
},
|
|
5384
5438
|
onDestroy() {
|
|
5385
5439
|
this.$map.removeLayer(this.layer);
|
|
5386
5440
|
}
|
|
5387
|
-
}),
|
|
5441
|
+
}), vs = O({
|
|
5388
5442
|
name: "tg-circle",
|
|
5389
|
-
mixins: [
|
|
5443
|
+
mixins: [B],
|
|
5390
5444
|
inheritAttrs: !1,
|
|
5391
5445
|
props: {
|
|
5392
|
-
center:
|
|
5393
|
-
radius:
|
|
5446
|
+
center: N(v),
|
|
5447
|
+
radius: N(Number),
|
|
5394
5448
|
clickable: m(Boolean),
|
|
5395
5449
|
editable: m(Boolean),
|
|
5396
5450
|
strokeColor: m(String),
|
|
@@ -5464,7 +5518,7 @@ const kr = /* @__PURE__ */ K(ds, [["render", us]]), ps = w({
|
|
|
5464
5518
|
this.$map.removeOverlay(this.overlay);
|
|
5465
5519
|
}
|
|
5466
5520
|
});
|
|
5467
|
-
class
|
|
5521
|
+
class _s extends Gi {
|
|
5468
5522
|
constructor(t, e, r, s) {
|
|
5469
5523
|
super(t, e), this.content = r, this.position = s;
|
|
5470
5524
|
}
|
|
@@ -5479,12 +5533,12 @@ class ms extends $i {
|
|
|
5479
5533
|
this.position = t, this.draw();
|
|
5480
5534
|
}
|
|
5481
5535
|
}
|
|
5482
|
-
const
|
|
5536
|
+
const bs = O({
|
|
5483
5537
|
name: "tg-element-overlay",
|
|
5484
|
-
mixins: [
|
|
5538
|
+
mixins: [B],
|
|
5485
5539
|
props: {
|
|
5486
|
-
mapPane:
|
|
5487
|
-
position:
|
|
5540
|
+
mapPane: z(we, we.overlayMouseTarget),
|
|
5541
|
+
position: N(v)
|
|
5488
5542
|
},
|
|
5489
5543
|
setup() {
|
|
5490
5544
|
return {
|
|
@@ -5505,25 +5559,25 @@ const fs = w({
|
|
|
5505
5559
|
}
|
|
5506
5560
|
},
|
|
5507
5561
|
onCreate() {
|
|
5508
|
-
this.overlay = new
|
|
5562
|
+
this.overlay = new _s(this.$map, this, this.content(), this.position), this.$map.addElementOverlay(this.overlay);
|
|
5509
5563
|
},
|
|
5510
5564
|
onDestroy() {
|
|
5511
5565
|
this.$map.removeElementOverlay(this.overlay);
|
|
5512
5566
|
}
|
|
5513
5567
|
});
|
|
5514
|
-
function
|
|
5568
|
+
function Ts(i, t, e, r, s, n) {
|
|
5515
5569
|
return F(), U("div", me({
|
|
5516
5570
|
class: i.$options.name
|
|
5517
5571
|
}, i.$attrs), [
|
|
5518
5572
|
W(i.$slots, "default")
|
|
5519
5573
|
], 16);
|
|
5520
5574
|
}
|
|
5521
|
-
const
|
|
5575
|
+
const Ms = /* @__PURE__ */ K(bs, [["render", Ts]]), Cs = O({
|
|
5522
5576
|
name: "tg-marker",
|
|
5523
|
-
mixins: [
|
|
5577
|
+
mixins: [B],
|
|
5524
5578
|
inheritAttrs: !1,
|
|
5525
5579
|
props: {
|
|
5526
|
-
position:
|
|
5580
|
+
position: N(v),
|
|
5527
5581
|
title: m(String),
|
|
5528
5582
|
icon: m(Object),
|
|
5529
5583
|
clickable: m(Boolean),
|
|
@@ -5545,8 +5599,8 @@ const vs = /* @__PURE__ */ K(fs, [["render", ys]]), _s = w({
|
|
|
5545
5599
|
return {
|
|
5546
5600
|
attrs: q(t, i),
|
|
5547
5601
|
marker: void 0,
|
|
5548
|
-
label:
|
|
5549
|
-
info:
|
|
5602
|
+
label: ot(),
|
|
5603
|
+
info: ot(),
|
|
5550
5604
|
emittedPosition: void 0,
|
|
5551
5605
|
autoAddToClustererWhenCreate: i.autoAddToClusterer
|
|
5552
5606
|
};
|
|
@@ -5601,7 +5655,7 @@ const vs = /* @__PURE__ */ K(fs, [["render", ys]]), _s = w({
|
|
|
5601
5655
|
},
|
|
5602
5656
|
methods: {
|
|
5603
5657
|
$clusterer() {
|
|
5604
|
-
return
|
|
5658
|
+
return nr(this.$parent, Sr);
|
|
5605
5659
|
},
|
|
5606
5660
|
onAddLabel(i) {
|
|
5607
5661
|
this.label = i, this.marker && this.marker.setLabel(i.overlay);
|
|
@@ -5620,19 +5674,19 @@ const vs = /* @__PURE__ */ K(fs, [["render", ys]]), _s = w({
|
|
|
5620
5674
|
}
|
|
5621
5675
|
}
|
|
5622
5676
|
});
|
|
5623
|
-
function
|
|
5677
|
+
function Os(i, t, e, r, s, n) {
|
|
5624
5678
|
return F(), U("div", me({
|
|
5625
5679
|
class: i.$options.name
|
|
5626
5680
|
}, i.attrs.binds), [
|
|
5627
5681
|
W(i.$slots, "default")
|
|
5628
5682
|
], 16);
|
|
5629
5683
|
}
|
|
5630
|
-
const
|
|
5684
|
+
const Xe = /* @__PURE__ */ K(Cs, [["render", Os]]), ws = O({
|
|
5631
5685
|
name: "tg-info-box",
|
|
5632
|
-
mixins: [
|
|
5686
|
+
mixins: [B],
|
|
5633
5687
|
inheritAttrs: !1,
|
|
5634
5688
|
props: {
|
|
5635
|
-
show:
|
|
5689
|
+
show: N(Boolean),
|
|
5636
5690
|
position: m(v),
|
|
5637
5691
|
offset: m(Object),
|
|
5638
5692
|
maxWidth: m(Number),
|
|
@@ -5690,7 +5744,7 @@ const Ke = /* @__PURE__ */ K(_s, [["render", bs]]), Ts = w({
|
|
|
5690
5744
|
return this.$el;
|
|
5691
5745
|
},
|
|
5692
5746
|
$marker() {
|
|
5693
|
-
return
|
|
5747
|
+
return pt(Xe, this.$parent, Ie);
|
|
5694
5748
|
},
|
|
5695
5749
|
open(i) {
|
|
5696
5750
|
this.overlay.open(i);
|
|
@@ -5700,19 +5754,19 @@ const Ke = /* @__PURE__ */ K(_s, [["render", bs]]), Ts = w({
|
|
|
5700
5754
|
}
|
|
5701
5755
|
}
|
|
5702
5756
|
});
|
|
5703
|
-
function
|
|
5757
|
+
function Es(i, t, e, r, s, n) {
|
|
5704
5758
|
return F(), U("div", me({
|
|
5705
5759
|
class: i.$options.name
|
|
5706
5760
|
}, i.attrs.binds), [
|
|
5707
5761
|
W(i.$slots, "default")
|
|
5708
5762
|
], 16);
|
|
5709
5763
|
}
|
|
5710
|
-
const
|
|
5764
|
+
const Ls = /* @__PURE__ */ K(ws, [["render", Es]]), xs = O({
|
|
5711
5765
|
name: "tg-info-window",
|
|
5712
|
-
mixins: [
|
|
5766
|
+
mixins: [B],
|
|
5713
5767
|
inheritAttrs: !1,
|
|
5714
5768
|
props: {
|
|
5715
|
-
show:
|
|
5769
|
+
show: N(Boolean),
|
|
5716
5770
|
position: m(v),
|
|
5717
5771
|
maxWidth: m(Number),
|
|
5718
5772
|
offset: m(Object),
|
|
@@ -5748,7 +5802,7 @@ const Os = /* @__PURE__ */ K(Ts, [["render", Ms]]), Cs = w({
|
|
|
5748
5802
|
return this.$el;
|
|
5749
5803
|
},
|
|
5750
5804
|
$marker() {
|
|
5751
|
-
return
|
|
5805
|
+
return pt(Xe, this.$parent, Ie);
|
|
5752
5806
|
},
|
|
5753
5807
|
getOptions() {
|
|
5754
5808
|
return {
|
|
@@ -5771,24 +5825,24 @@ const Os = /* @__PURE__ */ K(Ts, [["render", Ms]]), Cs = w({
|
|
|
5771
5825
|
this.$marker() ? this.$marker().onRemoveInfo(this) : this.overlay.close();
|
|
5772
5826
|
}
|
|
5773
5827
|
});
|
|
5774
|
-
function
|
|
5775
|
-
return
|
|
5828
|
+
function Ps(i, t, e, r, s, n) {
|
|
5829
|
+
return Fr((F(), U("div", me({
|
|
5776
5830
|
class: i.$options.name
|
|
5777
5831
|
}, i.attrs.binds), [
|
|
5778
5832
|
W(i.$slots, "default")
|
|
5779
5833
|
], 16)), [
|
|
5780
|
-
[
|
|
5834
|
+
[Ur, i.show]
|
|
5781
5835
|
]);
|
|
5782
5836
|
}
|
|
5783
|
-
const
|
|
5837
|
+
const Is = /* @__PURE__ */ K(xs, [["render", Ps]]), Bs = O({
|
|
5784
5838
|
name: "tg-label",
|
|
5785
|
-
mixins: [
|
|
5839
|
+
mixins: [B],
|
|
5786
5840
|
inheritAttrs: !1,
|
|
5787
5841
|
props: {
|
|
5788
5842
|
position: m(v),
|
|
5789
5843
|
offset: m(Object),
|
|
5790
5844
|
zIndex: m(Number),
|
|
5791
|
-
mapPane:
|
|
5845
|
+
mapPane: z(we)
|
|
5792
5846
|
},
|
|
5793
5847
|
emits: void 0,
|
|
5794
5848
|
setup(i, { attrs: t }) {
|
|
@@ -5823,7 +5877,7 @@ const Es = /* @__PURE__ */ K(Cs, [["render", ws]]), Ls = w({
|
|
|
5823
5877
|
return (i = this.$marker()) == null ? void 0 : i.marker;
|
|
5824
5878
|
},
|
|
5825
5879
|
$marker() {
|
|
5826
|
-
return
|
|
5880
|
+
return pt(Xe, this.$parent, Ie);
|
|
5827
5881
|
},
|
|
5828
5882
|
getOptions() {
|
|
5829
5883
|
return {
|
|
@@ -5842,19 +5896,19 @@ const Es = /* @__PURE__ */ K(Cs, [["render", ws]]), Ls = w({
|
|
|
5842
5896
|
this.$marker() ? this.$marker().onRemoveLabel(this) : this.$map.removeOverlay(this.overlay);
|
|
5843
5897
|
}
|
|
5844
5898
|
});
|
|
5845
|
-
function
|
|
5899
|
+
function ks(i, t, e, r, s, n) {
|
|
5846
5900
|
return F(), U("div", me({
|
|
5847
5901
|
class: i.$options.name
|
|
5848
5902
|
}, i.attrs.binds), [
|
|
5849
5903
|
W(i.$slots, "default")
|
|
5850
5904
|
], 16);
|
|
5851
5905
|
}
|
|
5852
|
-
const
|
|
5906
|
+
const Ss = /* @__PURE__ */ K(Bs, [["render", ks]]), As = O({
|
|
5853
5907
|
name: "tg-polygon",
|
|
5854
|
-
mixins: [
|
|
5908
|
+
mixins: [B],
|
|
5855
5909
|
inheritAttrs: !1,
|
|
5856
5910
|
props: {
|
|
5857
|
-
paths:
|
|
5911
|
+
paths: N(Array),
|
|
5858
5912
|
clickable: m(Boolean),
|
|
5859
5913
|
editable: m(Boolean),
|
|
5860
5914
|
strokeColor: m(String),
|
|
@@ -5918,12 +5972,12 @@ const Ps = /* @__PURE__ */ K(Ls, [["render", xs]]), ks = w({
|
|
|
5918
5972
|
onDestroy() {
|
|
5919
5973
|
this.$map.removeOverlay(this.overlay);
|
|
5920
5974
|
}
|
|
5921
|
-
}),
|
|
5975
|
+
}), Rs = O({
|
|
5922
5976
|
name: "tg-polyline",
|
|
5923
|
-
mixins: [
|
|
5977
|
+
mixins: [B],
|
|
5924
5978
|
inheritAttrs: !1,
|
|
5925
5979
|
props: {
|
|
5926
|
-
path:
|
|
5980
|
+
path: N(Array),
|
|
5927
5981
|
icons: m(Array),
|
|
5928
5982
|
clickable: m(Boolean),
|
|
5929
5983
|
editable: m(Boolean),
|
|
@@ -5986,12 +6040,12 @@ const Ps = /* @__PURE__ */ K(Ls, [["render", xs]]), ks = w({
|
|
|
5986
6040
|
onDestroy() {
|
|
5987
6041
|
this.overlay.remove();
|
|
5988
6042
|
}
|
|
5989
|
-
}),
|
|
6043
|
+
}), $s = O({
|
|
5990
6044
|
name: "tg-rectangle",
|
|
5991
|
-
mixins: [
|
|
6045
|
+
mixins: [B],
|
|
5992
6046
|
inheritAttrs: !1,
|
|
5993
6047
|
props: {
|
|
5994
|
-
bounds:
|
|
6048
|
+
bounds: N(Object),
|
|
5995
6049
|
clickable: m(Boolean),
|
|
5996
6050
|
editable: m(Boolean),
|
|
5997
6051
|
strokeColor: m(String),
|
|
@@ -6052,14 +6106,14 @@ const Ps = /* @__PURE__ */ K(Ls, [["render", xs]]), ks = w({
|
|
|
6052
6106
|
onDestroy() {
|
|
6053
6107
|
this.$map.removeOverlay(this.overlay);
|
|
6054
6108
|
}
|
|
6055
|
-
}),
|
|
6109
|
+
}), zs = ["beforeUpdate", "updated"], ln = {
|
|
6056
6110
|
install(i, t = {}) {
|
|
6057
6111
|
if (t.enable !== !1) {
|
|
6058
|
-
const e =
|
|
6112
|
+
const e = O({
|
|
6059
6113
|
beforeCreate() {
|
|
6060
|
-
const r =
|
|
6061
|
-
t.hookNames ? t.hookNames.includes(a) && console.debug("[lifecycle]", r, a) :
|
|
6062
|
-
} :
|
|
6114
|
+
const r = Br() ?? "", n = (t.nameRegex || /^[A-Z]/).test(r) ? (a) => {
|
|
6115
|
+
t.hookNames ? t.hookNames.includes(a) && console.debug("[lifecycle]", r, a) : zs.includes(a) || console.debug("[lifecycle]", r, a);
|
|
6116
|
+
} : Ce;
|
|
6063
6117
|
n("beforeCreate"), this.__life_impl = n;
|
|
6064
6118
|
},
|
|
6065
6119
|
created() {
|
|
@@ -6098,47 +6152,47 @@ const Ps = /* @__PURE__ */ K(Ls, [["render", xs]]), ks = w({
|
|
|
6098
6152
|
i.mixin(e);
|
|
6099
6153
|
}
|
|
6100
6154
|
}
|
|
6101
|
-
},
|
|
6155
|
+
}, Ds = 6378137;
|
|
6102
6156
|
function Te(i) {
|
|
6103
6157
|
return i * Math.PI / 180;
|
|
6104
6158
|
}
|
|
6105
|
-
function
|
|
6159
|
+
function tr(i) {
|
|
6106
6160
|
return i * 180 / Math.PI;
|
|
6107
6161
|
}
|
|
6108
|
-
function
|
|
6162
|
+
function Ns(i, t) {
|
|
6109
6163
|
if (i.lat === t.lat && i.lng === t.lng)
|
|
6110
6164
|
return 0;
|
|
6111
6165
|
const e = Te((i.lat + t.lat) / 2), r = Te((i.lat - t.lat) / 2), s = Te((i.lng - t.lng) / 2);
|
|
6112
6166
|
let n = Math.sin(r), a = Math.sin(s), d = Math.sin(e);
|
|
6113
|
-
const o =
|
|
6167
|
+
const o = Ds, l = 1 / 298.257;
|
|
6114
6168
|
n = n * n, a = a * a, d = d * d;
|
|
6115
6169
|
const h = n * (1 - a) + (1 - d) * a, u = (1 - n) * (1 - a) + d * a, p = Math.atan(Math.sqrt(h / u)), f = Math.sqrt(h * u) / p, _ = 2 * p * o, T = (3 * f - 1) / 2 / u, g = (3 * f + 1) / 2 / h;
|
|
6116
6170
|
return _ * (1 + l * (T * d * (1 - n) - g * (1 - d) * n));
|
|
6117
6171
|
}
|
|
6118
|
-
function
|
|
6172
|
+
function Gs(i, t, e) {
|
|
6119
6173
|
const s = 63567523142e-4, n = 1 / 298.257223563, a = Te(t), d = Math.sin(a), o = Math.cos(a), l = (1 - n) * Math.tan(Te(i.lat)), h = 1 / Math.sqrt(1 + l * l), u = l * h, p = Math.atan2(l, o), f = h * d, _ = 1 - f * f, T = _ * (6378137 * 6378137 - s * s) / (s * s), g = 1 + T / 16384 * (4096 + T * (-768 + T * (320 - 175 * T))), y = T / 1024 * (256 + T * (-128 + T * (74 - 47 * T)));
|
|
6120
|
-
let b = 0,
|
|
6174
|
+
let b = 0, C = 0, I = 0, E = e / (s * g), ee = 2 * Math.PI;
|
|
6121
6175
|
for (; Math.abs(E - ee) > 1e-12; ) {
|
|
6122
|
-
b = Math.cos(2 * p + E),
|
|
6123
|
-
const
|
|
6124
|
-
ee = E, E = e / (s * g) +
|
|
6176
|
+
b = Math.cos(2 * p + E), C = Math.sin(E), I = Math.cos(E);
|
|
6177
|
+
const $r = y * C * (b + y / 4 * (I * (-1 + 2 * b * b) - y / 6 * b * (-3 + 4 * C * C) * (-3 + 4 * b * b)));
|
|
6178
|
+
ee = E, E = e / (s * g) + $r;
|
|
6125
6179
|
}
|
|
6126
|
-
const se = u *
|
|
6127
|
-
u *
|
|
6180
|
+
const se = u * C - h * I * o, Je = Math.atan2(
|
|
6181
|
+
u * I + h * C * o,
|
|
6128
6182
|
(1 - n) * Math.sqrt(f * f + se * se)
|
|
6129
|
-
),
|
|
6130
|
-
return { lng: i.lng +
|
|
6183
|
+
), Ar = Math.atan2(C * d, h * I - u * C * o), Qe = n / 16 * _ * (4 + n * (4 - 3 * _)), Rr = Ar - (1 - Qe) * n * f * (E + Qe * C * (b + Qe * I * (-1 + 2 * b * b)));
|
|
6184
|
+
return { lng: i.lng + tr(Rr), lat: tr(Je) };
|
|
6131
6185
|
}
|
|
6132
|
-
const
|
|
6133
|
-
getDistance:
|
|
6134
|
-
getDestination:
|
|
6135
|
-
},
|
|
6186
|
+
const hn = {
|
|
6187
|
+
getDistance: Ns,
|
|
6188
|
+
getDestination: Gs
|
|
6189
|
+
}, cn = {
|
|
6136
6190
|
install(i, t) {
|
|
6137
|
-
if (
|
|
6138
|
-
const r = /* @__PURE__ */ Object.assign({ "./TgMap.vue":
|
|
6191
|
+
if (Fi(t), {}.VITE_FALSE) {
|
|
6192
|
+
const r = /* @__PURE__ */ Object.assign({ "./TgMap.vue": Ie, "./TgMapWidget.vue": as, "./controls/TgCustomControl.vue": cs, "./controls/TgMapTypeControl.vue": ds, "./controls/TgScaleControl.vue": us, "./controls/TgStreetViewControl.vue": ps, "./controls/TgZoomControl.vue": gs, "./extra/TgMarkerClusterer.vue": Sr, "./layers/TgTrafficLayer.vue": ys, "./overlays/TgCircle.vue": vs, "./overlays/TgElementOverlay.vue": Ms, "./overlays/TgInfoBox.vue": Ls, "./overlays/TgInfoWindow.vue": Is, "./overlays/TgLabel.vue": Ss, "./overlays/TgMarker.vue": Xe, "./overlays/TgPolygon.vue": As, "./overlays/TgPolyline.vue": Rs, "./overlays/TgRectangle.vue": $s });
|
|
6139
6193
|
Object.keys(r).forEach((s) => {
|
|
6140
6194
|
const n = r[s];
|
|
6141
|
-
i.component(n.name ??
|
|
6195
|
+
i.component(n.name ?? w(`Tg开头的组件必须设置name: ${s}`), n);
|
|
6142
6196
|
});
|
|
6143
6197
|
}
|
|
6144
6198
|
const e = i.config.optionMergeStrategies;
|
|
@@ -6146,146 +6200,151 @@ const nn = {
|
|
|
6146
6200
|
}
|
|
6147
6201
|
};
|
|
6148
6202
|
export {
|
|
6149
|
-
|
|
6150
|
-
|
|
6203
|
+
mt as AbstractControl,
|
|
6204
|
+
wt as AbstractMap,
|
|
6151
6205
|
he as Arrays,
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
6206
|
+
gr as Autocomplete,
|
|
6207
|
+
hi as BaiduAutocomplete,
|
|
6208
|
+
Lt as BaiduCircle,
|
|
6209
|
+
ft as BaiduControl,
|
|
6210
|
+
kt as BaiduInfoBoxOverlay,
|
|
6211
|
+
It as BaiduInfoWindow,
|
|
6212
|
+
yt as BaiduMapTypeControl,
|
|
6159
6213
|
Re as BaiduMapUrls,
|
|
6160
6214
|
Le as BaiduMarker,
|
|
6161
|
-
|
|
6162
|
-
|
|
6163
|
-
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
|
-
|
|
6169
|
-
|
|
6170
|
-
|
|
6215
|
+
gi as BaiduMarkerClusterer,
|
|
6216
|
+
qe as BaiduOverlay,
|
|
6217
|
+
yi as BaiduPlacesService,
|
|
6218
|
+
zt as BaiduPolyShape,
|
|
6219
|
+
Gt as BaiduPolygon,
|
|
6220
|
+
Dt as BaiduPolyline,
|
|
6221
|
+
Wt as BaiduRectangle,
|
|
6222
|
+
vt as BaiduScaleControl,
|
|
6223
|
+
_i as BaiduSearchBox,
|
|
6224
|
+
bt as BaiduStreetViewControl,
|
|
6225
|
+
Mt as BaiduZoomControl,
|
|
6171
6226
|
A as BuildInMapType,
|
|
6172
|
-
|
|
6227
|
+
hr as BuildInMapTypeId,
|
|
6173
6228
|
_e as CachedValue,
|
|
6174
|
-
|
|
6175
|
-
|
|
6176
|
-
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
|
|
6229
|
+
x as ControlPosition,
|
|
6230
|
+
D as ControlPositionConverter,
|
|
6231
|
+
P as CoordType,
|
|
6232
|
+
ri as CustomControl,
|
|
6233
|
+
Gi as ElementOverlay,
|
|
6234
|
+
ii as EmptyControl,
|
|
6235
|
+
ti as FastFindValues,
|
|
6180
6236
|
j as GestureHandlingOptions,
|
|
6181
|
-
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
|
-
|
|
6185
|
-
|
|
6237
|
+
li as GoogleAutocomplete,
|
|
6238
|
+
xt as GoogleCircle,
|
|
6239
|
+
Ye as GoogleControl,
|
|
6240
|
+
St as GoogleInfoBoxOverlay,
|
|
6241
|
+
Bt as GoogleInfoWindow,
|
|
6186
6242
|
Se as GoogleMapTypeControl,
|
|
6187
6243
|
Ae as GoogleMapUrls,
|
|
6188
|
-
|
|
6189
|
-
|
|
6190
|
-
|
|
6191
|
-
|
|
6192
|
-
|
|
6193
|
-
|
|
6194
|
-
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
|
|
6244
|
+
$t as GoogleMarker,
|
|
6245
|
+
mi as GoogleMarkerClusterer,
|
|
6246
|
+
Et as GoogleOverlay,
|
|
6247
|
+
fi as GooglePlacesService,
|
|
6248
|
+
Zt as GooglePolygon,
|
|
6249
|
+
Nt as GooglePolyline,
|
|
6250
|
+
Ht as GoogleRectangle,
|
|
6251
|
+
_t as GoogleScaleControl,
|
|
6252
|
+
vi as GoogleSearchBox,
|
|
6253
|
+
Tt as GoogleStreetViewControl,
|
|
6254
|
+
Ct as GoogleZoomControl,
|
|
6198
6255
|
Ne as Icon,
|
|
6199
6256
|
Ge as IconSequence,
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
|
-
|
|
6257
|
+
Xs as ImageMapType,
|
|
6258
|
+
Pt as InfoWindow,
|
|
6259
|
+
$i as InfoWindowModeValues,
|
|
6260
|
+
Yt as KeyValue,
|
|
6204
6261
|
v as LatLng,
|
|
6205
6262
|
R as LatLngBounds,
|
|
6206
|
-
|
|
6263
|
+
ln as LifecycleLogPlugin,
|
|
6207
6264
|
V as Location,
|
|
6208
6265
|
xe as MIXIN_HOOK_CREATE,
|
|
6209
6266
|
Pe as MIXIN_HOOK_DESTROY,
|
|
6210
|
-
|
|
6267
|
+
Vt as MIXIN_MAP_NAME,
|
|
6211
6268
|
ce as MVCArrays,
|
|
6212
|
-
|
|
6213
|
-
|
|
6269
|
+
B as MapMixin,
|
|
6270
|
+
ht as MapOptions,
|
|
6214
6271
|
we as MapPane,
|
|
6215
6272
|
Ee as MapPanes,
|
|
6216
6273
|
$ as MapType,
|
|
6217
|
-
|
|
6218
|
-
|
|
6219
|
-
|
|
6220
|
-
|
|
6274
|
+
cr as MapTypeControlType,
|
|
6275
|
+
mr as MapUrls,
|
|
6276
|
+
bi as MapZoom,
|
|
6277
|
+
Tr as MarkerClusterer,
|
|
6221
6278
|
Q as Objects,
|
|
6222
|
-
|
|
6223
|
-
|
|
6279
|
+
Lr as Overlay,
|
|
6280
|
+
Mr as PlacesService,
|
|
6224
6281
|
X as Point,
|
|
6225
|
-
|
|
6226
|
-
|
|
6282
|
+
Cr as SearchBox,
|
|
6283
|
+
hn as SphericalUtils,
|
|
6227
6284
|
ue as Strings,
|
|
6228
6285
|
ge as SymbolIcon,
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
|
|
6241
|
-
|
|
6242
|
-
|
|
6243
|
-
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
ps as
|
|
6248
|
-
|
|
6249
|
-
|
|
6286
|
+
tn as SymbolPath,
|
|
6287
|
+
vs as TgCircle,
|
|
6288
|
+
cs as TgCustomControl,
|
|
6289
|
+
Ms as TgElementOverlay,
|
|
6290
|
+
Ls as TgInfoBox,
|
|
6291
|
+
Is as TgInfoWindow,
|
|
6292
|
+
Ss as TgLabel,
|
|
6293
|
+
Ie as TgMap,
|
|
6294
|
+
ct as TgMapFactory,
|
|
6295
|
+
Z as TgMapType,
|
|
6296
|
+
ds as TgMapTypeControl,
|
|
6297
|
+
as as TgMapWidget,
|
|
6298
|
+
Xe as TgMarker,
|
|
6299
|
+
Sr as TgMarkerClusterer,
|
|
6300
|
+
As as TgPolygon,
|
|
6301
|
+
Rs as TgPolyline,
|
|
6302
|
+
$s as TgRectangle,
|
|
6303
|
+
us as TgScaleControl,
|
|
6304
|
+
ps as TgStreetViewControl,
|
|
6305
|
+
ys as TgTrafficLayer,
|
|
6306
|
+
gs as TgZoomControl,
|
|
6307
|
+
si as TrafficLayer,
|
|
6250
6308
|
De as UnionIcon,
|
|
6251
6309
|
ae as assert,
|
|
6252
|
-
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
|
|
6258
|
-
|
|
6259
|
-
|
|
6260
|
-
|
|
6310
|
+
nt as assertNever,
|
|
6311
|
+
ke as callHook,
|
|
6312
|
+
rn as computedSaveOnThis,
|
|
6313
|
+
Jr as createAsyncSingleton,
|
|
6314
|
+
jt as createEmptyVNode,
|
|
6315
|
+
es as createPropertyObject,
|
|
6316
|
+
sn as createPropertyObjectTyped,
|
|
6317
|
+
qs as debug,
|
|
6318
|
+
cn as default,
|
|
6261
6319
|
L as eventProp,
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
6265
|
-
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6320
|
+
on as extractVNodeFromSlotsByComponent,
|
|
6321
|
+
pt as findAncestorComponentByType,
|
|
6322
|
+
nn as findByComponentType,
|
|
6323
|
+
Gs as getDestination,
|
|
6324
|
+
Ir as getTgMapConfig,
|
|
6325
|
+
at as isComponentByType,
|
|
6326
|
+
Ks as isDef,
|
|
6327
|
+
Xr as isEntryValueDef,
|
|
6328
|
+
Vs as isInstanceOf,
|
|
6329
|
+
js as lateinit,
|
|
6330
|
+
qi as loadCachedMap,
|
|
6331
|
+
Ce as noop,
|
|
6273
6332
|
m as optionalProp,
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
|
|
6282
|
-
|
|
6283
|
-
|
|
6284
|
-
|
|
6285
|
-
|
|
6286
|
-
|
|
6287
|
-
|
|
6333
|
+
Ni as path,
|
|
6334
|
+
N as requiredProp,
|
|
6335
|
+
Fs as safeAs,
|
|
6336
|
+
nr as safeAsComponent,
|
|
6337
|
+
Fi as setTgMapConfig,
|
|
6338
|
+
ts as splitAttrs,
|
|
6339
|
+
z as stringEnumProp,
|
|
6340
|
+
Qi as stringUnionPropFromValues,
|
|
6341
|
+
w as throwError,
|
|
6342
|
+
gt as throwUnsupported,
|
|
6343
|
+
Ys as todo,
|
|
6344
|
+
ot as typed,
|
|
6345
|
+
Us as unwrapStringEnumValue,
|
|
6346
|
+
an as useEventLogMethods,
|
|
6288
6347
|
q as useSplittedAttrs,
|
|
6289
|
-
|
|
6348
|
+
kr as useTgMapInner
|
|
6290
6349
|
};
|
|
6291
6350
|
//# sourceMappingURL=tg-map.js.map
|