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