tg-map-vue3 3.7.6 → 3.7.8
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 +1 -0
- package/dist/src/components/TgMap.vue.d.ts +16 -4
- package/dist/src/components/overlays/TgMarker.vue.d.ts +1 -0
- package/dist/src/map/map-loader.d.ts +5 -1
- package/dist/src/utils/objects.d.ts +10 -0
- package/dist/src/utils/utils.d.ts +4 -0
- package/dist/tg-map.js +839 -807
- package/dist/tg-map.js.map +1 -1
- package/dist/tg-map.umd.cjs +6 -6
- package/dist/tg-map.umd.cjs.map +1 -1
- package/package.json +2 -2
package/dist/tg-map.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
var Ar = Object.defineProperty;
|
|
3
3
|
var Rr = (i, t, e) => t in i ? Ar(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
4
4
|
var c = (i, t, e) => (Rr(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
5
|
-
import { createCommentVNode as it, computed as Xt, defineComponent as w, markRaw as $r, watch as Jt, openBlock as F, createElementBlock as U, mergeProps as
|
|
5
|
+
import { createCommentVNode as it, computed as Xt, defineComponent as w, markRaw as $r, watch as Jt, openBlock as F, createElementBlock as U, mergeProps as me, createElementVNode as zr, normalizeClass as Ve, renderSlot as W, normalizeStyle as Dr, getCurrentInstance as Nr, inject as Gr, onMounted as Zr, onBeforeUnmount as Wr, toRaw as Fe, withDirectives as Hr, vShow as jr } from "vue";
|
|
6
6
|
function Y(i, t, e) {
|
|
7
7
|
Object.keys(i).forEach((r) => {
|
|
8
8
|
r.startsWith("update:") || e != null && e.includes(r) || t.addEventListener(r, i[r]);
|
|
@@ -25,11 +25,11 @@ var er = { exports: {} };
|
|
|
25
25
|
i.exports ? i.exports = e() : t.coordtransform = e();
|
|
26
26
|
})(Qt, function() {
|
|
27
27
|
var t = 52.35987755982988, e = 3.141592653589793, r = 6378245, s = 0.006693421622965943;
|
|
28
|
-
function n(g,
|
|
29
|
-
this.west = Math.min(g,
|
|
28
|
+
function n(g, y, b, O) {
|
|
29
|
+
this.west = Math.min(g, b), this.north = Math.max(y, O), this.east = Math.max(g, b), this.south = Math.min(y, O);
|
|
30
30
|
}
|
|
31
|
-
n.prototype.contain = function(g,
|
|
32
|
-
return this.west <= g && this.east >= g && this.north >=
|
|
31
|
+
n.prototype.contain = function(g, y) {
|
|
32
|
+
return this.west <= g && this.east >= g && this.north >= y && this.south <= y;
|
|
33
33
|
};
|
|
34
34
|
var a = [
|
|
35
35
|
new n(79.4462, 49.2204, 96.33, 42.8899),
|
|
@@ -38,7 +38,7 @@ var er = { exports: {} };
|
|
|
38
38
|
new n(82.9684, 29.5297, 97.0352, 26.7186),
|
|
39
39
|
new n(97.0253, 29.5297, 124.367395, 20.414096),
|
|
40
40
|
new n(107.975793, 20.414096, 111.744104, 17.871542)
|
|
41
|
-
],
|
|
41
|
+
], d = [
|
|
42
42
|
new n(119.921265, 25.398623, 122.497559, 21.785006),
|
|
43
43
|
new n(101.8652, 22.284, 106.665, 20.0988),
|
|
44
44
|
new n(106.4525, 21.5422, 108.051, 20.4878),
|
|
@@ -47,93 +47,93 @@ var er = { exports: {} };
|
|
|
47
47
|
new n(131.2662, 44.8922, 137.0227, 42.5692),
|
|
48
48
|
new n(73.1246, 35.398637, 77.948114, 29.5297)
|
|
49
49
|
];
|
|
50
|
-
function o(g,
|
|
51
|
-
for (var
|
|
52
|
-
if (a[
|
|
53
|
-
for (var O = 0; O <
|
|
54
|
-
if (
|
|
50
|
+
function o(g, y) {
|
|
51
|
+
for (var b = 0; b < a.length; b++)
|
|
52
|
+
if (a[b].contain(g, y)) {
|
|
53
|
+
for (var O = 0; O < d.length; O++)
|
|
54
|
+
if (d[O].contain(g, y))
|
|
55
55
|
return !1;
|
|
56
56
|
return !0;
|
|
57
57
|
}
|
|
58
58
|
return !1;
|
|
59
59
|
}
|
|
60
|
-
function l(g,
|
|
61
|
-
var
|
|
62
|
-
return [
|
|
60
|
+
function l(g, y) {
|
|
61
|
+
var b = g - 65e-4, O = y - 6e-3, P = Math.sqrt(b * b + O * O) - 2e-5 * Math.sin(O * t), E = Math.atan2(O, b) - 3e-6 * Math.cos(b * t), ee = P * Math.cos(E), se = P * Math.sin(E);
|
|
62
|
+
return [ee, se];
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
var
|
|
64
|
+
function h(g, y) {
|
|
65
|
+
var b = Math.sqrt(g * g + y * y) + 2e-5 * Math.sin(y * t), O = Math.atan2(y, g) + 3e-6 * Math.cos(g * t), P = b * Math.cos(O) + 65e-4, E = b * Math.sin(O) + 6e-3;
|
|
66
66
|
return [P, E];
|
|
67
67
|
}
|
|
68
|
-
function u(g,
|
|
69
|
-
return o(g,
|
|
68
|
+
function u(g, y) {
|
|
69
|
+
return o(g, y) ? f(g, y) : [g, y];
|
|
70
70
|
}
|
|
71
|
-
function p(g,
|
|
72
|
-
if (!o(g,
|
|
73
|
-
return [g,
|
|
74
|
-
var
|
|
75
|
-
return [g * 2 -
|
|
71
|
+
function p(g, y) {
|
|
72
|
+
if (!o(g, y))
|
|
73
|
+
return [g, y];
|
|
74
|
+
var b = f(g, y);
|
|
75
|
+
return [g * 2 - b[0], y * 2 - b[1]];
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
var
|
|
77
|
+
function f(g, y) {
|
|
78
|
+
var b = _(g - 105, y - 35), O = T(g - 105, y - 35), P = y / 180 * e, E = Math.sin(P);
|
|
79
79
|
E = 1 - s * E * E;
|
|
80
|
-
var
|
|
81
|
-
|
|
82
|
-
var
|
|
83
|
-
return [Xe,
|
|
80
|
+
var ee = Math.sqrt(E);
|
|
81
|
+
b = b * 180 / (r * (1 - s) / (E * ee) * e), O = O * 180 / (r / ee * Math.cos(P) * e);
|
|
82
|
+
var se = y + b, Xe = g + O;
|
|
83
|
+
return [Xe, se];
|
|
84
84
|
}
|
|
85
|
-
function _(g,
|
|
86
|
-
var
|
|
87
|
-
return
|
|
85
|
+
function _(g, y) {
|
|
86
|
+
var b = -100 + 2 * g + 3 * y + 0.2 * y * y + 0.1 * g * y + 0.2 * Math.sqrt(Math.abs(g));
|
|
87
|
+
return b += (20 * Math.sin(6 * g * e) + 20 * Math.sin(2 * g * e)) * 2 / 3, b += (20 * Math.sin(y * e) + 40 * Math.sin(y / 3 * e)) * 2 / 3, b += (160 * Math.sin(y / 12 * e) + 320 * Math.sin(y * e / 30)) * 2 / 3, b;
|
|
88
88
|
}
|
|
89
|
-
function T(g,
|
|
90
|
-
var
|
|
91
|
-
return
|
|
89
|
+
function T(g, y) {
|
|
90
|
+
var b = 300 + g + 2 * y + 0.1 * g * g + 0.1 * g * y + 0.1 * Math.sqrt(Math.abs(g));
|
|
91
|
+
return b += (20 * Math.sin(6 * g * e) + 20 * Math.sin(2 * g * e)) * 2 / 3, b += (20 * Math.sin(g * e) + 40 * Math.sin(g / 3 * e)) * 2 / 3, b += (150 * Math.sin(g / 12 * e) + 300 * Math.sin(g / 30 * e)) * 2 / 3, b;
|
|
92
92
|
}
|
|
93
93
|
return {
|
|
94
94
|
// 向前兼容
|
|
95
95
|
bd09togcj02: l,
|
|
96
|
-
gcj02tobd09:
|
|
96
|
+
gcj02tobd09: h,
|
|
97
97
|
wgs84togcj02: u,
|
|
98
98
|
gcj02towgs84: p,
|
|
99
99
|
// 小驼峰命名风格
|
|
100
100
|
bd09ToGcj02: l,
|
|
101
|
-
gcj02ToBd09:
|
|
101
|
+
gcj02ToBd09: h,
|
|
102
102
|
wgs84ToGcj02: u,
|
|
103
103
|
gcj02ToWgs84: p,
|
|
104
|
-
bd09ToWgs84: function(g,
|
|
105
|
-
if (!o(g,
|
|
106
|
-
return [g,
|
|
107
|
-
var
|
|
108
|
-
return p(
|
|
104
|
+
bd09ToWgs84: function(g, y) {
|
|
105
|
+
if (!o(g, y))
|
|
106
|
+
return [g, y];
|
|
107
|
+
var b = l(g, y);
|
|
108
|
+
return p(b[0], b[1]);
|
|
109
109
|
},
|
|
110
|
-
wgs84ToBd09: function(g,
|
|
111
|
-
if (!o(g,
|
|
112
|
-
return [g,
|
|
113
|
-
var
|
|
114
|
-
return
|
|
110
|
+
wgs84ToBd09: function(g, y) {
|
|
111
|
+
if (!o(g, y))
|
|
112
|
+
return [g, y];
|
|
113
|
+
var b = u(g, y);
|
|
114
|
+
return h(b[0], b[1]);
|
|
115
115
|
}
|
|
116
116
|
};
|
|
117
117
|
});
|
|
118
118
|
})(er);
|
|
119
119
|
var Ur = er.exports;
|
|
120
|
-
const
|
|
121
|
-
function
|
|
120
|
+
const ne = /* @__PURE__ */ ct(Ur);
|
|
121
|
+
function ae(i, t) {
|
|
122
122
|
if (!i)
|
|
123
123
|
throw new Error(`AssertionError: ${t}`);
|
|
124
124
|
}
|
|
125
125
|
function st(i) {
|
|
126
126
|
throw new Error(`Unexpected object: ${i}`);
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function Gs() {
|
|
129
129
|
}
|
|
130
130
|
function nt(i) {
|
|
131
131
|
return i;
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function Zs(i, t) {
|
|
134
134
|
return i instanceof t;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function Ws(i, t) {
|
|
137
137
|
if (i instanceof t)
|
|
138
138
|
return i;
|
|
139
139
|
}
|
|
@@ -153,7 +153,7 @@ function dt(i, t, e) {
|
|
|
153
153
|
r = r.$parent;
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function Hs(i) {
|
|
157
157
|
return i;
|
|
158
158
|
}
|
|
159
159
|
function C(i) {
|
|
@@ -162,22 +162,26 @@ function C(i) {
|
|
|
162
162
|
function ut(i) {
|
|
163
163
|
throw new Error(`Unsupported: ${i}`);
|
|
164
164
|
}
|
|
165
|
-
function
|
|
165
|
+
function js(i) {
|
|
166
166
|
throw new Error(`todo: ${i}`);
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function Vs(i) {
|
|
169
169
|
return i;
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function Oe(...i) {
|
|
172
172
|
}
|
|
173
|
-
function
|
|
173
|
+
function Fs(i) {
|
|
174
174
|
return i != null;
|
|
175
175
|
}
|
|
176
176
|
function Yr(i) {
|
|
177
177
|
return i[1] != null;
|
|
178
178
|
}
|
|
179
|
+
function qr(i) {
|
|
180
|
+
let t = null;
|
|
181
|
+
return () => t ?? (t = i().catch((e) => (t = null, Promise.reject(e))));
|
|
182
|
+
}
|
|
179
183
|
var x = /* @__PURE__ */ ((i) => (i.wgs84 = "wgs84", i.gcj02 = "gcj02", i.bd09 = "bd09", i))(x || {});
|
|
180
|
-
const Qe = "wgs84",
|
|
184
|
+
const Qe = "wgs84", I = class {
|
|
181
185
|
constructor(t, e, r) {
|
|
182
186
|
this.lat = t, this.lng = e, this.coord = r;
|
|
183
187
|
}
|
|
@@ -199,23 +203,23 @@ const Qe = "wgs84", B = class {
|
|
|
199
203
|
}
|
|
200
204
|
/** @param coord Baidu Map的坐标一般都是bd09 */
|
|
201
205
|
static fromBaidu(t, e) {
|
|
202
|
-
return new
|
|
206
|
+
return new I(t.lat, t.lng, e);
|
|
203
207
|
}
|
|
204
208
|
/** @param coord Google Map的坐标依据地图类型不同是不一样的 */
|
|
205
209
|
static fromGoogle(t, e) {
|
|
206
|
-
return new
|
|
210
|
+
return new I(t.lat(), t.lng(), e);
|
|
207
211
|
}
|
|
208
212
|
static fromHere(t, e) {
|
|
209
|
-
return new
|
|
213
|
+
return new I(t.lat, t.lng, e);
|
|
210
214
|
}
|
|
211
215
|
static fromLiteral(t) {
|
|
212
|
-
return new
|
|
216
|
+
return new I(t.lat, t.lng, t.coord || Qe);
|
|
213
217
|
}
|
|
214
218
|
static fromLngLat(t, e, r = Qe) {
|
|
215
|
-
return new
|
|
219
|
+
return new I(e, t, r);
|
|
216
220
|
}
|
|
217
221
|
static create(t, e, r = Qe) {
|
|
218
|
-
return new
|
|
222
|
+
return new I(t, e, r);
|
|
219
223
|
}
|
|
220
224
|
/** 转换坐标到指定坐标系 */
|
|
221
225
|
to(t) {
|
|
@@ -223,7 +227,7 @@ const Qe = "wgs84", B = class {
|
|
|
223
227
|
if (this.coord === e)
|
|
224
228
|
return this;
|
|
225
229
|
const [r, s] = this._convert(e);
|
|
226
|
-
return new
|
|
230
|
+
return new I(s, r, e);
|
|
227
231
|
}
|
|
228
232
|
/**
|
|
229
233
|
* TODO: normalize要不要默认设为true, 和google的行为保持一致?
|
|
@@ -233,7 +237,7 @@ const Qe = "wgs84", B = class {
|
|
|
233
237
|
*/
|
|
234
238
|
toBaidu(t, e = !1) {
|
|
235
239
|
let r = this.lat, s = this.lng;
|
|
236
|
-
return this.coord !== t && ([s, r] = this._convert(t)), e && ([s, r] =
|
|
240
|
+
return this.coord !== t && ([s, r] = this._convert(t)), e && ([s, r] = I._normalize(s, r)), new BMap.Point(s, r);
|
|
237
241
|
}
|
|
238
242
|
/**
|
|
239
243
|
* 转换成google的经纬度, 内部会自动进行标准化
|
|
@@ -259,11 +263,11 @@ const Qe = "wgs84", B = class {
|
|
|
259
263
|
_convert(t) {
|
|
260
264
|
switch (this.coord) {
|
|
261
265
|
case "bd09":
|
|
262
|
-
return t === "gcj02" ?
|
|
266
|
+
return t === "gcj02" ? ne.bd09ToGcj02(this.lng, this.lat) : ne.bd09ToWgs84(this.lng, this.lat);
|
|
263
267
|
case "gcj02":
|
|
264
|
-
return t === "wgs84" ?
|
|
268
|
+
return t === "wgs84" ? ne.gcj02ToWgs84(this.lng, this.lat) : ne.gcj02ToBd09(this.lng, this.lat);
|
|
265
269
|
case "wgs84":
|
|
266
|
-
return t === "bd09" ?
|
|
270
|
+
return t === "bd09" ? ne.wgs84ToBd09(this.lng, this.lat) : ne.wgs84ToGcj02(this.lng, this.lat);
|
|
267
271
|
}
|
|
268
272
|
throw new Error(`不支持的坐标转换: ${this.coord}=>${t}`);
|
|
269
273
|
}
|
|
@@ -272,8 +276,8 @@ const Qe = "wgs84", B = class {
|
|
|
272
276
|
* @see _normalize {@macro latlng_normalize}
|
|
273
277
|
*/
|
|
274
278
|
normalize() {
|
|
275
|
-
const [t, e] =
|
|
276
|
-
return e === this.lat && t === this.lng ? this : new
|
|
279
|
+
const [t, e] = I._normalize(this.lng, this.lat);
|
|
280
|
+
return e === this.lat && t === this.lng ? this : new I(e, t, this.coord);
|
|
277
281
|
}
|
|
278
282
|
equals(t) {
|
|
279
283
|
return this === t ? !0 : this.lat === t.lat && this.lng === t.lng && this.coord === t.coord;
|
|
@@ -282,9 +286,9 @@ const Qe = "wgs84", B = class {
|
|
|
282
286
|
return JSON.stringify(this);
|
|
283
287
|
}
|
|
284
288
|
};
|
|
285
|
-
let
|
|
286
|
-
c(
|
|
287
|
-
const
|
|
289
|
+
let v = I;
|
|
290
|
+
c(v, "ZERO", I.create(0, 0));
|
|
291
|
+
const re = class {
|
|
288
292
|
/**
|
|
289
293
|
* 不推荐直接创建LatLngBounds, sw和ne的大小关系可能没法保证, 推荐用LatLngBounds.Builder或者LatLngBounds.from等静态方法来创建
|
|
290
294
|
* @param sw 西南, lat/lng更小
|
|
@@ -292,7 +296,7 @@ const te = class {
|
|
|
292
296
|
*/
|
|
293
297
|
constructor(t, e) {
|
|
294
298
|
c(this, "coord");
|
|
295
|
-
this.sw = t, this.ne = e,
|
|
299
|
+
this.sw = t, this.ne = e, ae(t.coord === e.coord, "sw和ne的coord应该相同"), ae(Number.isFinite(t.lat) && Number.isFinite(t.lng) && Number.isFinite(e.lat) && Number.isFinite(e.lng), `sw(${t})和ne(${e})不能包含NaN或Infinite`), ae(t.lat <= e.lat, `sw.lat(${t.lat})应该比ne.lat(${e.lat})小`), this.coord = t.coord;
|
|
296
300
|
}
|
|
297
301
|
static isBetweenLng(t, e, r) {
|
|
298
302
|
return t <= e ? t <= r && r <= e : t <= r || r <= e;
|
|
@@ -300,7 +304,7 @@ const te = class {
|
|
|
300
304
|
static fromArray(t) {
|
|
301
305
|
if (t.length === 0)
|
|
302
306
|
return;
|
|
303
|
-
const e = new
|
|
307
|
+
const e = new re.Builder(t[0]);
|
|
304
308
|
for (let r = 1; r < t.length; r++)
|
|
305
309
|
e.include(t[r]);
|
|
306
310
|
return e.build();
|
|
@@ -309,15 +313,15 @@ const te = class {
|
|
|
309
313
|
return this.fromArray(t) ?? C("positions中没有点");
|
|
310
314
|
}
|
|
311
315
|
static fromGoogle(t, e) {
|
|
312
|
-
return new
|
|
313
|
-
|
|
314
|
-
|
|
316
|
+
return new re(
|
|
317
|
+
v.fromGoogle(t.getSouthWest(), e),
|
|
318
|
+
v.fromGoogle(t.getNorthEast(), e)
|
|
315
319
|
);
|
|
316
320
|
}
|
|
317
321
|
static fromBaidu(t, e) {
|
|
318
|
-
return new
|
|
319
|
-
|
|
320
|
-
|
|
322
|
+
return new re(
|
|
323
|
+
v.fromBaidu(t.getSouthWest(), e),
|
|
324
|
+
v.fromBaidu(t.getNorthEast(), e)
|
|
321
325
|
);
|
|
322
326
|
}
|
|
323
327
|
static create(t, e) {
|
|
@@ -328,13 +332,13 @@ const te = class {
|
|
|
328
332
|
}
|
|
329
333
|
contains(t) {
|
|
330
334
|
const { lat: e, lng: r } = t.to(this.coord);
|
|
331
|
-
return this.sw.lat <= e && e <= this.ne.lat &&
|
|
335
|
+
return this.sw.lat <= e && e <= this.ne.lat && re.isBetweenLng(this.sw.lng, this.ne.lng, r);
|
|
332
336
|
}
|
|
333
337
|
getCenter() {
|
|
334
338
|
if (this.sw.equals(this.ne))
|
|
335
339
|
return this.sw;
|
|
336
340
|
const t = (this.sw.lat + this.ne.lat) / 2, e = (this.sw.lng + this.ne.lng + (this.sw.lng < this.ne.lng ? 0 : 360)) / 2;
|
|
337
|
-
return
|
|
341
|
+
return v.create(t, e, this.coord);
|
|
338
342
|
}
|
|
339
343
|
toString() {
|
|
340
344
|
return JSON.stringify(this);
|
|
@@ -350,9 +354,9 @@ const te = class {
|
|
|
350
354
|
const t = this.sw.coord;
|
|
351
355
|
return [
|
|
352
356
|
this.sw,
|
|
353
|
-
|
|
357
|
+
v.fromLngLat(this.sw.lng, this.ne.lat, t),
|
|
354
358
|
this.ne,
|
|
355
|
-
|
|
359
|
+
v.fromLngLat(this.ne.lng, this.sw.lat, t)
|
|
356
360
|
];
|
|
357
361
|
}
|
|
358
362
|
toGoogle(t) {
|
|
@@ -365,8 +369,8 @@ const te = class {
|
|
|
365
369
|
return [this.sw.toBaidu(t), this.ne.toBaidu(t)];
|
|
366
370
|
}
|
|
367
371
|
};
|
|
368
|
-
let R =
|
|
369
|
-
c(R, "EMPTY", new
|
|
372
|
+
let R = re;
|
|
373
|
+
c(R, "EMPTY", new re(v.ZERO, v.ZERO));
|
|
370
374
|
((i) => {
|
|
371
375
|
class t {
|
|
372
376
|
constructor(r) {
|
|
@@ -380,9 +384,9 @@ c(R, "EMPTY", new te(y.ZERO, y.ZERO));
|
|
|
380
384
|
build() {
|
|
381
385
|
return new i(
|
|
382
386
|
// sw对应min
|
|
383
|
-
|
|
387
|
+
v.create(this.minLat, this.minLng, this.coord),
|
|
384
388
|
// ne对应max
|
|
385
|
-
|
|
389
|
+
v.create(this.maxLat, this.maxLng, this.coord)
|
|
386
390
|
);
|
|
387
391
|
}
|
|
388
392
|
include(r) {
|
|
@@ -411,102 +415,6 @@ var V;
|
|
|
411
415
|
}
|
|
412
416
|
i.getCoordType = e;
|
|
413
417
|
})(V || (V = {}));
|
|
414
|
-
var qr = function(t) {
|
|
415
|
-
return Kr(t) && !Xr(t);
|
|
416
|
-
};
|
|
417
|
-
function Kr(i) {
|
|
418
|
-
return !!i && typeof i == "object";
|
|
419
|
-
}
|
|
420
|
-
function Xr(i) {
|
|
421
|
-
var t = Object.prototype.toString.call(i);
|
|
422
|
-
return t === "[object RegExp]" || t === "[object Date]" || ei(i);
|
|
423
|
-
}
|
|
424
|
-
var Jr = typeof Symbol == "function" && Symbol.for, Qr = Jr ? Symbol.for("react.element") : 60103;
|
|
425
|
-
function ei(i) {
|
|
426
|
-
return i.$$typeof === Qr;
|
|
427
|
-
}
|
|
428
|
-
function ti(i) {
|
|
429
|
-
return Array.isArray(i) ? [] : {};
|
|
430
|
-
}
|
|
431
|
-
function Oe(i, t) {
|
|
432
|
-
return t.clone !== !1 && t.isMergeableObject(i) ? le(ti(i), i, t) : i;
|
|
433
|
-
}
|
|
434
|
-
function ri(i, t, e) {
|
|
435
|
-
return i.concat(t).map(function(r) {
|
|
436
|
-
return Oe(r, e);
|
|
437
|
-
});
|
|
438
|
-
}
|
|
439
|
-
function ii(i, t) {
|
|
440
|
-
if (!t.customMerge)
|
|
441
|
-
return le;
|
|
442
|
-
var e = t.customMerge(i);
|
|
443
|
-
return typeof e == "function" ? e : le;
|
|
444
|
-
}
|
|
445
|
-
function si(i) {
|
|
446
|
-
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(i).filter(function(t) {
|
|
447
|
-
return Object.propertyIsEnumerable.call(i, t);
|
|
448
|
-
}) : [];
|
|
449
|
-
}
|
|
450
|
-
function Wt(i) {
|
|
451
|
-
return Object.keys(i).concat(si(i));
|
|
452
|
-
}
|
|
453
|
-
function rr(i, t) {
|
|
454
|
-
try {
|
|
455
|
-
return t in i;
|
|
456
|
-
} catch {
|
|
457
|
-
return !1;
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
function ni(i, t) {
|
|
461
|
-
return rr(i, t) && !(Object.hasOwnProperty.call(i, t) && Object.propertyIsEnumerable.call(i, t));
|
|
462
|
-
}
|
|
463
|
-
function oi(i, t, e) {
|
|
464
|
-
var r = {};
|
|
465
|
-
return e.isMergeableObject(i) && Wt(i).forEach(function(s) {
|
|
466
|
-
r[s] = Oe(i[s], e);
|
|
467
|
-
}), Wt(t).forEach(function(s) {
|
|
468
|
-
ni(i, s) || (rr(i, s) && e.isMergeableObject(t[s]) ? r[s] = ii(s, e)(i[s], t[s], e) : r[s] = Oe(t[s], e));
|
|
469
|
-
}), r;
|
|
470
|
-
}
|
|
471
|
-
function le(i, t, e) {
|
|
472
|
-
e = e || {}, e.arrayMerge = e.arrayMerge || ri, e.isMergeableObject = e.isMergeableObject || qr, e.cloneUnlessOtherwiseSpecified = Oe;
|
|
473
|
-
var r = Array.isArray(t), s = Array.isArray(i), n = r === s;
|
|
474
|
-
return n ? r ? e.arrayMerge(i, t, e) : oi(i, t, e) : Oe(t, e);
|
|
475
|
-
}
|
|
476
|
-
le.all = function(t, e) {
|
|
477
|
-
if (!Array.isArray(t))
|
|
478
|
-
throw new Error("first argument should be an array");
|
|
479
|
-
return t.reduce(function(r, s) {
|
|
480
|
-
return le(r, s, e);
|
|
481
|
-
}, {});
|
|
482
|
-
};
|
|
483
|
-
var ai = le, li = ai;
|
|
484
|
-
const ir = /* @__PURE__ */ ct(li), ze = ["3.0"], hi = {
|
|
485
|
-
baidu: {
|
|
486
|
-
version: "3.0",
|
|
487
|
-
// 在build时会被静态替换, 导致使用者不能无法设置它
|
|
488
|
-
// @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
|
|
489
|
-
// @see @vite_process_env_detail
|
|
490
|
-
key: "kXOq8Hg9BZbZEWAjXKuzd1oGreynup8h"
|
|
491
|
-
},
|
|
492
|
-
google: {
|
|
493
|
-
version: "quarterly",
|
|
494
|
-
key: "AIzaSyBcyzMel3dYFNcfcr0LOklbBQNpWycyZXo",
|
|
495
|
-
language: "en-us",
|
|
496
|
-
libraries: ["places"]
|
|
497
|
-
},
|
|
498
|
-
here: {
|
|
499
|
-
version: ze[0],
|
|
500
|
-
key: ""
|
|
501
|
-
}
|
|
502
|
-
};
|
|
503
|
-
let sr;
|
|
504
|
-
function nr() {
|
|
505
|
-
return sr || C("请先安装: Vue<PartialTgMapConfig>.use(TgMap, {})");
|
|
506
|
-
}
|
|
507
|
-
function ci(i) {
|
|
508
|
-
i != null && (sr = ir(hi, i));
|
|
509
|
-
}
|
|
510
418
|
var at;
|
|
511
419
|
((i) => {
|
|
512
420
|
function t(e) {
|
|
@@ -516,35 +424,35 @@ var at;
|
|
|
516
424
|
})(at || (at = {}));
|
|
517
425
|
var he;
|
|
518
426
|
((i) => {
|
|
519
|
-
function t(
|
|
520
|
-
return
|
|
427
|
+
function t(d, o) {
|
|
428
|
+
return d.length === o.length && d.every((l, h) => l === o[h]);
|
|
521
429
|
}
|
|
522
430
|
i.equals = t;
|
|
523
|
-
function e(
|
|
524
|
-
const l =
|
|
431
|
+
function e(d, o) {
|
|
432
|
+
const l = d.indexOf(o);
|
|
525
433
|
if (l !== -1)
|
|
526
|
-
return
|
|
434
|
+
return d.splice(l, 1)[0];
|
|
527
435
|
}
|
|
528
436
|
i.remove = e;
|
|
529
|
-
function r(
|
|
530
|
-
for (const l of
|
|
437
|
+
function r(d, o) {
|
|
438
|
+
for (const l of d)
|
|
531
439
|
if (l instanceof o)
|
|
532
440
|
return l;
|
|
533
441
|
}
|
|
534
442
|
i.findByType = r;
|
|
535
|
-
function s(
|
|
536
|
-
return
|
|
443
|
+
function s(d, o) {
|
|
444
|
+
return d.includes(o);
|
|
537
445
|
}
|
|
538
446
|
i.includesTyped = s;
|
|
539
|
-
function n(
|
|
540
|
-
const
|
|
447
|
+
function n(d, o, l) {
|
|
448
|
+
const h = o >= 0 ? o : d.length + o;
|
|
541
449
|
if (l === void 0)
|
|
542
|
-
return h
|
|
543
|
-
h
|
|
450
|
+
return d[h];
|
|
451
|
+
d[h] = l;
|
|
544
452
|
}
|
|
545
453
|
i.at = n;
|
|
546
|
-
function a(
|
|
547
|
-
return
|
|
454
|
+
function a(d) {
|
|
455
|
+
return d.length > 0;
|
|
548
456
|
}
|
|
549
457
|
i.isNotEmpty = a;
|
|
550
458
|
})(he || (he = {}));
|
|
@@ -552,9 +460,9 @@ var ce;
|
|
|
552
460
|
((i) => {
|
|
553
461
|
function t(s, n) {
|
|
554
462
|
const a = s.getLength();
|
|
555
|
-
for (let
|
|
556
|
-
if (s.getAt(
|
|
557
|
-
return
|
|
463
|
+
for (let d = 0; d < a; d++)
|
|
464
|
+
if (s.getAt(d) === n)
|
|
465
|
+
return d;
|
|
558
466
|
return -1;
|
|
559
467
|
}
|
|
560
468
|
i.indexOf = t;
|
|
@@ -573,19 +481,19 @@ var ce;
|
|
|
573
481
|
}
|
|
574
482
|
i.listenChanged = r;
|
|
575
483
|
})(ce || (ce = {}));
|
|
576
|
-
function
|
|
484
|
+
function rr(i, t, e) {
|
|
577
485
|
return i.addListener(t, e).remove;
|
|
578
486
|
}
|
|
579
|
-
function
|
|
487
|
+
function Kr(i, t, e) {
|
|
580
488
|
return i.addEventListener(t, e), () => i.removeEventListener(t, e);
|
|
581
489
|
}
|
|
582
|
-
function
|
|
490
|
+
function Xr(i, t, e, r) {
|
|
583
491
|
return i.addEventListener(t, e, r), () => i.removeEventListener(t, e, r);
|
|
584
492
|
}
|
|
585
|
-
function
|
|
493
|
+
function Wt(i, t, e) {
|
|
586
494
|
return i.addEventListener(t, e), () => i.removeEventListener(t, e);
|
|
587
495
|
}
|
|
588
|
-
class
|
|
496
|
+
class ir {
|
|
589
497
|
constructor(t, e) {
|
|
590
498
|
c(this, "eventMap", /* @__PURE__ */ new Map());
|
|
591
499
|
c(this, "target", void 0);
|
|
@@ -597,7 +505,7 @@ class ar {
|
|
|
597
505
|
}
|
|
598
506
|
class Ue {
|
|
599
507
|
constructor(t, e) {
|
|
600
|
-
c(this, "eventHub", new
|
|
508
|
+
c(this, "eventHub", new sr());
|
|
601
509
|
this.delegate = t, this.options = e;
|
|
602
510
|
}
|
|
603
511
|
notify(t) {
|
|
@@ -624,7 +532,7 @@ class Ue {
|
|
|
624
532
|
this.delegate.removeEventListener(t, e);
|
|
625
533
|
}
|
|
626
534
|
}
|
|
627
|
-
const Zt = class extends
|
|
535
|
+
const Zt = class extends ir {
|
|
628
536
|
addEventListener(t, e) {
|
|
629
537
|
const r = $e(t, e);
|
|
630
538
|
if (this.eventMap.get(r)) {
|
|
@@ -637,7 +545,7 @@ const Zt = class extends ar {
|
|
|
637
545
|
target: this.target,
|
|
638
546
|
originalEvent: n
|
|
639
547
|
};
|
|
640
|
-
n != null && n.latLng && (a.position =
|
|
548
|
+
n != null && n.latLng && (a.position = v.fromGoogle(n.latLng, this.coordTypeSupplier.coordType)), e.call(this.target, a);
|
|
641
549
|
});
|
|
642
550
|
this.eventMap.set(r, s);
|
|
643
551
|
}
|
|
@@ -646,9 +554,9 @@ const Zt = class extends ar {
|
|
|
646
554
|
s ? (s.remove(), this.eventMap.delete(r)) : console.warn("移除失败, 不存在该listener", r, e);
|
|
647
555
|
}
|
|
648
556
|
};
|
|
649
|
-
let
|
|
557
|
+
let ie = Zt;
|
|
650
558
|
// 事件类型映射: tg => google
|
|
651
|
-
c(
|
|
559
|
+
c(ie, "EVENT_TYPE_MAP", {
|
|
652
560
|
"center-changed": "center_changed",
|
|
653
561
|
"zoom-changed": "zoom_changed",
|
|
654
562
|
"radius-changed": "radius_changed",
|
|
@@ -664,7 +572,7 @@ c(re, "EVENT_TYPE_MAP", {
|
|
|
664
572
|
"map-mouseup": "mouseup",
|
|
665
573
|
"map-dblclick": "dblclick"
|
|
666
574
|
});
|
|
667
|
-
const We = class extends
|
|
575
|
+
const We = class extends ir {
|
|
668
576
|
addEventListener(t, e) {
|
|
669
577
|
const r = $e(t, e);
|
|
670
578
|
if (this.eventMap.get(r)) {
|
|
@@ -677,7 +585,7 @@ const We = class extends ar {
|
|
|
677
585
|
target: this.target,
|
|
678
586
|
originalEvent: n
|
|
679
587
|
};
|
|
680
|
-
n.point && (a.position =
|
|
588
|
+
n.point && (a.position = v.fromBaidu(n.point, this.coordTypeSupplier.coordType)), e.call(this.target, a);
|
|
681
589
|
};
|
|
682
590
|
this.inner.addEventListener(We.EVENT_TYPE_MAP[t] || t, s), this.eventMap.set(r, s);
|
|
683
591
|
}
|
|
@@ -686,10 +594,10 @@ const We = class extends ar {
|
|
|
686
594
|
s ? (this.inner.removeEventListener(We.EVENT_TYPE_MAP[t] || t, s), this.eventMap.delete(r)) : console.warn("移除失败, 不存在该listener", r, e);
|
|
687
595
|
}
|
|
688
596
|
};
|
|
689
|
-
let
|
|
597
|
+
let le = We;
|
|
690
598
|
// cSpell:words clickclose
|
|
691
599
|
// 事件类型映射, tg => baidu
|
|
692
|
-
c(
|
|
600
|
+
c(le, "EVENT_TYPE_MAP", {
|
|
693
601
|
drag: "dragging",
|
|
694
602
|
closeclick: "clickclose",
|
|
695
603
|
// baidu不支持contextmenu事件, 将其映射为rightclick
|
|
@@ -697,7 +605,7 @@ c(ae, "EVENT_TYPE_MAP", {
|
|
|
697
605
|
"zoom-changed": "zoomend",
|
|
698
606
|
"map-type-changed": "maptypechange"
|
|
699
607
|
});
|
|
700
|
-
class
|
|
608
|
+
class sr {
|
|
701
609
|
constructor() {
|
|
702
610
|
c(this, "typeMap", /* @__PURE__ */ new Map());
|
|
703
611
|
}
|
|
@@ -725,7 +633,7 @@ class Ht {
|
|
|
725
633
|
constructor(t, e) {
|
|
726
634
|
c(this, "keyToValue", /* @__PURE__ */ new Map());
|
|
727
635
|
c(this, "valueToKey", /* @__PURE__ */ new Map());
|
|
728
|
-
|
|
636
|
+
ae(t.length === e.length);
|
|
729
637
|
for (let r = t.length - 1; r >= 0; r--)
|
|
730
638
|
this.keyToValue.set(t[r], e[r]), this.valueToKey.set(e[r], t[r]);
|
|
731
639
|
}
|
|
@@ -736,7 +644,7 @@ class Ht {
|
|
|
736
644
|
return this.keyToValue.get(t) ?? C();
|
|
737
645
|
}
|
|
738
646
|
}
|
|
739
|
-
class
|
|
647
|
+
class Jr {
|
|
740
648
|
constructor(t, e = 10) {
|
|
741
649
|
c(this, "map", /* @__PURE__ */ new Map());
|
|
742
650
|
this.values = t, this.maxSize4Debug = e;
|
|
@@ -765,7 +673,7 @@ class pi {
|
|
|
765
673
|
return this.getOrNull(t, e) ?? C(`key(${e})不存在与valueMap(${this.getValueMap(t)})中`);
|
|
766
674
|
}
|
|
767
675
|
}
|
|
768
|
-
class
|
|
676
|
+
class _e {
|
|
769
677
|
constructor(t) {
|
|
770
678
|
c(this, "value");
|
|
771
679
|
this.creator = t;
|
|
@@ -840,16 +748,16 @@ var S = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
|
|
|
840
748
|
}
|
|
841
749
|
i.getGoogle = n;
|
|
842
750
|
})(z || (z = {}));
|
|
843
|
-
class
|
|
751
|
+
class Qr {
|
|
844
752
|
constructor(t) {
|
|
845
753
|
/** 实际添加到地图中的control对象 */
|
|
846
754
|
c(this, "inner");
|
|
847
755
|
this.position = t;
|
|
848
756
|
}
|
|
849
757
|
}
|
|
850
|
-
class
|
|
758
|
+
class nr {
|
|
851
759
|
}
|
|
852
|
-
class pt extends
|
|
760
|
+
class pt extends nr {
|
|
853
761
|
constructor(t, e) {
|
|
854
762
|
super(), this.inner = t, this.position = e;
|
|
855
763
|
}
|
|
@@ -872,7 +780,7 @@ class pt extends hr {
|
|
|
872
780
|
t.innerMap.removeControl(this.inner);
|
|
873
781
|
}
|
|
874
782
|
}
|
|
875
|
-
class gt extends
|
|
783
|
+
class gt extends nr {
|
|
876
784
|
constructor(e, r) {
|
|
877
785
|
super();
|
|
878
786
|
c(this, "visible", !1);
|
|
@@ -909,7 +817,7 @@ class gt extends hr {
|
|
|
909
817
|
});
|
|
910
818
|
}
|
|
911
819
|
}
|
|
912
|
-
var
|
|
820
|
+
var or = /* @__PURE__ */ ((i) => (i.normal = "normal", i.satellite = "satellite", i.hybrid = "hybrid", i))(or || {});
|
|
913
821
|
class A {
|
|
914
822
|
constructor(t, e, r, s) {
|
|
915
823
|
this.id = t, this.baidu = e, this.google = r, this.googleCoordType = s;
|
|
@@ -934,16 +842,16 @@ class A {
|
|
|
934
842
|
ut("google的内置地图没有对应的实例");
|
|
935
843
|
}
|
|
936
844
|
}
|
|
937
|
-
class
|
|
845
|
+
class Us {
|
|
938
846
|
constructor(t, e) {
|
|
939
|
-
c(this, "baiduLayerCached", new
|
|
847
|
+
c(this, "baiduLayerCached", new _e(() => {
|
|
940
848
|
const t = new BMap.TileLayer({});
|
|
941
849
|
return t.getTilesUrl = (e, r) => {
|
|
942
850
|
const s = Math.pow(2, r - 1), n = e.x + s, a = s - 1 - e.y;
|
|
943
851
|
return this.options.getTileUrl({ x: n, y: a }, r);
|
|
944
852
|
}, t;
|
|
945
853
|
}));
|
|
946
|
-
c(this, "baiduMapTypeCached", new
|
|
854
|
+
c(this, "baiduMapTypeCached", new _e(() => {
|
|
947
855
|
const t = new BMap.MapType(this.options.name, this.baiduLayerCached.get(), {
|
|
948
856
|
maxZoom: this.options.maxZoom,
|
|
949
857
|
minZoom: this.options.minZoom,
|
|
@@ -951,7 +859,7 @@ class Hs {
|
|
|
951
859
|
});
|
|
952
860
|
return t.__baidu_map_type__ = this, t;
|
|
953
861
|
}));
|
|
954
|
-
c(this, "googleCached", new
|
|
862
|
+
c(this, "googleCached", new _e(() => {
|
|
955
863
|
const t = new google.maps.ImageMapType({
|
|
956
864
|
getTileUrl: (e, r) => this.options.getTileUrl(e, r),
|
|
957
865
|
tileSize: new google.maps.Size(256, 256),
|
|
@@ -986,10 +894,10 @@ class Hs {
|
|
|
986
894
|
ut("这个方法不会被调用");
|
|
987
895
|
}
|
|
988
896
|
}
|
|
989
|
-
class
|
|
897
|
+
class ei {
|
|
990
898
|
constructor() {
|
|
991
|
-
c(this, "baiduCache", new
|
|
992
|
-
c(this, "googleCache", new
|
|
899
|
+
c(this, "baiduCache", new _e(() => new BMap.TrafficLayer()));
|
|
900
|
+
c(this, "googleCache", new _e(() => new google.maps.TrafficLayer()));
|
|
993
901
|
}
|
|
994
902
|
asBaiduLayer() {
|
|
995
903
|
return this.baiduCache.get();
|
|
@@ -1006,13 +914,13 @@ var $;
|
|
|
1006
914
|
), () => (
|
|
1007
915
|
/* 地形 */
|
|
1008
916
|
google.maps.MapTypeId.TERRAIN
|
|
1009
|
-
), x.wgs84), i.BUILD_IN_MAP_TYPES = new
|
|
917
|
+
), x.wgs84), i.BUILD_IN_MAP_TYPES = new Jr([i.NORMAL, i.SATELLITE, i.HYBRID, i.TERRAIN]);
|
|
1010
918
|
})($ || ($ = {}));
|
|
1011
|
-
var
|
|
1012
|
-
const
|
|
919
|
+
var ar = /* @__PURE__ */ ((i) => (i.DEFAULT = "default", i.HORIZONTAL = "horizontal", i.DROPDOWN = "dropdown", i))(ar || {});
|
|
920
|
+
const lr = [$.NORMAL, $.SATELLITE, $.HYBRID];
|
|
1013
921
|
class mt extends pt {
|
|
1014
922
|
static create(t) {
|
|
1015
|
-
const e = t.mapTypes ??
|
|
923
|
+
const e = t.mapTypes ?? lr, r = {
|
|
1016
924
|
default: BMAP_MAPTYPE_CONTROL_HORIZONTAL,
|
|
1017
925
|
horizontal: BMAP_MAPTYPE_CONTROL_HORIZONTAL,
|
|
1018
926
|
dropdown: BMAP_MAPTYPE_CONTROL_DROPDOWN
|
|
@@ -1023,20 +931,20 @@ class mt extends pt {
|
|
|
1023
931
|
return t.position && s.setAnchor(z.getBaidu().toValue(t.position)), new mt(s, t.position);
|
|
1024
932
|
}
|
|
1025
933
|
}
|
|
1026
|
-
const
|
|
1027
|
-
constructor(t = "default", e = S.TOP_LEFT, r =
|
|
1028
|
-
super("mapType", e), this.type = t, this.mapTypes = r,
|
|
934
|
+
const oe = class extends gt {
|
|
935
|
+
constructor(t = "default", e = S.TOP_LEFT, r = lr) {
|
|
936
|
+
super("mapType", e), this.type = t, this.mapTypes = r, oe.type2google || (oe.type2google = {
|
|
1029
937
|
default: google.maps.MapTypeControlStyle.DEFAULT,
|
|
1030
938
|
horizontal: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
|
|
1031
939
|
dropdown: google.maps.MapTypeControlStyle.DROPDOWN_MENU
|
|
1032
940
|
});
|
|
1033
941
|
}
|
|
1034
942
|
static create(t) {
|
|
1035
|
-
return new
|
|
943
|
+
return new oe(t.type, t.position, t.mapTypes);
|
|
1036
944
|
}
|
|
1037
945
|
onCreateOptions() {
|
|
1038
946
|
const t = super.onCreateOptions();
|
|
1039
|
-
return t.style =
|
|
947
|
+
return t.style = oe.type2google[this.type], t.mapTypeIds = this.mapTypes.map((e) => e instanceof A ? e.getGoogleMapTypeId() : e.id), t;
|
|
1040
948
|
}
|
|
1041
949
|
addTo(t) {
|
|
1042
950
|
super.addTo(t), this.mapTypes.forEach((e) => {
|
|
@@ -1044,7 +952,7 @@ const ne = class extends gt {
|
|
|
1044
952
|
});
|
|
1045
953
|
}
|
|
1046
954
|
};
|
|
1047
|
-
let Se =
|
|
955
|
+
let Se = oe;
|
|
1048
956
|
c(Se, "type2google");
|
|
1049
957
|
class ft extends pt {
|
|
1050
958
|
static create(t) {
|
|
@@ -1080,28 +988,28 @@ class _t extends gt {
|
|
|
1080
988
|
super("zoom", t);
|
|
1081
989
|
}
|
|
1082
990
|
}
|
|
1083
|
-
function
|
|
991
|
+
function ti(i) {
|
|
1084
992
|
let t, e, r;
|
|
1085
|
-
const s = "The Google Maps JavaScript API", n = "google", a = "importLibrary",
|
|
1086
|
-
var
|
|
1087
|
-
await (e = o.createElement("script")),
|
|
993
|
+
const s = "The Google Maps JavaScript API", n = "google", a = "importLibrary", d = "__ib__", o = document, l = window, h = l[n] || (l[n] = {}), u = h.maps || (h.maps = {}), p = /* @__PURE__ */ new Set(), f = new URLSearchParams(), _ = () => t || (t = new Promise(async (T, g) => {
|
|
994
|
+
var y;
|
|
995
|
+
await (e = o.createElement("script")), f.set("libraries", [...p] + "");
|
|
1088
996
|
for (r in i)
|
|
1089
|
-
|
|
1090
|
-
|
|
997
|
+
f.set(r.replace(/[A-Z]/g, (b) => "_" + b[0].toLowerCase()), i[r]);
|
|
998
|
+
f.set("callback", n + ".maps." + d), e.src = `https://maps.${n}apis.com/maps/api/js?` + f, u[d] = T, e.onerror = () => t = g(Error(s + " could not load.")), e.nonce = ((y = o.querySelector("script[nonce]")) == null ? void 0 : y.nonce) || "", o.head.append(e);
|
|
1091
999
|
}));
|
|
1092
1000
|
u[a] ? console.warn(s + " only loads once. Ignoring:", i) : u[a] = (T, ...g) => p.add(T) && _().then(() => u[a](T, ...g));
|
|
1093
1001
|
}
|
|
1094
|
-
let
|
|
1002
|
+
let ri, ii;
|
|
1095
1003
|
const J = {
|
|
1096
1004
|
/** Google的坐标0点 */
|
|
1097
1005
|
get LATLNG_ZERO() {
|
|
1098
|
-
return
|
|
1006
|
+
return ri ?? (ri = new google.maps.LatLng({ lat: 0, lng: 0 }));
|
|
1099
1007
|
},
|
|
1100
1008
|
get BOUNDS_ZERO() {
|
|
1101
|
-
return
|
|
1009
|
+
return ii ?? (ii = new google.maps.LatLngBounds(this.LATLNG_ZERO, this.LATLNG_ZERO));
|
|
1102
1010
|
}
|
|
1103
1011
|
};
|
|
1104
|
-
function
|
|
1012
|
+
function hr(i, t = { country: "", province: "", city: "", district: "", street: "", streetNumber: "" }) {
|
|
1105
1013
|
for (const e of i)
|
|
1106
1014
|
for (const r of e.types)
|
|
1107
1015
|
switch (r) {
|
|
@@ -1126,22 +1034,22 @@ function pr(i, t = { country: "", province: "", city: "", district: "", street:
|
|
|
1126
1034
|
}
|
|
1127
1035
|
return t;
|
|
1128
1036
|
}
|
|
1129
|
-
function
|
|
1037
|
+
function cr(i, t) {
|
|
1130
1038
|
var r;
|
|
1131
|
-
const e = i.address_components &&
|
|
1039
|
+
const e = i.address_components && hr(i.address_components);
|
|
1132
1040
|
return {
|
|
1133
1041
|
country: (e == null ? void 0 : e.country) ?? "",
|
|
1134
1042
|
province: (e == null ? void 0 : e.province) ?? "",
|
|
1135
1043
|
city: (e == null ? void 0 : e.city) ?? "",
|
|
1136
1044
|
id: i.place_id ?? "",
|
|
1137
1045
|
address: i.formatted_address ?? "",
|
|
1138
|
-
position:
|
|
1046
|
+
position: v.fromGoogle(((r = i.geometry) == null ? void 0 : r.location) ?? J.LATLNG_ZERO, t.coordType),
|
|
1139
1047
|
title: i.name ?? ""
|
|
1140
1048
|
};
|
|
1141
1049
|
}
|
|
1142
|
-
class
|
|
1050
|
+
class dr {
|
|
1143
1051
|
}
|
|
1144
|
-
class
|
|
1052
|
+
class si extends dr {
|
|
1145
1053
|
constructor(e, r) {
|
|
1146
1054
|
super();
|
|
1147
1055
|
c(this, "inner");
|
|
@@ -1157,7 +1065,7 @@ class _i extends mr {
|
|
|
1157
1065
|
this.inner.setBounds(e.toGoogle(this.map.coordType));
|
|
1158
1066
|
}
|
|
1159
1067
|
addResultListener(e) {
|
|
1160
|
-
return
|
|
1068
|
+
return rr(this.inner, "place_changed", () => {
|
|
1161
1069
|
const r = this.inner.getPlace(), s = {
|
|
1162
1070
|
title: r.name ?? "",
|
|
1163
1071
|
province: "",
|
|
@@ -1167,11 +1075,11 @@ class _i extends mr {
|
|
|
1167
1075
|
streetNumber: "",
|
|
1168
1076
|
country: ""
|
|
1169
1077
|
};
|
|
1170
|
-
r.address_components &&
|
|
1078
|
+
r.address_components && hr(r.address_components, s), e(s);
|
|
1171
1079
|
});
|
|
1172
1080
|
}
|
|
1173
1081
|
}
|
|
1174
|
-
class
|
|
1082
|
+
class ni extends dr {
|
|
1175
1083
|
constructor(e, r) {
|
|
1176
1084
|
super();
|
|
1177
1085
|
c(this, "inner");
|
|
@@ -1185,7 +1093,7 @@ class bi extends mr {
|
|
|
1185
1093
|
const s = () => {
|
|
1186
1094
|
this.inner.setLocation(this.map.innerMap);
|
|
1187
1095
|
};
|
|
1188
|
-
this.removeableArray.push(
|
|
1096
|
+
this.removeableArray.push(Wt(this.map, "center-changed", s)), this.removeableArray.push(Wt(this.map, "zoom-changed", s));
|
|
1189
1097
|
}
|
|
1190
1098
|
}
|
|
1191
1099
|
setBounds(e) {
|
|
@@ -1193,14 +1101,14 @@ class bi extends mr {
|
|
|
1193
1101
|
}
|
|
1194
1102
|
addResultListener(e) {
|
|
1195
1103
|
let r = 0;
|
|
1196
|
-
const s =
|
|
1197
|
-
const
|
|
1104
|
+
const s = Kr(this.inner, "confirm", (a) => {
|
|
1105
|
+
const d = a.item.value;
|
|
1198
1106
|
r = Date.now(), e(Object.assign({
|
|
1199
|
-
title:
|
|
1107
|
+
title: d.business,
|
|
1200
1108
|
country: ""
|
|
1201
1109
|
// Baidu的自动完成只支持中国
|
|
1202
|
-
},
|
|
1203
|
-
}), n =
|
|
1110
|
+
}, d));
|
|
1111
|
+
}), n = Xr(this.input, "keyup", (a) => {
|
|
1204
1112
|
a.key === "Enter" && Date.now() - r > 100 && e({
|
|
1205
1113
|
title: this.input.value,
|
|
1206
1114
|
country: "",
|
|
@@ -1216,23 +1124,23 @@ class bi extends mr {
|
|
|
1216
1124
|
};
|
|
1217
1125
|
}
|
|
1218
1126
|
}
|
|
1219
|
-
class
|
|
1127
|
+
class ur {
|
|
1220
1128
|
constructor(t) {
|
|
1221
1129
|
this.options = t;
|
|
1222
1130
|
}
|
|
1223
1131
|
}
|
|
1224
|
-
function
|
|
1132
|
+
function be(i, t, e) {
|
|
1225
1133
|
const r = new URL(t, i), s = new URLSearchParams(Object.entries(e).filter(Yr));
|
|
1226
1134
|
return r.search = "?" + s.toString(), r;
|
|
1227
1135
|
}
|
|
1228
1136
|
function et() {
|
|
1229
|
-
const i = window.location.hostname.split(".").filter((t) => !
|
|
1137
|
+
const i = window.location.hostname.split(".").filter((t) => !ue.isInt(t));
|
|
1230
1138
|
return i.length === 3 ? i.join(".") : [...i, "tg", "map", "urls"].slice(0, 3).join(".");
|
|
1231
1139
|
}
|
|
1232
|
-
const
|
|
1140
|
+
const He = class extends ur {
|
|
1233
1141
|
/** @see https://developers.google.com/maps/documentation/urls/get-started#directions-action */
|
|
1234
1142
|
directions(t, e, r) {
|
|
1235
|
-
return
|
|
1143
|
+
return be(He.BASE_URL, "dir/", {
|
|
1236
1144
|
api: "1",
|
|
1237
1145
|
// {@template google_map_normal_gcj02}
|
|
1238
1146
|
// google地图的普通地图, 在国内其实上是gcj02坐标, 卫星地图是wgs84坐标, 因为这里打开的是基础地图, 故使用gcj02
|
|
@@ -1244,23 +1152,23 @@ const je = class extends fr {
|
|
|
1244
1152
|
}
|
|
1245
1153
|
/** @see https://developers.google.com/maps/documentation/urls/get-started#search-action */
|
|
1246
1154
|
search(t) {
|
|
1247
|
-
return
|
|
1155
|
+
return be(He.BASE_URL, "search/", {
|
|
1248
1156
|
api: "1",
|
|
1249
1157
|
// {@macro google_map_normal_gcj02}
|
|
1250
1158
|
query: V.toString(t, x.gcj02)
|
|
1251
1159
|
});
|
|
1252
1160
|
}
|
|
1253
1161
|
};
|
|
1254
|
-
let Ae =
|
|
1162
|
+
let Ae = He;
|
|
1255
1163
|
c(Ae, "BASE_URL", "https://www.google.com/maps/");
|
|
1256
|
-
const
|
|
1164
|
+
const Me = class extends ur {
|
|
1257
1165
|
/**
|
|
1258
1166
|
* 导航
|
|
1259
1167
|
* @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
|
|
1260
1168
|
* */
|
|
1261
1169
|
directions(t, e, r = "driving") {
|
|
1262
1170
|
const s = V.getCoordType(e) ?? V.getCoordType(t) ?? x.bd09, n = V.toString(e, s);
|
|
1263
|
-
return
|
|
1171
|
+
return be(Me.BASE_URL, "direction", {
|
|
1264
1172
|
// baidu地图, 一定要有起点, 故这里用终点当起点, 防止导航失败
|
|
1265
1173
|
origin: V.toString(t, s) ?? (typeof e != "string" ? `name:请选择起点|latlng:${n}` : n),
|
|
1266
1174
|
destination: n,
|
|
@@ -1287,7 +1195,7 @@ const Te = class extends fr {
|
|
|
1287
1195
|
* @see https://lbsyun.baidu.com/faq/api?title=webapi/uri/web#%E5%9B%BE%E5%8C%BA%E5%8A%9F%E8%83%BD
|
|
1288
1196
|
*/
|
|
1289
1197
|
markerApi(t, e, r) {
|
|
1290
|
-
return
|
|
1198
|
+
return be(Me.BASE_URL, "marker", {
|
|
1291
1199
|
location: `${t.lat},${t.lng}`,
|
|
1292
1200
|
coord_type: t.coord === x.bd09 ? void 0 : t.coord,
|
|
1293
1201
|
title: e,
|
|
@@ -1301,7 +1209,7 @@ const Te = class extends fr {
|
|
|
1301
1209
|
* @see https://lbsyun.baidu.com/faq/api?title=webapi/uri/web#%E5%9B%BE%E5%8C%BA%E5%8A%9F%E8%83%BD:~:text=%E4%B8%8D%E4%BF%9D%E8%AF%81%E6%9C%8D%E5%8A%A1%E3%80%82-,2.1.2%20%E5%9C%B0%E5%9D%80%E8%A7%A3%E6%9E%90,-%E8%B0%83%E7%94%A8%E8%AF%A5
|
|
1302
1210
|
* */
|
|
1303
1211
|
geocoderApi(t) {
|
|
1304
|
-
return
|
|
1212
|
+
return be(Me.BASE_URL, "geocoder", {
|
|
1305
1213
|
...typeof t == "string" ? {
|
|
1306
1214
|
address: t
|
|
1307
1215
|
} : {
|
|
@@ -1314,20 +1222,20 @@ const Te = class extends fr {
|
|
|
1314
1222
|
});
|
|
1315
1223
|
}
|
|
1316
1224
|
};
|
|
1317
|
-
let Re =
|
|
1225
|
+
let Re = Me;
|
|
1318
1226
|
c(Re, "BASE_URL", "https://api.map.baidu.com/");
|
|
1319
|
-
let
|
|
1227
|
+
let oi = class pr {
|
|
1320
1228
|
constructor(t, e, r) {
|
|
1321
|
-
this.extend(
|
|
1229
|
+
this.extend(pr, 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;
|
|
1322
1230
|
var s = r || {};
|
|
1323
1231
|
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();
|
|
1324
1232
|
var n = this;
|
|
1325
1233
|
google.maps.event.addListener(this.map_, "zoom_changed", function() {
|
|
1326
|
-
var a = n.map_.getZoom(),
|
|
1234
|
+
var a = n.map_.getZoom(), d = n.map_.minZoom || 0, o = Math.min(
|
|
1327
1235
|
n.map_.maxZoom || 100,
|
|
1328
1236
|
n.map_.mapTypes[n.map_.getMapTypeId()].maxZoom
|
|
1329
1237
|
);
|
|
1330
|
-
a = Math.min(Math.max(a,
|
|
1238
|
+
a = Math.min(Math.max(a, d), o), n.prevZoom_ != a && (n.prevZoom_ = a, n.resetViewport());
|
|
1331
1239
|
}), google.maps.event.addListener(this.map_, "idle", function() {
|
|
1332
1240
|
n.redraw();
|
|
1333
1241
|
}), e && (e.length || Object.keys(e).length) && this.addMarkers(e, !1);
|
|
@@ -1570,8 +1478,8 @@ let Ti = class yr {
|
|
|
1570
1478
|
*/
|
|
1571
1479
|
removeMarkers(t, e) {
|
|
1572
1480
|
for (var r = t === this.getMarkers() ? t.slice() : t, s = !1, n = 0, a; a = r[n]; n++) {
|
|
1573
|
-
var
|
|
1574
|
-
s = s ||
|
|
1481
|
+
var d = this.removeMarker_(a);
|
|
1482
|
+
s = s || d;
|
|
1575
1483
|
}
|
|
1576
1484
|
if (!e && s)
|
|
1577
1485
|
return this.resetViewport(), this.redraw(), !0;
|
|
@@ -1658,8 +1566,8 @@ let Ti = class yr {
|
|
|
1658
1566
|
n.x += this.gridSize_, n.y -= this.gridSize_;
|
|
1659
1567
|
var a = e.fromLatLngToDivPixel(s);
|
|
1660
1568
|
a.x -= this.gridSize_, a.y += this.gridSize_;
|
|
1661
|
-
var
|
|
1662
|
-
return t.extend(
|
|
1569
|
+
var d = e.fromDivPixelToLatLng(n), o = e.fromDivPixelToLatLng(a);
|
|
1570
|
+
return t.extend(d), t.extend(o), t;
|
|
1663
1571
|
}
|
|
1664
1572
|
/**
|
|
1665
1573
|
* Determins if a marker is contained in a bounds.
|
|
@@ -1717,7 +1625,7 @@ let Ti = class yr {
|
|
|
1717
1625
|
distanceBetweenPoints_(t, e) {
|
|
1718
1626
|
if (!t || !e)
|
|
1719
1627
|
return 0;
|
|
1720
|
-
var r = 6371, s = (e.lat() - t.lat()) * Math.PI / 180, n = (e.lng() - t.lng()) * Math.PI / 180, a = Math.sin(s / 2) * Math.sin(s / 2) + Math.cos(t.lat() * Math.PI / 180) * Math.cos(e.lat() * Math.PI / 180) * Math.sin(n / 2) * Math.sin(n / 2),
|
|
1628
|
+
var r = 6371, s = (e.lat() - t.lat()) * Math.PI / 180, n = (e.lng() - t.lng()) * Math.PI / 180, a = Math.sin(s / 2) * Math.sin(s / 2) + Math.cos(t.lat() * Math.PI / 180) * Math.cos(e.lat() * Math.PI / 180) * Math.sin(n / 2) * Math.sin(n / 2), d = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)), o = r * d;
|
|
1721
1629
|
return o;
|
|
1722
1630
|
}
|
|
1723
1631
|
/**
|
|
@@ -1730,14 +1638,14 @@ let Ti = class yr {
|
|
|
1730
1638
|
for (var e = 4e4, r = null, s = 0, n; n = this.clusters_[s]; s++) {
|
|
1731
1639
|
var a = n.getCenter();
|
|
1732
1640
|
if (a) {
|
|
1733
|
-
var
|
|
1734
|
-
|
|
1641
|
+
var d = this.distanceBetweenPoints_(a, t.getPosition());
|
|
1642
|
+
d < e && (e = d, r = n);
|
|
1735
1643
|
}
|
|
1736
1644
|
}
|
|
1737
1645
|
if (r && r.isMarkerInClusterBounds(t))
|
|
1738
1646
|
r.addMarker(t);
|
|
1739
1647
|
else {
|
|
1740
|
-
var o = new
|
|
1648
|
+
var o = new ai(this);
|
|
1741
1649
|
o.addMarker(t), this.clusters_.push(o);
|
|
1742
1650
|
}
|
|
1743
1651
|
}
|
|
@@ -1754,7 +1662,7 @@ let Ti = class yr {
|
|
|
1754
1662
|
), e = this.getExtendedBounds(t), r = 0, s; s = this.markers_[r]; r++)
|
|
1755
1663
|
!s.isAdded && this.isMarkerInBounds_(s, e) && this.addToClosestCluster_(s);
|
|
1756
1664
|
}
|
|
1757
|
-
},
|
|
1665
|
+
}, ai = class {
|
|
1758
1666
|
constructor(t) {
|
|
1759
1667
|
this.markerClusterer_ = t, this.map_ = t.getMap(), this.gridSize_ = t.getGridSize(), this.minClusterSize_ = t.getMinClusterSize(), this.averageCenter_ = t.isAverageCenter(), this.center_ = null, this.markers_ = [], this.bounds_ = null, this.clusterIcon_ = new bt(
|
|
1760
1668
|
this,
|
|
@@ -2023,7 +1931,7 @@ class bt {
|
|
|
2023
1931
|
), e.join("");
|
|
2024
1932
|
}
|
|
2025
1933
|
}
|
|
2026
|
-
var
|
|
1934
|
+
var gr = { exports: {} };
|
|
2027
1935
|
(function(i, t) {
|
|
2028
1936
|
(function(e, r) {
|
|
2029
1937
|
i.exports = r();
|
|
@@ -2039,55 +1947,55 @@ var vr = { exports: {} };
|
|
|
2039
1947
|
return r.lang.isString(o) ? document.getElementById(o) : o;
|
|
2040
1948
|
}, r._g = r.dom._g, r.browser = r.browser || {}, /msie (\d+\.\d)/i.test(navigator.userAgent) && (r.browser.ie = r.ie = document.documentMode || +RegExp.$1), r.dom.getComputedStyle = function(o, l) {
|
|
2041
1949
|
o = r.dom._g(o);
|
|
2042
|
-
var
|
|
2043
|
-
return
|
|
2044
|
-
}, r.dom._styleFixer = r.dom._styleFixer || {}, r.dom._styleFilter = r.dom._styleFilter || [], r.dom._styleFilter.filter = function(o, l,
|
|
2045
|
-
for (var u = 0, p = r.dom._styleFilter,
|
|
2046
|
-
(
|
|
1950
|
+
var h = r.dom.getDocument(o), u;
|
|
1951
|
+
return h.defaultView && h.defaultView.getComputedStyle && (u = h.defaultView.getComputedStyle(o, null), u) ? u[l] || u.getPropertyValue(l) : "";
|
|
1952
|
+
}, r.dom._styleFixer = r.dom._styleFixer || {}, r.dom._styleFilter = r.dom._styleFilter || [], r.dom._styleFilter.filter = function(o, l, h) {
|
|
1953
|
+
for (var u = 0, p = r.dom._styleFilter, f; f = p[u]; u++)
|
|
1954
|
+
(f = f[h]) && (l = f(o, l));
|
|
2047
1955
|
return l;
|
|
2048
1956
|
}, r.string = r.string || {}, r.string.toCamelCase = function(o) {
|
|
2049
1957
|
return o.indexOf("-") < 0 && o.indexOf("_") < 0 ? o : o.replace(/[-_][^-_]/g, function(l) {
|
|
2050
1958
|
return l.charAt(1).toUpperCase();
|
|
2051
1959
|
});
|
|
2052
1960
|
}, r.dom.getStyle = function(o, l) {
|
|
2053
|
-
var
|
|
2054
|
-
o =
|
|
2055
|
-
var u = o.style[l] || (o.currentStyle ? o.currentStyle[l] : "") ||
|
|
1961
|
+
var h = r.dom;
|
|
1962
|
+
o = h.g(o), l = r.string.toCamelCase(l);
|
|
1963
|
+
var u = o.style[l] || (o.currentStyle ? o.currentStyle[l] : "") || h.getComputedStyle(o, l);
|
|
2056
1964
|
if (!u) {
|
|
2057
|
-
var p =
|
|
1965
|
+
var p = h._styleFixer[l];
|
|
2058
1966
|
p && (u = p.get ? p.get(o) : r.dom.getStyle(o, p));
|
|
2059
1967
|
}
|
|
2060
|
-
return (p =
|
|
1968
|
+
return (p = h._styleFilter) && (u = p.filter(l, u, "get")), u;
|
|
2061
1969
|
}, r.getStyle = r.dom.getStyle, /opera\/(\d+\.\d)/i.test(navigator.userAgent) && (r.browser.opera = +RegExp.$1), r.browser.isWebkit = /webkit/i.test(navigator.userAgent), r.browser.isGecko = /gecko/i.test(navigator.userAgent) && !/like gecko/i.test(navigator.userAgent), r.browser.isStrict = document.compatMode == "CSS1Compat", r.dom.getPosition = function(o) {
|
|
2062
1970
|
o = r.dom.g(o);
|
|
2063
|
-
var l = r.dom.getDocument(o),
|
|
2064
|
-
|
|
2065
|
-
var p = { left: 0, top: 0 },
|
|
2066
|
-
if (o ==
|
|
1971
|
+
var l = r.dom.getDocument(o), h = r.browser, u = r.dom.getStyle;
|
|
1972
|
+
h.isGecko > 0 && l.getBoxObjectFor && u(o, "position") == "absolute" && (o.style.top === "" || o.style.left);
|
|
1973
|
+
var p = { left: 0, top: 0 }, f = h.ie && !h.isStrict ? l.body : l.documentElement, _, T;
|
|
1974
|
+
if (o == f)
|
|
2067
1975
|
return p;
|
|
2068
1976
|
if (o.getBoundingClientRect) {
|
|
2069
1977
|
T = o.getBoundingClientRect(), p.left = Math.floor(T.left) + Math.max(l.documentElement.scrollLeft, l.body.scrollLeft), p.top = Math.floor(T.top) + Math.max(l.documentElement.scrollTop, l.body.scrollTop), p.left -= l.documentElement.clientLeft, p.top -= l.documentElement.clientTop;
|
|
2070
|
-
var g = l.body,
|
|
2071
|
-
|
|
1978
|
+
var g = l.body, y = parseInt(u(g, "borderLeftWidth")), b = parseInt(u(g, "borderTopWidth"));
|
|
1979
|
+
h.ie && !h.isStrict && (p.left -= isNaN(y) ? 2 : y, p.top -= isNaN(b) ? 2 : b);
|
|
2072
1980
|
} else {
|
|
2073
1981
|
_ = o;
|
|
2074
1982
|
do {
|
|
2075
|
-
if (p.left += _.offsetLeft, p.top += _.offsetTop,
|
|
1983
|
+
if (p.left += _.offsetLeft, p.top += _.offsetTop, h.isWebkit > 0 && u(_, "position") == "fixed") {
|
|
2076
1984
|
p.left += l.body.scrollLeft, p.top += l.body.scrollTop;
|
|
2077
1985
|
break;
|
|
2078
1986
|
}
|
|
2079
1987
|
_ = _.offsetParent;
|
|
2080
1988
|
} while (_ && _ != o);
|
|
2081
|
-
for ((
|
|
2082
|
-
p.left -= _.scrollLeft, (!
|
|
1989
|
+
for ((h.opera > 0 || h.isWebkit > 0 && u(o, "position") == "absolute") && (p.top -= l.body.offsetTop), _ = o.offsetParent; _ && _ != l.body; )
|
|
1990
|
+
p.left -= _.scrollLeft, (!h.opera || _.tagName != "TR") && (p.top -= _.scrollTop), _ = _.offsetParent;
|
|
2083
1991
|
}
|
|
2084
1992
|
return p;
|
|
2085
|
-
}, r.event = r.event || {}, r.event._listeners = r.event._listeners || [], r.event.on = function(o, l,
|
|
1993
|
+
}, r.event = r.event || {}, r.event._listeners = r.event._listeners || [], r.event.on = function(o, l, h) {
|
|
2086
1994
|
l = l.replace(/^on/i, ""), o = r.dom._g(o);
|
|
2087
1995
|
var u = function(g) {
|
|
2088
|
-
|
|
2089
|
-
}, p = r.event._listeners,
|
|
2090
|
-
return l = l.toLowerCase(),
|
|
1996
|
+
h.call(o, g);
|
|
1997
|
+
}, p = r.event._listeners, f = r.event._eventFilter, _, T = l;
|
|
1998
|
+
return l = l.toLowerCase(), f && f[l] && (_ = f[l](o, l, u), T = _.type, u = _.listener), o.addEventListener ? o.addEventListener(T, u, !1) : o.attachEvent && o.attachEvent("on" + T, u), p[p.length] = [o, l, h, u, T], o;
|
|
2091
1999
|
}, r.on = r.event.on, function() {
|
|
2092
2000
|
var o = s[r.guid];
|
|
2093
2001
|
r.lang.guid = function() {
|
|
@@ -2106,87 +2014,87 @@ var vr = { exports: {} };
|
|
|
2106
2014
|
return "[object " + (this._className || "Object") + "]";
|
|
2107
2015
|
}, r.lang.Event = function(o, l) {
|
|
2108
2016
|
this.type = o, this.returnValue = !0, this.target = l || null, this.currentTarget = null;
|
|
2109
|
-
}, r.lang.Class.prototype.addEventListener = function(o, l,
|
|
2017
|
+
}, r.lang.Class.prototype.addEventListener = function(o, l, h) {
|
|
2110
2018
|
if (r.lang.isFunction(l)) {
|
|
2111
2019
|
!this.__listeners && (this.__listeners = {});
|
|
2112
2020
|
var u = this.__listeners, p;
|
|
2113
|
-
if (typeof
|
|
2114
|
-
if (/[^\w\-]/.test(
|
|
2115
|
-
throw "nonstandard key:" +
|
|
2116
|
-
l.hashCode =
|
|
2021
|
+
if (typeof h == "string" && h) {
|
|
2022
|
+
if (/[^\w\-]/.test(h))
|
|
2023
|
+
throw "nonstandard key:" + h;
|
|
2024
|
+
l.hashCode = h, p = h;
|
|
2117
2025
|
}
|
|
2118
2026
|
o.indexOf("on") != 0 && (o = "on" + o), typeof u[o] != "object" && (u[o] = {}), p = p || r.lang.guid(), l.hashCode = p, u[o][p] = l;
|
|
2119
2027
|
}
|
|
2120
2028
|
}, r.lang.Class.prototype.removeEventListener = function(o, l) {
|
|
2121
2029
|
if (!(typeof l < "u" && (r.lang.isFunction(l) && !(l = l.hashCode) || !r.lang.isString(l)))) {
|
|
2122
2030
|
!this.__listeners && (this.__listeners = {}), o.indexOf("on") != 0 && (o = "on" + o);
|
|
2123
|
-
var
|
|
2124
|
-
if (
|
|
2031
|
+
var h = this.__listeners;
|
|
2032
|
+
if (h[o])
|
|
2125
2033
|
if (typeof l < "u")
|
|
2126
|
-
|
|
2034
|
+
h[o][l] && delete h[o][l];
|
|
2127
2035
|
else
|
|
2128
|
-
for (var u in
|
|
2129
|
-
delete
|
|
2036
|
+
for (var u in h[o])
|
|
2037
|
+
delete h[o][u];
|
|
2130
2038
|
}
|
|
2131
2039
|
}, r.lang.Class.prototype.dispatchEvent = function(o, l) {
|
|
2132
2040
|
r.lang.isString(o) && (o = new r.lang.Event(o)), !this.__listeners && (this.__listeners = {}), l = l || {};
|
|
2133
|
-
for (var
|
|
2134
|
-
o[
|
|
2135
|
-
var
|
|
2041
|
+
for (var h in l)
|
|
2042
|
+
o[h] = l[h];
|
|
2043
|
+
var h, u = this.__listeners, p = o.type;
|
|
2136
2044
|
if (o.target = o.target || this, o.currentTarget = this, p.indexOf("on") != 0 && (p = "on" + p), r.lang.isFunction(this[p]) && this[p].apply(this, arguments), typeof u[p] == "object")
|
|
2137
|
-
for (
|
|
2138
|
-
u[p][
|
|
2045
|
+
for (h in u[p])
|
|
2046
|
+
u[p][h].apply(this, arguments);
|
|
2139
2047
|
return o.returnValue;
|
|
2140
|
-
}, r.lang.inherits = function(o, l,
|
|
2141
|
-
var u, p,
|
|
2048
|
+
}, r.lang.inherits = function(o, l, h) {
|
|
2049
|
+
var u, p, f = o.prototype, _ = new Function();
|
|
2142
2050
|
_.prototype = l.prototype, p = o.prototype = new _();
|
|
2143
|
-
for (u in
|
|
2144
|
-
p[u] =
|
|
2145
|
-
o.prototype.constructor = o, o.superClass = l.prototype, typeof
|
|
2051
|
+
for (u in f)
|
|
2052
|
+
p[u] = f[u];
|
|
2053
|
+
o.prototype.constructor = o, o.superClass = l.prototype, typeof h == "string" && (p._className = h);
|
|
2146
2054
|
}, r.inherits = r.lang.inherits;
|
|
2147
|
-
var n = "http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m", a = "png",
|
|
2055
|
+
var n = "http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m", a = "png", d = function(o, l, h) {
|
|
2148
2056
|
try {
|
|
2149
2057
|
BMap;
|
|
2150
2058
|
} catch {
|
|
2151
2059
|
throw Error("Baidu Map JS API is not ready yet!");
|
|
2152
2060
|
}
|
|
2153
|
-
e.lang.inherits(
|
|
2061
|
+
e.lang.inherits(d, BMap.Overlay, "TextIconOverlay"), this._position = o, this._text = l, this._options = h || {}, this._styles = this._options.styles || [], this._zIndex = this._options.zIndex, !this._styles.length && this._setupDefaultStyles();
|
|
2154
2062
|
};
|
|
2155
|
-
return
|
|
2156
|
-
for (var o = [53, 56, 66, 78, 90], l = 0,
|
|
2063
|
+
return d.prototype._setupDefaultStyles = function() {
|
|
2064
|
+
for (var o = [53, 56, 66, 78, 90], l = 0, h; h = o[l]; l++)
|
|
2157
2065
|
this._styles.push({
|
|
2158
2066
|
url: n + l + "." + a,
|
|
2159
|
-
size: new BMap.Size(
|
|
2067
|
+
size: new BMap.Size(h, h)
|
|
2160
2068
|
});
|
|
2161
|
-
},
|
|
2069
|
+
}, d.prototype.initialize = function(o) {
|
|
2162
2070
|
return this._map = o, this._domElement = document.createElement("div"), this._updateCss(), this._updateText(), this._updatePosition(), this._bind(), this._map.getPanes().markerMouseTarget.appendChild(this._domElement), this._domElement;
|
|
2163
|
-
},
|
|
2071
|
+
}, d.prototype.draw = function() {
|
|
2164
2072
|
this._map && this._updatePosition();
|
|
2165
|
-
},
|
|
2073
|
+
}, d.prototype.getText = function() {
|
|
2166
2074
|
return this._text;
|
|
2167
|
-
},
|
|
2075
|
+
}, d.prototype.setText = function(o) {
|
|
2168
2076
|
o && (!this._text || this._text.toString() != o.toString()) && (this._text = o, this._updateText(), this._updateCss(), this._updatePosition());
|
|
2169
|
-
},
|
|
2077
|
+
}, d.prototype.getPosition = function() {
|
|
2170
2078
|
return this._position;
|
|
2171
|
-
},
|
|
2079
|
+
}, d.prototype.setPosition = function(o) {
|
|
2172
2080
|
o && (!this._position || !this._position.equals(o)) && (this._position = o, this._updatePosition());
|
|
2173
|
-
},
|
|
2174
|
-
var
|
|
2081
|
+
}, d.prototype.getStyleByText = function(o, l) {
|
|
2082
|
+
var h = parseInt(o), u = parseInt(h / 10);
|
|
2175
2083
|
return u = Math.max(0, u), u = Math.min(u, l.length - 1), l[u];
|
|
2176
|
-
},
|
|
2084
|
+
}, d.prototype._updateCss = function() {
|
|
2177
2085
|
if (this._domElement) {
|
|
2178
2086
|
var o = this.getStyleByText(this._text, this._styles);
|
|
2179
2087
|
this._domElement.style.cssText = this._buildCssText(o);
|
|
2180
2088
|
}
|
|
2181
|
-
},
|
|
2089
|
+
}, d.prototype._updateText = function() {
|
|
2182
2090
|
this._domElement && (this._domElement.innerHTML = this._text);
|
|
2183
|
-
},
|
|
2091
|
+
}, d.prototype._updatePosition = function() {
|
|
2184
2092
|
if (this._domElement && this._position) {
|
|
2185
2093
|
var o = this._domElement.style, l = this._map.pointToOverlayPixel(this._position);
|
|
2186
2094
|
l.x -= Math.ceil(parseInt(o.width) / 2), l.y -= Math.ceil(parseInt(o.height) / 2), o.left = l.x + "px", o.top = l.y + "px";
|
|
2187
2095
|
}
|
|
2188
|
-
},
|
|
2189
|
-
var l = o.url,
|
|
2096
|
+
}, d.prototype._buildCssText = function(o) {
|
|
2097
|
+
var l = o.url, h = o.size, u = o.anchor, p = o.offset, f = o.textColor || "black", _ = o.textSize || 10, T = [];
|
|
2190
2098
|
if (this._zIndex && T.push("z-index:" + this._zIndex + ";"), e.browser.ie < 7)
|
|
2191
2099
|
T.push('filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="' + l + '");');
|
|
2192
2100
|
else {
|
|
@@ -2194,47 +2102,47 @@ var vr = { exports: {} };
|
|
|
2194
2102
|
var g = "0 0";
|
|
2195
2103
|
p instanceof BMap.Size && (g = p.width + "px " + p.height + "px"), T.push("background-position:" + g + ";");
|
|
2196
2104
|
}
|
|
2197
|
-
return
|
|
2198
|
-
},
|
|
2105
|
+
return h instanceof BMap.Size && (u instanceof BMap.Size ? (u.height > 0 && u.height < h.height && T.push("height:" + (h.height - u.height) + "px; padding-top:" + u.height + "px;"), u.width > 0 && u.width < h.width && T.push("width:" + (h.width - u.width) + "px; padding-left:" + u.width + "px;")) : (T.push("height:" + h.height + "px; line-height:" + h.height + "px;"), T.push("width:" + h.width + "px; text-align:center;"))), T.push("cursor:pointer; color:" + f + "; position:absolute; font-size:" + _ + "px; font-family:Arial,sans-serif; font-weight:bold"), T.join("");
|
|
2106
|
+
}, d.prototype._bind = function() {
|
|
2199
2107
|
if (!this._domElement)
|
|
2200
2108
|
return;
|
|
2201
|
-
var o = this, l = this._map,
|
|
2202
|
-
function u(p,
|
|
2109
|
+
var o = this, l = this._map, h = e.lang.Event;
|
|
2110
|
+
function u(p, f) {
|
|
2203
2111
|
var _ = p.srcElement || p.target, T = p.clientX || p.pageX, g = p.clientY || p.pageY;
|
|
2204
|
-
if (p &&
|
|
2205
|
-
var
|
|
2206
|
-
|
|
2112
|
+
if (p && f && T && g && _) {
|
|
2113
|
+
var y = e.dom.getPosition(l.getContainer());
|
|
2114
|
+
f.pixel = new BMap.Pixel(T - y.left, g - y.top), f.point = l.pixelToPoint(f.pixel);
|
|
2207
2115
|
}
|
|
2208
|
-
return
|
|
2116
|
+
return f;
|
|
2209
2117
|
}
|
|
2210
2118
|
e.event.on(this._domElement, "mouseover", function(p) {
|
|
2211
|
-
o.dispatchEvent(u(p, new
|
|
2119
|
+
o.dispatchEvent(u(p, new h("onmouseover")));
|
|
2212
2120
|
}), e.event.on(this._domElement, "mouseout", function(p) {
|
|
2213
|
-
o.dispatchEvent(u(p, new
|
|
2121
|
+
o.dispatchEvent(u(p, new h("onmouseout")));
|
|
2214
2122
|
}), e.event.on(this._domElement, "click", function(p) {
|
|
2215
|
-
o.dispatchEvent(u(p, new
|
|
2123
|
+
o.dispatchEvent(u(p, new h("onclick")));
|
|
2216
2124
|
});
|
|
2217
|
-
},
|
|
2125
|
+
}, d;
|
|
2218
2126
|
});
|
|
2219
|
-
})(
|
|
2220
|
-
var
|
|
2221
|
-
const
|
|
2222
|
-
var
|
|
2223
|
-
t =
|
|
2127
|
+
})(gr);
|
|
2128
|
+
var li = gr.exports;
|
|
2129
|
+
const jt = /* @__PURE__ */ ct(li);
|
|
2130
|
+
var mr = function(i, t, e) {
|
|
2131
|
+
t = hi(t);
|
|
2224
2132
|
var r = i.pointToPixel(t.getNorthEast()), s = i.pointToPixel(t.getSouthWest());
|
|
2225
2133
|
r.x += e, r.y -= e, s.x -= e, s.y += e;
|
|
2226
2134
|
var n = i.pixelToPoint(r), a = i.pixelToPoint(s);
|
|
2227
2135
|
return new BMap.Bounds(a, n);
|
|
2228
|
-
},
|
|
2229
|
-
var t =
|
|
2136
|
+
}, hi = function(i) {
|
|
2137
|
+
var t = Ie(i.getNorthEast().lng, -180, 180), e = Ie(i.getSouthWest().lng, -180, 180), r = Ie(i.getNorthEast().lat, -74, 74), s = Ie(i.getSouthWest().lat, -74, 74);
|
|
2230
2138
|
return new BMap.Bounds(new BMap.Point(e, s), new BMap.Point(t, r));
|
|
2231
|
-
},
|
|
2139
|
+
}, Ie = function(i, t, e) {
|
|
2232
2140
|
return t && (i = Math.max(i, t)), e && (i = Math.min(i, e)), i;
|
|
2233
|
-
},
|
|
2141
|
+
}, fr = function(i) {
|
|
2234
2142
|
return Object.prototype.toString.call(i) === "[object Array]";
|
|
2235
|
-
},
|
|
2143
|
+
}, yr = function(i, t) {
|
|
2236
2144
|
var e = -1;
|
|
2237
|
-
if (
|
|
2145
|
+
if (fr(t)) {
|
|
2238
2146
|
if (t.indexOf)
|
|
2239
2147
|
e = t.indexOf(i);
|
|
2240
2148
|
else
|
|
@@ -2262,7 +2170,7 @@ var _r = function(i, t, e) {
|
|
|
2262
2170
|
r._redraw();
|
|
2263
2171
|
});
|
|
2264
2172
|
var s = e.markers;
|
|
2265
|
-
|
|
2173
|
+
fr(s) && this.addMarkers(s);
|
|
2266
2174
|
}
|
|
2267
2175
|
};
|
|
2268
2176
|
M.prototype.addMarkers = function(i) {
|
|
@@ -2273,7 +2181,7 @@ M.prototype.addMarkers = function(i) {
|
|
|
2273
2181
|
}
|
|
2274
2182
|
};
|
|
2275
2183
|
M.prototype._pushMarkerTo = function(i) {
|
|
2276
|
-
var t =
|
|
2184
|
+
var t = yr(i, this._markers);
|
|
2277
2185
|
t === -1 && (i.isInCluster = !1, this._markers.push(i));
|
|
2278
2186
|
};
|
|
2279
2187
|
M.prototype.addMarker = function(i) {
|
|
@@ -2282,7 +2190,7 @@ M.prototype.addMarker = function(i) {
|
|
|
2282
2190
|
M.prototype._createClusters = function() {
|
|
2283
2191
|
var i = this._map.getBounds();
|
|
2284
2192
|
if (i.getCenter()) {
|
|
2285
|
-
for (var t =
|
|
2193
|
+
for (var t = mr(this._map, i, this._gridSize), e = 0, r; r = this._markers[e]; e++)
|
|
2286
2194
|
!r.isInCluster && t.containsPoint(r.getPosition()) && this._addToClosestCluster(r);
|
|
2287
2195
|
for (var s = this._markers.length, e = 0; e < s; e++)
|
|
2288
2196
|
this._clusters[e] && this._clusters[e].render();
|
|
@@ -2322,7 +2230,7 @@ M.prototype._removeMarkersFromMap = function() {
|
|
|
2322
2230
|
}
|
|
2323
2231
|
};
|
|
2324
2232
|
M.prototype._removeMarker = function(i) {
|
|
2325
|
-
var t =
|
|
2233
|
+
var t = yr(i, this._markers);
|
|
2326
2234
|
return t === -1 ? !1 : (this._map.removeOverlay(i), this._markers.splice(t, 1), !0);
|
|
2327
2235
|
};
|
|
2328
2236
|
M.prototype.removeMarker = function(i) {
|
|
@@ -2398,7 +2306,7 @@ M.prototype.setStylesIndexCalculator = function(i) {
|
|
|
2398
2306
|
};
|
|
2399
2307
|
function N(i) {
|
|
2400
2308
|
var t = this;
|
|
2401
|
-
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
|
|
2309
|
+
this._markerClusterer = i, this._map = i.getMap(), this._minClusterSize = i.getMinClusterSize(), this._isAverageCenter = i.isAverageCenter(), this._center = null, this._markers = [], this._gridBounds = null, this._isReal = !1, this._clusterMarker = new jt(this._center, this._markers.length, {
|
|
2402
2310
|
styles: this._markerClusterer.getStyles(),
|
|
2403
2311
|
zIndex: i._zIndex
|
|
2404
2312
|
}), this._clusterMarker.getStyleByText = function(e, r) {
|
|
@@ -2406,7 +2314,7 @@ function N(i) {
|
|
|
2406
2314
|
var s = t._markerClusterer._stylesIndexCalculator(t._markers, r.length);
|
|
2407
2315
|
return r[s];
|
|
2408
2316
|
}
|
|
2409
|
-
return
|
|
2317
|
+
return jt.prototype.getStyleByText.call(this, e, r);
|
|
2410
2318
|
}, this._clusterMarker.addEventListener && this._clusterMarker.addEventListener("click", function(e) {
|
|
2411
2319
|
t._map.setViewport(t.getBounds());
|
|
2412
2320
|
});
|
|
@@ -2446,7 +2354,7 @@ N.prototype.isReal = function(i) {
|
|
|
2446
2354
|
};
|
|
2447
2355
|
N.prototype.updateGridBounds = function() {
|
|
2448
2356
|
var i = new BMap.Bounds(this._center, this._center);
|
|
2449
|
-
this._gridBounds =
|
|
2357
|
+
this._gridBounds = mr(this._map, i, this._markerClusterer.getGridSize());
|
|
2450
2358
|
};
|
|
2451
2359
|
N.prototype.updateClusterMarker = function() {
|
|
2452
2360
|
if (this._map.getZoom() > this._markerClusterer.getMaxZoom()) {
|
|
@@ -2476,7 +2384,7 @@ N.prototype.getBounds = function() {
|
|
|
2476
2384
|
N.prototype.getCenter = function() {
|
|
2477
2385
|
return this._center;
|
|
2478
2386
|
};
|
|
2479
|
-
var
|
|
2387
|
+
var ze;
|
|
2480
2388
|
((i) => {
|
|
2481
2389
|
function t(r) {
|
|
2482
2390
|
return {
|
|
@@ -2501,8 +2409,8 @@ var De;
|
|
|
2501
2409
|
};
|
|
2502
2410
|
}
|
|
2503
2411
|
i.toGoogle = e;
|
|
2504
|
-
})(
|
|
2505
|
-
class
|
|
2412
|
+
})(ze || (ze = {}));
|
|
2413
|
+
class vr {
|
|
2506
2414
|
constructor(t) {
|
|
2507
2415
|
this.map = t;
|
|
2508
2416
|
}
|
|
@@ -2527,7 +2435,7 @@ class Mr {
|
|
|
2527
2435
|
return this.inner.removeMarkers(t.map((e) => e.innerOverlay));
|
|
2528
2436
|
}
|
|
2529
2437
|
}
|
|
2530
|
-
class
|
|
2438
|
+
class ci extends vr {
|
|
2531
2439
|
constructor(e, r) {
|
|
2532
2440
|
var n;
|
|
2533
2441
|
super(e);
|
|
@@ -2539,50 +2447,50 @@ class wi extends Mr {
|
|
|
2539
2447
|
maxZoom: r.maxZoom,
|
|
2540
2448
|
minClusterSize: r.minClusterSize,
|
|
2541
2449
|
isAverageCenter: r.averageCenter,
|
|
2542
|
-
styles: (n = r.styles) == null ? void 0 : n.map((a) =>
|
|
2450
|
+
styles: (n = r.styles) == null ? void 0 : n.map((a) => ze.toBaidu(a)),
|
|
2543
2451
|
zIndex: r.zIndex
|
|
2544
2452
|
});
|
|
2545
2453
|
const s = r.stylesIndexCalculator;
|
|
2546
|
-
s && this.inner.setStylesIndexCalculator((a,
|
|
2454
|
+
s && this.inner.setStylesIndexCalculator((a, d) => s(a.length, d)), r.markers && this.addMarkers(r.markers);
|
|
2547
2455
|
}
|
|
2548
2456
|
recreate() {
|
|
2549
2457
|
this.inner._redraw();
|
|
2550
2458
|
}
|
|
2551
2459
|
}
|
|
2552
|
-
class
|
|
2460
|
+
class di extends vr {
|
|
2553
2461
|
constructor(e, r) {
|
|
2554
2462
|
var n, a;
|
|
2555
2463
|
super(e);
|
|
2556
2464
|
c(this, "inner");
|
|
2557
|
-
this.inner = new
|
|
2465
|
+
this.inner = new oi(
|
|
2558
2466
|
e.innerMap,
|
|
2559
2467
|
// google的构造器中的markers,不会触发重绘, 第一次绘制通过监听地图的'idle'事件触发, 可以直接设置
|
|
2560
|
-
(n = r.markers) == null ? void 0 : n.map((
|
|
2468
|
+
(n = r.markers) == null ? void 0 : n.map((d) => d.innerOverlay),
|
|
2561
2469
|
{
|
|
2562
2470
|
gridSize: r.gridSize,
|
|
2563
2471
|
maxZoom: r.maxZoom,
|
|
2564
2472
|
minimumClusterSize: r.minClusterSize,
|
|
2565
2473
|
averageCenter: r.averageCenter,
|
|
2566
|
-
styles: (a = r.styles) == null ? void 0 : a.map((
|
|
2474
|
+
styles: (a = r.styles) == null ? void 0 : a.map((d) => ze.toGoogle(d)),
|
|
2567
2475
|
zIndex: r.zIndex
|
|
2568
2476
|
}
|
|
2569
2477
|
);
|
|
2570
2478
|
const s = r.stylesIndexCalculator;
|
|
2571
|
-
s && this.inner.setCalculator((
|
|
2572
|
-
text:
|
|
2479
|
+
s && this.inner.setCalculator((d, o) => ({
|
|
2480
|
+
text: d.length,
|
|
2573
2481
|
// google内部, 取index时, 会`-1`...故我们这里`+1`, 抵消掉它
|
|
2574
|
-
index: s(
|
|
2482
|
+
index: s(d.length, o) + 1
|
|
2575
2483
|
}));
|
|
2576
2484
|
}
|
|
2577
2485
|
recreate() {
|
|
2578
2486
|
this.inner.repaint();
|
|
2579
2487
|
}
|
|
2580
2488
|
}
|
|
2581
|
-
class
|
|
2489
|
+
class _r {
|
|
2582
2490
|
constructor() {
|
|
2583
2491
|
}
|
|
2584
2492
|
}
|
|
2585
|
-
class
|
|
2493
|
+
class ui extends _r {
|
|
2586
2494
|
constructor(e, r) {
|
|
2587
2495
|
super();
|
|
2588
2496
|
c(this, "inner");
|
|
@@ -2591,7 +2499,7 @@ class Li extends Or {
|
|
|
2591
2499
|
search(e, r) {
|
|
2592
2500
|
return this.searchImpl(
|
|
2593
2501
|
e,
|
|
2594
|
-
r instanceof
|
|
2502
|
+
r instanceof v ? r.toGoogle(this.map.coordType) : r ?? this.map.innerMap.getCenter()
|
|
2595
2503
|
);
|
|
2596
2504
|
}
|
|
2597
2505
|
searchInBounds(e, r) {
|
|
@@ -2612,23 +2520,23 @@ class Li extends Or {
|
|
|
2612
2520
|
// 'address_components', // TODO: 2023/04/28 ipcjs 查询请求不支持该字段...
|
|
2613
2521
|
],
|
|
2614
2522
|
locationBias: r
|
|
2615
|
-
}, (a,
|
|
2616
|
-
switch (
|
|
2523
|
+
}, (a, d) => {
|
|
2524
|
+
switch (d) {
|
|
2617
2525
|
case google.maps.places.PlacesServiceStatus.ZERO_RESULTS:
|
|
2618
2526
|
case google.maps.places.PlacesServiceStatus.OK: {
|
|
2619
|
-
const o = (a ?? []).map((l) =>
|
|
2527
|
+
const o = (a ?? []).map((l) => cr(l, this.map));
|
|
2620
2528
|
s(o);
|
|
2621
2529
|
break;
|
|
2622
2530
|
}
|
|
2623
2531
|
default:
|
|
2624
|
-
n(new Error(`status: ${
|
|
2532
|
+
n(new Error(`status: ${d}`));
|
|
2625
2533
|
break;
|
|
2626
2534
|
}
|
|
2627
2535
|
});
|
|
2628
2536
|
});
|
|
2629
2537
|
}
|
|
2630
2538
|
}
|
|
2631
|
-
class
|
|
2539
|
+
class pi extends _r {
|
|
2632
2540
|
constructor(e, r) {
|
|
2633
2541
|
super();
|
|
2634
2542
|
c(this, "searchRequestMap", /* @__PURE__ */ new Map());
|
|
@@ -2640,7 +2548,7 @@ class xi extends Or {
|
|
|
2640
2548
|
}
|
|
2641
2549
|
search(e, r) {
|
|
2642
2550
|
return this.newSearch(
|
|
2643
|
-
r instanceof
|
|
2551
|
+
r instanceof v ? r.toBaidu(this.map.coordType) : r ?? this.map.innerMap.getCenter(),
|
|
2644
2552
|
(s) => {
|
|
2645
2553
|
s.search(e);
|
|
2646
2554
|
}
|
|
@@ -2659,20 +2567,20 @@ class xi extends Or {
|
|
|
2659
2567
|
newSearch(e, r) {
|
|
2660
2568
|
return new Promise((s, n) => {
|
|
2661
2569
|
const a = new BMap.LocalSearch(e ?? this.map.innerMap, {
|
|
2662
|
-
onSearchComplete: (
|
|
2663
|
-
Array.isArray(
|
|
2570
|
+
onSearchComplete: (d) => {
|
|
2571
|
+
Array.isArray(d) && ut("当前只支持一次搜索一条数据");
|
|
2664
2572
|
const o = a.getStatus();
|
|
2665
2573
|
switch (o) {
|
|
2666
2574
|
case BMAP_STATUS_SUCCESS: {
|
|
2667
2575
|
const l = [];
|
|
2668
|
-
for (let
|
|
2669
|
-
const u =
|
|
2576
|
+
for (let h = 0; h < d.getCurrentNumPois(); h++) {
|
|
2577
|
+
const u = d.getPoi(h);
|
|
2670
2578
|
l.push({
|
|
2671
2579
|
id: u.uid,
|
|
2672
2580
|
city: u.city,
|
|
2673
2581
|
country: "",
|
|
2674
2582
|
// 百度地图只支持中国
|
|
2675
|
-
position:
|
|
2583
|
+
position: v.fromBaidu(u.point, this.map.coordType),
|
|
2676
2584
|
province: u.province,
|
|
2677
2585
|
title: u.title,
|
|
2678
2586
|
address: u.address
|
|
@@ -2694,7 +2602,7 @@ class xi extends Or {
|
|
|
2694
2602
|
});
|
|
2695
2603
|
}
|
|
2696
2604
|
}
|
|
2697
|
-
class
|
|
2605
|
+
class br {
|
|
2698
2606
|
constructor(t, e) {
|
|
2699
2607
|
c(this, "onData");
|
|
2700
2608
|
c(this, "onError");
|
|
@@ -2706,26 +2614,26 @@ class Cr {
|
|
|
2706
2614
|
* @mustCallSuper 子类必须调用一次`super.setSearchListener`, 用来保存{@link onData}和{@link onError}
|
|
2707
2615
|
* */
|
|
2708
2616
|
setSearchListener(t, e) {
|
|
2709
|
-
return this.onData && C("setSearchListener只能调用一次"), this.onData = t, this.onError = e,
|
|
2617
|
+
return this.onData && C("setSearchListener只能调用一次"), this.onData = t, this.onError = e, Oe;
|
|
2710
2618
|
}
|
|
2711
2619
|
}
|
|
2712
|
-
class
|
|
2620
|
+
class gi extends br {
|
|
2713
2621
|
constructor(e, r) {
|
|
2714
2622
|
super(e, r.input);
|
|
2715
2623
|
c(this, "searchBox");
|
|
2716
2624
|
this.searchBox = new google.maps.places.SearchBox(r.input), this.searchBox.bindTo("bounds", e.innerMap);
|
|
2717
2625
|
}
|
|
2718
2626
|
setSearchListener(e, r) {
|
|
2719
|
-
return super.setSearchListener(e, r),
|
|
2627
|
+
return super.setSearchListener(e, r), rr(this.searchBox, "places_changed", () => {
|
|
2720
2628
|
const s = this.searchBox.getPlaces();
|
|
2721
|
-
e((s ?? []).map((n) =>
|
|
2629
|
+
e((s ?? []).map((n) => cr(n, this.map)));
|
|
2722
2630
|
});
|
|
2723
2631
|
}
|
|
2724
2632
|
search() {
|
|
2725
2633
|
this.input.value && (google.maps.event.trigger(this.input, "focus", {}), google.maps.event.trigger(this.input, "keydown", { keyCode: 13 }));
|
|
2726
2634
|
}
|
|
2727
2635
|
}
|
|
2728
|
-
class
|
|
2636
|
+
class mi extends br {
|
|
2729
2637
|
constructor(e, r) {
|
|
2730
2638
|
super(e, r.input);
|
|
2731
2639
|
c(this, "autocomplete");
|
|
@@ -2744,7 +2652,7 @@ class ki extends Cr {
|
|
|
2744
2652
|
this.placesService.search(e).then(this.onData, this.onError);
|
|
2745
2653
|
}
|
|
2746
2654
|
}
|
|
2747
|
-
var
|
|
2655
|
+
var fi = /* @__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))(fi || {});
|
|
2748
2656
|
class Tt {
|
|
2749
2657
|
constructor(t) {
|
|
2750
2658
|
c(this, "latestInfoWindow");
|
|
@@ -2792,6 +2700,77 @@ class Tt {
|
|
|
2792
2700
|
this.innerMap.setZoom(t);
|
|
2793
2701
|
}
|
|
2794
2702
|
}
|
|
2703
|
+
var yi = function(t) {
|
|
2704
|
+
return vi(t) && !_i(t);
|
|
2705
|
+
};
|
|
2706
|
+
function vi(i) {
|
|
2707
|
+
return !!i && typeof i == "object";
|
|
2708
|
+
}
|
|
2709
|
+
function _i(i) {
|
|
2710
|
+
var t = Object.prototype.toString.call(i);
|
|
2711
|
+
return t === "[object RegExp]" || t === "[object Date]" || Mi(i);
|
|
2712
|
+
}
|
|
2713
|
+
var bi = typeof Symbol == "function" && Symbol.for, Ti = bi ? Symbol.for("react.element") : 60103;
|
|
2714
|
+
function Mi(i) {
|
|
2715
|
+
return i.$$typeof === Ti;
|
|
2716
|
+
}
|
|
2717
|
+
function Oi(i) {
|
|
2718
|
+
return Array.isArray(i) ? [] : {};
|
|
2719
|
+
}
|
|
2720
|
+
function Ce(i, t) {
|
|
2721
|
+
return t.clone !== !1 && t.isMergeableObject(i) ? de(Oi(i), i, t) : i;
|
|
2722
|
+
}
|
|
2723
|
+
function Ci(i, t, e) {
|
|
2724
|
+
return i.concat(t).map(function(r) {
|
|
2725
|
+
return Ce(r, e);
|
|
2726
|
+
});
|
|
2727
|
+
}
|
|
2728
|
+
function wi(i, t) {
|
|
2729
|
+
if (!t.customMerge)
|
|
2730
|
+
return de;
|
|
2731
|
+
var e = t.customMerge(i);
|
|
2732
|
+
return typeof e == "function" ? e : de;
|
|
2733
|
+
}
|
|
2734
|
+
function Ei(i) {
|
|
2735
|
+
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(i).filter(function(t) {
|
|
2736
|
+
return Object.propertyIsEnumerable.call(i, t);
|
|
2737
|
+
}) : [];
|
|
2738
|
+
}
|
|
2739
|
+
function Vt(i) {
|
|
2740
|
+
return Object.keys(i).concat(Ei(i));
|
|
2741
|
+
}
|
|
2742
|
+
function Tr(i, t) {
|
|
2743
|
+
try {
|
|
2744
|
+
return t in i;
|
|
2745
|
+
} catch {
|
|
2746
|
+
return !1;
|
|
2747
|
+
}
|
|
2748
|
+
}
|
|
2749
|
+
function Li(i, t) {
|
|
2750
|
+
return Tr(i, t) && !(Object.hasOwnProperty.call(i, t) && Object.propertyIsEnumerable.call(i, t));
|
|
2751
|
+
}
|
|
2752
|
+
function xi(i, t, e) {
|
|
2753
|
+
var r = {};
|
|
2754
|
+
return e.isMergeableObject(i) && Vt(i).forEach(function(s) {
|
|
2755
|
+
r[s] = Ce(i[s], e);
|
|
2756
|
+
}), Vt(t).forEach(function(s) {
|
|
2757
|
+
Li(i, s) || (Tr(i, s) && e.isMergeableObject(t[s]) ? r[s] = wi(s, e)(i[s], t[s], e) : r[s] = Ce(t[s], e));
|
|
2758
|
+
}), r;
|
|
2759
|
+
}
|
|
2760
|
+
function de(i, t, e) {
|
|
2761
|
+
e = e || {}, e.arrayMerge = e.arrayMerge || Ci, e.isMergeableObject = e.isMergeableObject || yi, e.cloneUnlessOtherwiseSpecified = Ce;
|
|
2762
|
+
var r = Array.isArray(t), s = Array.isArray(i), n = r === s;
|
|
2763
|
+
return n ? r ? e.arrayMerge(i, t, e) : xi(i, t, e) : Ce(t, e);
|
|
2764
|
+
}
|
|
2765
|
+
de.all = function(t, e) {
|
|
2766
|
+
if (!Array.isArray(t))
|
|
2767
|
+
throw new Error("first argument should be an array");
|
|
2768
|
+
return t.reduce(function(r, s) {
|
|
2769
|
+
return de(r, s, e);
|
|
2770
|
+
}, {});
|
|
2771
|
+
};
|
|
2772
|
+
var Pi = de, ki = Pi;
|
|
2773
|
+
const Mr = /* @__PURE__ */ ct(ki);
|
|
2795
2774
|
/*!
|
|
2796
2775
|
* isobject <https://github.com/jonschlinkert/isobject>
|
|
2797
2776
|
*
|
|
@@ -2810,45 +2789,66 @@ function Ii(i) {
|
|
|
2810
2789
|
function Ft(i) {
|
|
2811
2790
|
return Ii(i) === !0 && Object.prototype.toString.call(i) === "[object Object]";
|
|
2812
2791
|
}
|
|
2813
|
-
function
|
|
2792
|
+
function Or(i) {
|
|
2814
2793
|
var t, e;
|
|
2815
2794
|
return !(Ft(i) === !1 || (t = i.constructor, typeof t != "function") || (e = t.prototype, Ft(e) === !1) || e.hasOwnProperty("isPrototypeOf") === !1);
|
|
2816
2795
|
}
|
|
2817
|
-
var
|
|
2796
|
+
var Q;
|
|
2818
2797
|
((i) => {
|
|
2819
|
-
function t(h,
|
|
2820
|
-
return h.reduce((
|
|
2798
|
+
function t(h, u) {
|
|
2799
|
+
return h.reduce((p, f) => (p[u(f)] = f, p), {});
|
|
2821
2800
|
}
|
|
2822
2801
|
i.fromArray = t;
|
|
2823
2802
|
function e(h) {
|
|
2824
|
-
return h.reduce((
|
|
2803
|
+
return h.reduce((u, p) => (u[p[0]] = p[1], u), {});
|
|
2825
2804
|
}
|
|
2826
2805
|
i.fromEntries = e;
|
|
2827
2806
|
function r(h) {
|
|
2828
|
-
return JSON.stringify(h, (
|
|
2807
|
+
return JSON.stringify(h, (u, p) => typeof p == "object" && Object.getPrototypeOf(p) !== Object.prototype ? p.toString !== Object.prototype.toString ? p.toString() : `[object ${Object.getPrototypeOf(p).constructor.name}]` : p);
|
|
2829
2808
|
}
|
|
2830
2809
|
i.toJsonSafely = r;
|
|
2831
2810
|
function s(h) {
|
|
2832
|
-
|
|
2833
|
-
h[
|
|
2811
|
+
Or(h) && Object.keys(h).forEach((u) => {
|
|
2812
|
+
h[u] === void 0 ? delete h[u] : s(h[u]);
|
|
2834
2813
|
});
|
|
2835
2814
|
}
|
|
2836
2815
|
i.deleteUndefinedPropertyOnPlainObjectDeeply = s;
|
|
2837
|
-
function n(h,
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2816
|
+
function n(h, u, p) {
|
|
2817
|
+
let f = h[u];
|
|
2818
|
+
return f === void 0 && (f = p(), h[u] = f), f;
|
|
2819
|
+
}
|
|
2820
|
+
i.putIfAbsent = n;
|
|
2821
|
+
function a(h, ...u) {
|
|
2822
|
+
const p = Ut(u), f = {};
|
|
2823
|
+
for (const _ in h)
|
|
2824
|
+
p(_) || (f[_] = h[_]);
|
|
2825
|
+
return f;
|
|
2826
|
+
}
|
|
2827
|
+
i.omit = a;
|
|
2828
|
+
function d(h, ...u) {
|
|
2829
|
+
const p = Ut(u), f = {};
|
|
2830
|
+
for (const _ in h)
|
|
2831
|
+
p(_) && (f[_] = h[_]);
|
|
2832
|
+
return f;
|
|
2833
|
+
}
|
|
2834
|
+
i.pick = d;
|
|
2835
|
+
function o(h, u) {
|
|
2836
|
+
const p = typeof u == "string" ? u.split(".") : u;
|
|
2837
|
+
let f = h;
|
|
2838
|
+
for (const _ of p) {
|
|
2839
|
+
if (f == null)
|
|
2840
|
+
return;
|
|
2841
|
+
f = f[_];
|
|
2842
|
+
}
|
|
2843
|
+
return f;
|
|
2844
|
+
}
|
|
2845
|
+
i.get = o;
|
|
2846
|
+
function l(h, u) {
|
|
2847
|
+
const p = typeof u == "string" ? u.split(".") : u, f = o(h, p.slice(0, -1)), _ = p[p.length - 1];
|
|
2848
|
+
f != null && delete f[_];
|
|
2849
|
+
}
|
|
2850
|
+
i.del = l;
|
|
2851
|
+
})(Q || (Q = {}));
|
|
2852
2852
|
function Ut(i) {
|
|
2853
2853
|
if (i.length <= 4)
|
|
2854
2854
|
return i.includes.bind(i);
|
|
@@ -2857,20 +2857,20 @@ function Ut(i) {
|
|
|
2857
2857
|
return t.has.bind(t);
|
|
2858
2858
|
}
|
|
2859
2859
|
}
|
|
2860
|
-
|
|
2861
|
-
const
|
|
2860
|
+
Q.toJsonSafely;
|
|
2861
|
+
const Bi = ["single", "multi"];
|
|
2862
2862
|
var j = /* @__PURE__ */ ((i) => (i.auto = "auto", i.none = "none", i.greedy = "greedy", i.cooperative = "cooperative", i))(j || {}), lt;
|
|
2863
2863
|
((i) => {
|
|
2864
2864
|
function t(e) {
|
|
2865
|
-
|
|
2866
|
-
const r = { center:
|
|
2867
|
-
return
|
|
2868
|
-
isMergeableObject:
|
|
2865
|
+
Q.deleteUndefinedPropertyOnPlainObjectDeeply(e);
|
|
2866
|
+
const r = { center: v.ZERO, zoom: 5 };
|
|
2867
|
+
return Mr(r, e || {}, {
|
|
2868
|
+
isMergeableObject: Or
|
|
2869
2869
|
});
|
|
2870
2870
|
}
|
|
2871
2871
|
i.create = t;
|
|
2872
2872
|
})(lt || (lt = {}));
|
|
2873
|
-
class
|
|
2873
|
+
class Cr {
|
|
2874
2874
|
constructor(t, e) {
|
|
2875
2875
|
c(this, "_delegate");
|
|
2876
2876
|
this.innerOverlay = t, this.coordType = e;
|
|
@@ -2888,12 +2888,12 @@ class Er {
|
|
|
2888
2888
|
this.map.removeOverlay(this);
|
|
2889
2889
|
}
|
|
2890
2890
|
}
|
|
2891
|
-
class Mt extends
|
|
2891
|
+
class Mt extends Cr {
|
|
2892
2892
|
constructor(t, e, r) {
|
|
2893
2893
|
super(t, e), this.map = r;
|
|
2894
2894
|
}
|
|
2895
2895
|
createDelegate() {
|
|
2896
|
-
return new
|
|
2896
|
+
return new ie(this.innerOverlay, this.map);
|
|
2897
2897
|
}
|
|
2898
2898
|
isVisible() {
|
|
2899
2899
|
return this.innerOverlay.getVisible();
|
|
@@ -2902,12 +2902,12 @@ class Mt extends Er {
|
|
|
2902
2902
|
this.innerOverlay.setVisible(t);
|
|
2903
2903
|
}
|
|
2904
2904
|
}
|
|
2905
|
-
class Ye extends
|
|
2905
|
+
class Ye extends Cr {
|
|
2906
2906
|
constructor(t, e, r) {
|
|
2907
2907
|
super(t, e), this.map = r;
|
|
2908
2908
|
}
|
|
2909
2909
|
createDelegate() {
|
|
2910
|
-
return new
|
|
2910
|
+
return new le(this.innerOverlay, this.map);
|
|
2911
2911
|
}
|
|
2912
2912
|
/** 仅限内部使用; 设为private时, 生成的d.ts文件中, 方法返回值会变成any, 故改成了public */
|
|
2913
2913
|
get overlay() {
|
|
@@ -2924,7 +2924,7 @@ class Ye extends Er {
|
|
|
2924
2924
|
return t !== void 0 && (t || this.setVisible(!1)), this;
|
|
2925
2925
|
}
|
|
2926
2926
|
}
|
|
2927
|
-
const
|
|
2927
|
+
const je = class extends Ye {
|
|
2928
2928
|
constructor(t, e, r, s) {
|
|
2929
2929
|
super(t, e, r), this.state = s;
|
|
2930
2930
|
}
|
|
@@ -2938,7 +2938,7 @@ const He = class extends Ye {
|
|
|
2938
2938
|
this.innerOverlay.setStrokeColor(t);
|
|
2939
2939
|
}
|
|
2940
2940
|
setStrokeOpacity(t) {
|
|
2941
|
-
this.innerOverlay.setStrokeOpacity(t +
|
|
2941
|
+
this.innerOverlay.setStrokeOpacity(t + je.OPACITY_DELTA);
|
|
2942
2942
|
}
|
|
2943
2943
|
setStrokeWeight(t) {
|
|
2944
2944
|
this.innerOverlay.setStrokeWeight(t);
|
|
@@ -2947,17 +2947,17 @@ const He = class extends Ye {
|
|
|
2947
2947
|
this.innerOverlay.setFillColor(t);
|
|
2948
2948
|
}
|
|
2949
2949
|
setFillOpacity(t) {
|
|
2950
|
-
this.innerOverlay.setFillOpacity(t +
|
|
2950
|
+
this.innerOverlay.setFillOpacity(t + je.OPACITY_DELTA);
|
|
2951
2951
|
}
|
|
2952
2952
|
};
|
|
2953
|
-
let
|
|
2953
|
+
let B = je;
|
|
2954
2954
|
/**
|
|
2955
2955
|
* baidu地图的透明度属性有如下问题:
|
|
2956
2956
|
* - 在透明度为0时, 无法隐藏掉颜色
|
|
2957
2957
|
* - 透明度为0.7和0.8时, 在maintain的发布模式下, polyline的线条会不可见 (原因未知, 在tg-map中无法复现)
|
|
2958
2958
|
* 故统一加个0.001, 规避这些问题...
|
|
2959
2959
|
*/
|
|
2960
|
-
c(
|
|
2960
|
+
c(B, "OPACITY_DELTA", 1e-3);
|
|
2961
2961
|
class qe extends Mt {
|
|
2962
2962
|
isEditable() {
|
|
2963
2963
|
return this.innerOverlay.getEditable();
|
|
@@ -2981,7 +2981,7 @@ class qe extends Mt {
|
|
|
2981
2981
|
this.innerOverlay.setOptions({ fillOpacity: t });
|
|
2982
2982
|
}
|
|
2983
2983
|
}
|
|
2984
|
-
class Ot extends
|
|
2984
|
+
class Ot extends B {
|
|
2985
2985
|
constructor() {
|
|
2986
2986
|
super(...arguments);
|
|
2987
2987
|
c(this, "prevCenter");
|
|
@@ -3008,10 +3008,10 @@ class Ot extends I {
|
|
|
3008
3008
|
enableEditing: !1,
|
|
3009
3009
|
// options.editable,
|
|
3010
3010
|
strokeColor: e.strokeColor,
|
|
3011
|
-
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity +
|
|
3011
|
+
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity + B.OPACITY_DELTA : void 0,
|
|
3012
3012
|
strokeWeight: e.strokeWeight,
|
|
3013
3013
|
fillColor: e.fillColor,
|
|
3014
|
-
fillOpacity: e.fillOpacity != null ? e.fillOpacity +
|
|
3014
|
+
fillOpacity: e.fillOpacity != null ? e.fillOpacity + B.OPACITY_DELTA : void 0
|
|
3015
3015
|
}), n = new Ot(s, r, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
3016
3016
|
return n.state.editable && setTimeout(() => {
|
|
3017
3017
|
n.state.editable && s.enableEditing();
|
|
@@ -3034,7 +3034,7 @@ class Ot extends I {
|
|
|
3034
3034
|
}, 0));
|
|
3035
3035
|
}
|
|
3036
3036
|
getCenter() {
|
|
3037
|
-
return
|
|
3037
|
+
return v.fromBaidu(this.innerOverlay.getCenter(), this.coordType);
|
|
3038
3038
|
}
|
|
3039
3039
|
setRadius(e) {
|
|
3040
3040
|
this.isDoingSetRadius = !0, this.innerOverlay.setRadius(e), this.isDoingSetRadius = !1;
|
|
@@ -3063,7 +3063,7 @@ class Ct extends qe {
|
|
|
3063
3063
|
this.coordType = this.map.coordType, this.innerOverlay.setCenter(t.toGoogle(this.coordType));
|
|
3064
3064
|
}
|
|
3065
3065
|
getCenter() {
|
|
3066
|
-
return
|
|
3066
|
+
return v.fromGoogle(this.innerOverlay.getCenter() ?? J.LATLNG_ZERO, this.coordType);
|
|
3067
3067
|
}
|
|
3068
3068
|
setRadius(t) {
|
|
3069
3069
|
this.innerOverlay.setRadius(t);
|
|
@@ -3072,7 +3072,7 @@ class Ct extends qe {
|
|
|
3072
3072
|
return this.innerOverlay.getRadius();
|
|
3073
3073
|
}
|
|
3074
3074
|
}
|
|
3075
|
-
function
|
|
3075
|
+
function wr() {
|
|
3076
3076
|
BMap.OverlayV3 || (BMap.OverlayV3 = BMap.Overlay);
|
|
3077
3077
|
}
|
|
3078
3078
|
const Yt = {
|
|
@@ -3086,14 +3086,14 @@ var X;
|
|
|
3086
3086
|
i.ZERO = { x: 0, y: 0 };
|
|
3087
3087
|
})(X || (X = {}));
|
|
3088
3088
|
let tt;
|
|
3089
|
-
function
|
|
3090
|
-
return tt || (tt =
|
|
3089
|
+
function Si(i, t, e, r, s, n) {
|
|
3090
|
+
return tt || (tt = Ai()), new tt(i, t, e, r, s, n);
|
|
3091
3091
|
}
|
|
3092
|
-
function
|
|
3093
|
-
|
|
3092
|
+
function Ai() {
|
|
3093
|
+
wr();
|
|
3094
3094
|
const i = new BMap.Point(0, 0);
|
|
3095
3095
|
return class extends BMap.OverlayV3 {
|
|
3096
|
-
constructor(r, s = i, n = X.ZERO, a,
|
|
3096
|
+
constructor(r, s = i, n = X.ZERO, a, d = 654, o = "") {
|
|
3097
3097
|
super();
|
|
3098
3098
|
// 类表达式不能有私有成员, 故改成public
|
|
3099
3099
|
c(this, "container");
|
|
@@ -3104,10 +3104,10 @@ function Ri() {
|
|
|
3104
3104
|
this.content = r, this.position = s, this.offset = n;
|
|
3105
3105
|
const l = "baidu-info-box-container";
|
|
3106
3106
|
this.container = document.createElement("div"), this.container.className = l, this.container.style.position = "absolute", this.border = document.createElement("div"), this.border.className = `${l}__border ${o}`, this.inner = document.createElement("div"), this.inner.className = l + "__inner";
|
|
3107
|
-
const
|
|
3108
|
-
|
|
3107
|
+
const h = document.createElement("img");
|
|
3108
|
+
h.className = l + "__close", h.src = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22%23000000%22%3E%0A%20%20%20%20%3Cpath%20d%3D%22M19%206.41L17.59%205%2012%2010.59%206.41%205%205%206.41%2010.59%2012%205%2017.59%206.41%2019%2012%2013.41%2017.59%2019%2019%2017.59%2013.41%2012z%22%2F%3E%0A%20%20%20%20%3Cpath%20d%3D%22M0%200h24v24H0z%22%20fill%3D%22none%22%2F%3E%0A%3C%2Fsvg%3E%0A", h.addEventListener("click", () => {
|
|
3109
3109
|
this.close(), this.dispatchEvent({ type: "onclickclose" });
|
|
3110
|
-
}), this.inner.appendChild(r), this.border.appendChild(this.inner), this.border.appendChild(
|
|
3110
|
+
}), this.inner.appendChild(r), this.border.appendChild(this.inner), this.border.appendChild(h), this.container.appendChild(this.border), a && this.setZIndex(a), this.setMaxWidth(d), this.onMarkerPositionChanged = this.onMarkerPositionChanged.bind(this);
|
|
3111
3111
|
}
|
|
3112
3112
|
initialize(r) {
|
|
3113
3113
|
return this.map = r, r.getPanes().floatPane.appendChild(this.container), this.container;
|
|
@@ -3169,10 +3169,10 @@ class wt {
|
|
|
3169
3169
|
}
|
|
3170
3170
|
class Et extends wt {
|
|
3171
3171
|
constructor(t, e, r) {
|
|
3172
|
-
super(new
|
|
3172
|
+
super(new le(t, e)), this.inner = t, this.map = e, this.state = r;
|
|
3173
3173
|
}
|
|
3174
3174
|
static create(t) {
|
|
3175
|
-
const e = t.position ||
|
|
3175
|
+
const e = t.position || v.ZERO, r = new BMap.InfoWindow(t.content, {
|
|
3176
3176
|
maxWidth: t.maxWidth,
|
|
3177
3177
|
offset: t.offset && new BMap.Size(t.offset.x, t.offset.y),
|
|
3178
3178
|
enableAutoPan: !t.disableAutoPan
|
|
@@ -3183,14 +3183,14 @@ class Et extends wt {
|
|
|
3183
3183
|
return this.inner.isOpen();
|
|
3184
3184
|
}
|
|
3185
3185
|
open(t) {
|
|
3186
|
-
t ? t.innerOverlay.openInfoWindow(this.inner) : this.map.innerMap.openInfoWindow(this.inner, (this.state.position ||
|
|
3186
|
+
t ? t.innerOverlay.openInfoWindow(this.inner) : this.map.innerMap.openInfoWindow(this.inner, (this.state.position || v.ZERO).toBaidu(this.map.coordType)), this.map.setLatestInfoWindowInternal(this);
|
|
3187
3187
|
}
|
|
3188
3188
|
close() {
|
|
3189
3189
|
this.inner.isOpen() && this.map.innerMap.closeInfoWindow();
|
|
3190
3190
|
}
|
|
3191
3191
|
getPosition() {
|
|
3192
3192
|
const t = this.inner.getPosition();
|
|
3193
|
-
return t &&
|
|
3193
|
+
return t && v.fromBaidu(t, this.map.coordType) || this.state.position || v.ZERO;
|
|
3194
3194
|
}
|
|
3195
3195
|
setPosition(t) {
|
|
3196
3196
|
this.state.position = t, this.inner.isOpen() && this.open();
|
|
@@ -3198,8 +3198,8 @@ class Et extends wt {
|
|
|
3198
3198
|
}
|
|
3199
3199
|
class Lt extends wt {
|
|
3200
3200
|
constructor(e, r) {
|
|
3201
|
-
super(new
|
|
3202
|
-
c(this, "eventHub", new
|
|
3201
|
+
super(new ie(e, r));
|
|
3202
|
+
c(this, "eventHub", new sr());
|
|
3203
3203
|
c(this, "isOpened", !1);
|
|
3204
3204
|
this.inner = e, this.map = r, e.addListener("closeclick", () => {
|
|
3205
3205
|
this.isOpened = !1, this.eventHub.hasListener("close") && this.eventHub.notify({ type: "close", target: this });
|
|
@@ -3209,7 +3209,7 @@ class Lt extends wt {
|
|
|
3209
3209
|
});
|
|
3210
3210
|
}
|
|
3211
3211
|
static create(e) {
|
|
3212
|
-
const r = e.position ||
|
|
3212
|
+
const r = e.position || v.ZERO, s = new google.maps.InfoWindow({
|
|
3213
3213
|
content: e.content,
|
|
3214
3214
|
maxWidth: e.maxWidth,
|
|
3215
3215
|
pixelOffset: e.offset && new google.maps.Size(e.offset.x, e.offset.y),
|
|
@@ -3248,7 +3248,7 @@ class Lt extends wt {
|
|
|
3248
3248
|
this.isOpened && (this.isOpened = !1, this.inner.close(), this.eventHub.notify({ type: "close", target: this }));
|
|
3249
3249
|
}
|
|
3250
3250
|
getPosition() {
|
|
3251
|
-
return
|
|
3251
|
+
return v.fromGoogle(this.inner.getPosition() ?? J.LATLNG_ZERO, this.map.coordType);
|
|
3252
3252
|
}
|
|
3253
3253
|
setPosition(e) {
|
|
3254
3254
|
this.inner.setPosition(e.toGoogle(this.map.coordType));
|
|
@@ -3260,7 +3260,7 @@ class xt extends Ye {
|
|
|
3260
3260
|
}
|
|
3261
3261
|
static create(t) {
|
|
3262
3262
|
var s;
|
|
3263
|
-
const e = this.coordType, r =
|
|
3263
|
+
const e = this.coordType, r = Si(
|
|
3264
3264
|
t.content,
|
|
3265
3265
|
(s = t.position) == null ? void 0 : s.toBaidu(e),
|
|
3266
3266
|
t.offset,
|
|
@@ -3277,7 +3277,7 @@ class xt extends Ye {
|
|
|
3277
3277
|
this.innerOverlay.close();
|
|
3278
3278
|
}
|
|
3279
3279
|
getPosition() {
|
|
3280
|
-
return
|
|
3280
|
+
return v.fromBaidu(this.innerOverlay.getPosition(), this.coordType);
|
|
3281
3281
|
}
|
|
3282
3282
|
setPosition(t) {
|
|
3283
3283
|
this.coordType = this.map.coordType, this.innerOverlay.setPosition(t.toBaidu(this.coordType));
|
|
@@ -3291,7 +3291,7 @@ class xt extends Ye {
|
|
|
3291
3291
|
}
|
|
3292
3292
|
class Pt extends wt {
|
|
3293
3293
|
constructor(t, e, r) {
|
|
3294
|
-
super(new
|
|
3294
|
+
super(new ie(t, r)), this.inner = t, this.coordType = e, this.map = r;
|
|
3295
3295
|
}
|
|
3296
3296
|
static create(t) {
|
|
3297
3297
|
var n;
|
|
@@ -3303,8 +3303,8 @@ class Pt extends wt {
|
|
|
3303
3303
|
maxWidth: t.maxWidth
|
|
3304
3304
|
}), s = t.borderClass;
|
|
3305
3305
|
return s && r.addListener("domready", () => {
|
|
3306
|
-
var
|
|
3307
|
-
const a = (
|
|
3306
|
+
var d;
|
|
3307
|
+
const a = (d = t.content.parentElement) == null ? void 0 : d.parentElement;
|
|
3308
3308
|
a && a.className.includes("gm-style-iw-c") && !a.className.includes(s) && (a.className += ` ${s}`);
|
|
3309
3309
|
}), new Pt(r, e, this);
|
|
3310
3310
|
}
|
|
@@ -3315,7 +3315,7 @@ class Pt extends wt {
|
|
|
3315
3315
|
this.inner.close();
|
|
3316
3316
|
}
|
|
3317
3317
|
getPosition() {
|
|
3318
|
-
return
|
|
3318
|
+
return v.fromGoogle(this.inner.getPosition() ?? J.LATLNG_ZERO, this.coordType);
|
|
3319
3319
|
}
|
|
3320
3320
|
setPosition(t) {
|
|
3321
3321
|
this.coordType = this.map.coordType, this.inner.setPosition(t.toGoogle(this.coordType));
|
|
@@ -3334,7 +3334,7 @@ class Pt extends wt {
|
|
|
3334
3334
|
this.inner.setZIndex(t);
|
|
3335
3335
|
}
|
|
3336
3336
|
}
|
|
3337
|
-
var
|
|
3337
|
+
var ue;
|
|
3338
3338
|
((i) => {
|
|
3339
3339
|
function t(n, a) {
|
|
3340
3340
|
if (n !== void 0)
|
|
@@ -3348,15 +3348,15 @@ var de;
|
|
|
3348
3348
|
}
|
|
3349
3349
|
i.trimIndent = e;
|
|
3350
3350
|
function r(n) {
|
|
3351
|
-
return n.replace(/([^A-Z]?)([A-Z])/g, (a,
|
|
3351
|
+
return n.replace(/([^A-Z]?)([A-Z])/g, (a, d, o) => d ? `${d}-${o.toLowerCase()}` : o.toLowerCase());
|
|
3352
3352
|
}
|
|
3353
3353
|
i.pascal2kebab = r;
|
|
3354
3354
|
function s(n) {
|
|
3355
3355
|
return /^-?\d+$/.test(n);
|
|
3356
3356
|
}
|
|
3357
3357
|
i.isInt = s;
|
|
3358
|
-
})(
|
|
3359
|
-
const
|
|
3358
|
+
})(ue || (ue = {}));
|
|
3359
|
+
const Ri = {
|
|
3360
3360
|
/** @see https://nodejs.org/docs/v10.3.0/api/path.html#path_path_basename_path_ext */
|
|
3361
3361
|
basename(i, t) {
|
|
3362
3362
|
const e = i.endsWith("/") ? i.slice(0, -1) : i, r = e.lastIndexOf("/"), s = r >= 0 ? e.substring(r + 1) : e;
|
|
@@ -3396,7 +3396,7 @@ var we = /* @__PURE__ */ ((i) => (i.map = "map", i.overlay = "overlay", i.overla
|
|
|
3396
3396
|
}
|
|
3397
3397
|
i.toBaidu = e;
|
|
3398
3398
|
})(Ee || (Ee = {}));
|
|
3399
|
-
class
|
|
3399
|
+
class $i {
|
|
3400
3400
|
constructor(t, e) {
|
|
3401
3401
|
c(this, "baidu");
|
|
3402
3402
|
c(this, "google");
|
|
@@ -3417,12 +3417,12 @@ class zi {
|
|
|
3417
3417
|
asBaidu() {
|
|
3418
3418
|
if (!this.baidu) {
|
|
3419
3419
|
const t = this;
|
|
3420
|
-
|
|
3420
|
+
wr();
|
|
3421
3421
|
class e extends BMap.OverlayV3 {
|
|
3422
3422
|
initialize(n) {
|
|
3423
3423
|
var o;
|
|
3424
|
-
const a = t.create(),
|
|
3425
|
-
return (o = Ee.toBaidu(t.mapPane,
|
|
3424
|
+
const a = t.create(), d = n.getPanes();
|
|
3425
|
+
return (o = Ee.toBaidu(t.mapPane, d)) == null || o.appendChild(a), a;
|
|
3426
3426
|
}
|
|
3427
3427
|
draw() {
|
|
3428
3428
|
t.draw();
|
|
@@ -3435,7 +3435,7 @@ class zi {
|
|
|
3435
3435
|
return r.pointToOverlayPixel(s.toBaidu(t.map.coordType));
|
|
3436
3436
|
},
|
|
3437
3437
|
fromOverlayPointToLatLng(s) {
|
|
3438
|
-
return
|
|
3438
|
+
return v.fromBaidu(r.overlayPixelToPoint(new BMap.Pixel(s.x, s.y)), t.map.coordType);
|
|
3439
3439
|
}
|
|
3440
3440
|
};
|
|
3441
3441
|
}
|
|
@@ -3462,7 +3462,7 @@ class zi {
|
|
|
3462
3462
|
return t.google.getProjection().fromLatLngToDivPixel(r.toGoogle(t.map.coordType)) ?? X.ZERO;
|
|
3463
3463
|
},
|
|
3464
3464
|
fromOverlayPointToLatLng(r) {
|
|
3465
|
-
return
|
|
3465
|
+
return v.fromGoogle(t.google.getProjection().fromDivPixelToLatLng(new google.maps.Point(r.x, r.y)) ?? J.LATLNG_ZERO, t.map.coordType);
|
|
3466
3466
|
}
|
|
3467
3467
|
};
|
|
3468
3468
|
}
|
|
@@ -3470,10 +3470,10 @@ class zi {
|
|
|
3470
3470
|
}
|
|
3471
3471
|
}
|
|
3472
3472
|
let rt;
|
|
3473
|
-
function
|
|
3474
|
-
return rt || (rt =
|
|
3473
|
+
function zi(i, t, e, r, s) {
|
|
3474
|
+
return rt || (rt = Di()), new rt(i, t, e, r, s);
|
|
3475
3475
|
}
|
|
3476
|
-
function
|
|
3476
|
+
function Di() {
|
|
3477
3477
|
return class extends google.maps.OverlayView {
|
|
3478
3478
|
constructor(e, r, s, n = we.overlayMouseTarget, a) {
|
|
3479
3479
|
super();
|
|
@@ -3527,7 +3527,7 @@ function Ni() {
|
|
|
3527
3527
|
}
|
|
3528
3528
|
};
|
|
3529
3529
|
}
|
|
3530
|
-
var
|
|
3530
|
+
var pe;
|
|
3531
3531
|
((i) => {
|
|
3532
3532
|
function t(r) {
|
|
3533
3533
|
return typeof r == "string" ? r : r.outerHTML;
|
|
@@ -3541,7 +3541,7 @@ var ue;
|
|
|
3541
3541
|
return r;
|
|
3542
3542
|
}
|
|
3543
3543
|
i.toElement = e;
|
|
3544
|
-
})(
|
|
3544
|
+
})(pe || (pe = {}));
|
|
3545
3545
|
class kt extends Ye {
|
|
3546
3546
|
constructor(e, r, s, n) {
|
|
3547
3547
|
super(e, r, s);
|
|
@@ -3553,7 +3553,7 @@ class kt extends Ye {
|
|
|
3553
3553
|
}
|
|
3554
3554
|
static create(e) {
|
|
3555
3555
|
var a;
|
|
3556
|
-
const r = this.coordType, s = new BMap.Label(
|
|
3556
|
+
const r = this.coordType, s = new BMap.Label(pe.toString(e.content), {
|
|
3557
3557
|
position: (a = e.position) == null ? void 0 : a.toBaidu(r),
|
|
3558
3558
|
offset: e.offset && new BMap.Size(e.offset.x, e.offset.y)
|
|
3559
3559
|
});
|
|
@@ -3573,13 +3573,13 @@ class kt extends Ye {
|
|
|
3573
3573
|
characterData: !0,
|
|
3574
3574
|
childList: !0,
|
|
3575
3575
|
subtree: !0
|
|
3576
|
-
})), r || this.innerOverlay.setContent(
|
|
3576
|
+
})), r || this.innerOverlay.setContent(pe.toString(e)), this.content = e);
|
|
3577
3577
|
}
|
|
3578
3578
|
setZIndex(e) {
|
|
3579
3579
|
this.innerOverlay.setZIndex(e);
|
|
3580
3580
|
}
|
|
3581
3581
|
getPosition() {
|
|
3582
|
-
return
|
|
3582
|
+
return v.fromBaidu(this.innerOverlay.getPosition(), this.coordType);
|
|
3583
3583
|
}
|
|
3584
3584
|
setPosition(e) {
|
|
3585
3585
|
this.coordType = this.map.coordType, this.innerOverlay.setPosition(e.toBaidu(this.coordType));
|
|
@@ -3601,7 +3601,7 @@ class kt extends Ye {
|
|
|
3601
3601
|
* @description baidu中Label默认左上角对齐Icon的左上, 我们要将其转换为对齐marker的position
|
|
3602
3602
|
* */
|
|
3603
3603
|
attachIcon(e) {
|
|
3604
|
-
var
|
|
3604
|
+
var d;
|
|
3605
3605
|
let r;
|
|
3606
3606
|
if (e instanceof BMap.Icon)
|
|
3607
3607
|
r = e.anchor;
|
|
@@ -3609,29 +3609,29 @@ class kt extends Ye {
|
|
|
3609
3609
|
if (e.anchor)
|
|
3610
3610
|
r = e.anchor;
|
|
3611
3611
|
else {
|
|
3612
|
-
const o = ((
|
|
3612
|
+
const o = ((d = e.__icon__) == null ? void 0 : d.baiduLabelOffset) ?? { x: 0, y: 0 };
|
|
3613
3613
|
r = {
|
|
3614
3614
|
width: e.style.anchor.width + o.x,
|
|
3615
3615
|
height: e.style.anchor.height + o.y
|
|
3616
3616
|
}, process.env.NODE_ENV !== "production" && setTimeout(() => {
|
|
3617
3617
|
var u, p;
|
|
3618
|
-
if (
|
|
3618
|
+
if (ae(e.__icon__, `${e}必须是由'SymbolIcon.toBaidu()'创建的`), !e.anchor) {
|
|
3619
3619
|
console.log("BaiduLabelOverlay.attachIcon", "Bmap.Symbol.anchor尚未计算完成");
|
|
3620
3620
|
return;
|
|
3621
3621
|
}
|
|
3622
|
-
const l = e.anchor.width - e.style.anchor.width,
|
|
3623
|
-
if (o.x !== l || o.y !==
|
|
3624
|
-
const
|
|
3622
|
+
const l = e.anchor.width - e.style.anchor.width, h = e.anchor.height - e.style.anchor.height;
|
|
3623
|
+
if (o.x !== l || o.y !== h) {
|
|
3624
|
+
const f = [
|
|
3625
3625
|
(u = e.__icon__.anchor) == null ? void 0 : u.x,
|
|
3626
3626
|
(p = e.__icon__.anchor) == null ? void 0 : p.y,
|
|
3627
3627
|
e.__icon__.rotation,
|
|
3628
3628
|
e.__icon__.scale,
|
|
3629
3629
|
e.__icon__.strokeWeight
|
|
3630
3630
|
].map((_) => _ ?? "").join(",");
|
|
3631
|
-
console.warn("BaiduLabelOverlay.attachIcon", e.__icon__,
|
|
3631
|
+
console.warn("BaiduLabelOverlay.attachIcon", e.__icon__, ue.trimIndent(
|
|
3632
3632
|
`
|
|
3633
|
-
为了保证Label的位置正确, 请将SymbolIcon(${
|
|
3634
|
-
${JSON.stringify({ x: l, y:
|
|
3633
|
+
为了保证Label的位置正确, 请将SymbolIcon(${f})中baiduLabelOffset的值改写成:
|
|
3634
|
+
${JSON.stringify({ x: l, y: h })}
|
|
3635
3635
|
`
|
|
3636
3636
|
));
|
|
3637
3637
|
}
|
|
@@ -3642,27 +3642,27 @@ class kt extends Ye {
|
|
|
3642
3642
|
this.iconAnchor && (n -= this.iconAnchor.width, a -= this.iconAnchor.height), r && (n += r.width, a += r.height), this.innerOverlay.setOffset(new BMap.Size(n, a)), this.icon = e, this.iconAnchor = r;
|
|
3643
3643
|
}
|
|
3644
3644
|
}
|
|
3645
|
-
class
|
|
3645
|
+
class It extends Mt {
|
|
3646
3646
|
static create(t) {
|
|
3647
3647
|
var s;
|
|
3648
|
-
const e = this.coordType, r =
|
|
3649
|
-
|
|
3648
|
+
const e = this.coordType, r = zi(
|
|
3649
|
+
pe.toElement(t.content),
|
|
3650
3650
|
(s = t.position) == null ? void 0 : s.toGoogle(e),
|
|
3651
3651
|
t.offset,
|
|
3652
3652
|
t.mapPane,
|
|
3653
3653
|
t.zIndex
|
|
3654
3654
|
);
|
|
3655
|
-
return new
|
|
3655
|
+
return new It(r, e, this);
|
|
3656
3656
|
}
|
|
3657
3657
|
setZIndex(t) {
|
|
3658
3658
|
this.innerOverlay.setZIndex(t);
|
|
3659
3659
|
}
|
|
3660
3660
|
setContent(t) {
|
|
3661
|
-
this.innerOverlay.setElement(
|
|
3661
|
+
this.innerOverlay.setElement(pe.toElement(t));
|
|
3662
3662
|
}
|
|
3663
3663
|
getPosition() {
|
|
3664
3664
|
const t = this.innerOverlay.getPosition();
|
|
3665
|
-
return t ?
|
|
3665
|
+
return t ? v.fromGoogle(t, this.coordType) : v.ZERO;
|
|
3666
3666
|
}
|
|
3667
3667
|
setPosition(t) {
|
|
3668
3668
|
this.coordType = this.map.coordType, this.innerOverlay.setPosition(t.toGoogle(this.coordType));
|
|
@@ -3674,11 +3674,11 @@ class Bt extends Mt {
|
|
|
3674
3674
|
this.innerOverlay.setOffset(t);
|
|
3675
3675
|
}
|
|
3676
3676
|
}
|
|
3677
|
-
const
|
|
3678
|
-
toGoogle: (i) => "url" in i ?
|
|
3679
|
-
toBaidu: (i) => "url" in i ?
|
|
3677
|
+
const De = {
|
|
3678
|
+
toGoogle: (i) => "url" in i ? Ne.toGoogle(i) : ge.toGoogle(i),
|
|
3679
|
+
toBaidu: (i) => "url" in i ? Ne.toBaidu(i) : ge.toBaidu(i)
|
|
3680
3680
|
};
|
|
3681
|
-
var
|
|
3681
|
+
var Ne;
|
|
3682
3682
|
((i) => {
|
|
3683
3683
|
function t(r) {
|
|
3684
3684
|
return {
|
|
@@ -3702,8 +3702,8 @@ var Ge;
|
|
|
3702
3702
|
});
|
|
3703
3703
|
}
|
|
3704
3704
|
i.toBaidu = e;
|
|
3705
|
-
})(
|
|
3706
|
-
var
|
|
3705
|
+
})(Ne || (Ne = {}));
|
|
3706
|
+
var ge;
|
|
3707
3707
|
((i) => {
|
|
3708
3708
|
function t(r) {
|
|
3709
3709
|
return {
|
|
@@ -3734,19 +3734,19 @@ var pe;
|
|
|
3734
3734
|
return s.__icon__ = r, s;
|
|
3735
3735
|
}
|
|
3736
3736
|
i.toBaidu = e;
|
|
3737
|
-
})(
|
|
3738
|
-
const
|
|
3737
|
+
})(ge || (ge = {}));
|
|
3738
|
+
const Xs = {
|
|
3739
3739
|
CIRCLE: { baidu: () => BMap_Symbol_SHAPE_CIRCLE, google: () => google.maps.SymbolPath.CIRCLE },
|
|
3740
3740
|
BACKWARD_CLOSED_ARROW: { baidu: () => BMap_Symbol_SHAPE_BACKWARD_CLOSED_ARROW, google: () => google.maps.SymbolPath.BACKWARD_CLOSED_ARROW },
|
|
3741
3741
|
BACKWARD_OPEN_ARROW: { baidu: () => BMap_Symbol_SHAPE_BACKWARD_OPEN_ARROW, google: () => google.maps.SymbolPath.BACKWARD_OPEN_ARROW },
|
|
3742
3742
|
FORWARD_CLOSED_ARROW: { baidu: () => BMap_Symbol_SHAPE_FORWARD_CLOSED_ARROW, google: () => google.maps.SymbolPath.FORWARD_CLOSED_ARROW },
|
|
3743
3743
|
FORWARD_OPEN_ARROW: { baidu: () => BMap_Symbol_SHAPE_FORWARD_OPEN_ARROW, google: () => google.maps.SymbolPath.FORWARD_OPEN_ARROW }
|
|
3744
3744
|
};
|
|
3745
|
-
var
|
|
3745
|
+
var Ge;
|
|
3746
3746
|
((i) => {
|
|
3747
3747
|
function t(r) {
|
|
3748
3748
|
return {
|
|
3749
|
-
icon:
|
|
3749
|
+
icon: ge.toGoogle(r.icon),
|
|
3750
3750
|
offset: r.offset,
|
|
3751
3751
|
repeat: r.repeat,
|
|
3752
3752
|
fixedRotation: r.fixedRotation
|
|
@@ -3755,14 +3755,14 @@ var Ze;
|
|
|
3755
3755
|
i.toGoogle = t;
|
|
3756
3756
|
function e(r) {
|
|
3757
3757
|
return new BMap.IconSequence(
|
|
3758
|
-
|
|
3758
|
+
ge.toBaidu(r.icon),
|
|
3759
3759
|
r.offset,
|
|
3760
3760
|
r.repeat ?? "",
|
|
3761
3761
|
r.fixedRotation
|
|
3762
3762
|
);
|
|
3763
3763
|
}
|
|
3764
3764
|
i.toBaidu = e;
|
|
3765
|
-
})(
|
|
3765
|
+
})(Ge || (Ge = {}));
|
|
3766
3766
|
class Le extends Ye {
|
|
3767
3767
|
constructor(t, e, r, s) {
|
|
3768
3768
|
super(t, e, r), this.state = s;
|
|
@@ -3770,7 +3770,7 @@ class Le extends Ye {
|
|
|
3770
3770
|
static create(t) {
|
|
3771
3771
|
const e = this.coordType, r = t.icon, s = {
|
|
3772
3772
|
title: t.title,
|
|
3773
|
-
icon: r &&
|
|
3773
|
+
icon: r && De.toBaidu(r),
|
|
3774
3774
|
enableClicking: t.clickable,
|
|
3775
3775
|
enableDragging: t.draggable,
|
|
3776
3776
|
// baidu的raiseOnDrag属性, 默认为false, 而我们的options.crossOnDrag默认为true, 故这里需要转换下
|
|
@@ -3778,11 +3778,11 @@ class Le extends Ye {
|
|
|
3778
3778
|
draggingCursor: t.cursor
|
|
3779
3779
|
}, n = new BMap.Marker(t.position.toBaidu(e, t.normalizePositionForBaidu), s);
|
|
3780
3780
|
n.__create_by_tg__ = !0, t.zIndex !== void 0 && n.setZIndex(t.zIndex);
|
|
3781
|
-
const a = t.clickable === void 0 ? !0 : t.clickable,
|
|
3782
|
-
return new Le(n, e, this, { clickable: a, draggable:
|
|
3781
|
+
const a = t.clickable === void 0 ? !0 : t.clickable, d = !!t.draggable;
|
|
3782
|
+
return new Le(n, e, this, { clickable: a, draggable: d, zIndex: t.zIndex, normalize: t.normalizePositionForBaidu }).visibleOptionInternal(t.visible);
|
|
3783
3783
|
}
|
|
3784
3784
|
getPosition() {
|
|
3785
|
-
return
|
|
3785
|
+
return v.fromBaidu(this.innerOverlay.getPosition(), this.coordType);
|
|
3786
3786
|
}
|
|
3787
3787
|
setPosition(t) {
|
|
3788
3788
|
var e;
|
|
@@ -3795,7 +3795,7 @@ class Le extends Ye {
|
|
|
3795
3795
|
return this.innerOverlay.getTitle();
|
|
3796
3796
|
}
|
|
3797
3797
|
setIcon(t) {
|
|
3798
|
-
const e =
|
|
3798
|
+
const e = De.toBaidu(t);
|
|
3799
3799
|
this.innerOverlay.setIcon(e);
|
|
3800
3800
|
const r = this.getLabel();
|
|
3801
3801
|
r && r.attachIcon(e);
|
|
@@ -3830,7 +3830,7 @@ class Le extends Ye {
|
|
|
3830
3830
|
return (t = this.innerOverlay.getLabel()) == null ? void 0 : t.__label__;
|
|
3831
3831
|
}
|
|
3832
3832
|
}
|
|
3833
|
-
class
|
|
3833
|
+
class Bt extends Mt {
|
|
3834
3834
|
constructor() {
|
|
3835
3835
|
super(...arguments);
|
|
3836
3836
|
c(this, "label");
|
|
@@ -3844,7 +3844,7 @@ class It extends Mt {
|
|
|
3844
3844
|
title: e.title,
|
|
3845
3845
|
zIndex: e.zIndex,
|
|
3846
3846
|
visible: e.visible,
|
|
3847
|
-
icon: s &&
|
|
3847
|
+
icon: s && De.toGoogle(s),
|
|
3848
3848
|
clickable: e.clickable,
|
|
3849
3849
|
draggable: e.draggable,
|
|
3850
3850
|
// google的crossOnDrag和我们的crossOnDrag是匹配的, 不需要转换
|
|
@@ -3853,10 +3853,10 @@ class It extends Mt {
|
|
|
3853
3853
|
// InfoWindow相对marker的position的偏移量, 若不指定, 则偏移到marker的icon的上部中央
|
|
3854
3854
|
anchorPoint: new google.maps.Point(0, 0)
|
|
3855
3855
|
};
|
|
3856
|
-
return new
|
|
3856
|
+
return new Bt(new google.maps.Marker(n), r, this);
|
|
3857
3857
|
}
|
|
3858
3858
|
getPosition() {
|
|
3859
|
-
return
|
|
3859
|
+
return v.fromGoogle(this.innerOverlay.getPosition(), this.coordType);
|
|
3860
3860
|
}
|
|
3861
3861
|
setPosition(e) {
|
|
3862
3862
|
this.coordType = this.map.coordType, this.innerOverlay.setPosition(e.toGoogle(this.coordType));
|
|
@@ -3868,7 +3868,7 @@ class It extends Mt {
|
|
|
3868
3868
|
return this.innerOverlay.getTitle() || "";
|
|
3869
3869
|
}
|
|
3870
3870
|
setIcon(e) {
|
|
3871
|
-
this.innerOverlay.setIcon(
|
|
3871
|
+
this.innerOverlay.setIcon(De.toGoogle(e));
|
|
3872
3872
|
}
|
|
3873
3873
|
getIcon() {
|
|
3874
3874
|
return this.innerOverlay.getIcon();
|
|
@@ -3906,7 +3906,7 @@ class It extends Mt {
|
|
|
3906
3906
|
this.label = void 0, this.labelPositionListener = void 0, this.labelVisibleListener = void 0, this.labelMapChangedListener = void 0;
|
|
3907
3907
|
}
|
|
3908
3908
|
}
|
|
3909
|
-
class St extends
|
|
3909
|
+
class St extends B {
|
|
3910
3910
|
constructor() {
|
|
3911
3911
|
super(...arguments);
|
|
3912
3912
|
c(this, "eventHubDelegate");
|
|
@@ -3949,21 +3949,21 @@ class At extends St {
|
|
|
3949
3949
|
}
|
|
3950
3950
|
static create(e) {
|
|
3951
3951
|
var n, a;
|
|
3952
|
-
const r = this.coordType, s = new BMap.Polyline(e.path.map((
|
|
3952
|
+
const r = this.coordType, s = new BMap.Polyline(e.path.map((d) => d.toBaidu(r)), {
|
|
3953
3953
|
enableClicking: e.clickable,
|
|
3954
3954
|
enableEditing: e.editable,
|
|
3955
3955
|
strokeColor: e.strokeColor,
|
|
3956
|
-
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity +
|
|
3956
|
+
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity + B.OPACITY_DELTA : void 0,
|
|
3957
3957
|
strokeWeight: e.strokeWeight,
|
|
3958
|
-
icons: (n = e.icons) == null ? void 0 : n.map(
|
|
3958
|
+
icons: (n = e.icons) == null ? void 0 : n.map(Ge.toBaidu)
|
|
3959
3959
|
});
|
|
3960
3960
|
return new At(s, r, this, {
|
|
3961
3961
|
editable: !!e.editable,
|
|
3962
|
-
symbolIcons: (a = e.icons) == null ? void 0 : a.map((
|
|
3962
|
+
symbolIcons: (a = e.icons) == null ? void 0 : a.map((d) => d.icon)
|
|
3963
3963
|
}).visibleOptionInternal(e.visible);
|
|
3964
3964
|
}
|
|
3965
3965
|
getPath() {
|
|
3966
|
-
return this.innerOverlay.getPath().map((e) =>
|
|
3966
|
+
return this.innerOverlay.getPath().map((e) => v.fromBaidu(e, this.coordType));
|
|
3967
3967
|
}
|
|
3968
3968
|
setPath(e) {
|
|
3969
3969
|
this.coordType = this.map.coordType, this.setPathInternal(e.map((r) => r.toBaidu(this.coordType)));
|
|
@@ -3980,8 +3980,8 @@ class At extends St {
|
|
|
3980
3980
|
const a = n.getIcon();
|
|
3981
3981
|
if (!(a instanceof BMap.Symbol))
|
|
3982
3982
|
return !1;
|
|
3983
|
-
const
|
|
3984
|
-
return
|
|
3983
|
+
const d = a;
|
|
3984
|
+
return d.__icon__ ? (o = this.state.symbolIcons) == null ? void 0 : o.includes(d.__icon__) : !1;
|
|
3985
3985
|
}).forEach((s) => this.map.innerMap.removeOverlay(s));
|
|
3986
3986
|
}
|
|
3987
3987
|
}
|
|
@@ -4001,7 +4001,7 @@ class Rt extends qe {
|
|
|
4001
4001
|
strokeOpacity: e.strokeOpacity,
|
|
4002
4002
|
strokeWeight: e.strokeWeight,
|
|
4003
4003
|
visible: e.visible,
|
|
4004
|
-
icons: (n = e.icons) == null ? void 0 : n.map(
|
|
4004
|
+
icons: (n = e.icons) == null ? void 0 : n.map(Ge.toGoogle)
|
|
4005
4005
|
});
|
|
4006
4006
|
return new Rt(s, r, this);
|
|
4007
4007
|
}
|
|
@@ -4026,7 +4026,7 @@ class Rt extends qe {
|
|
|
4026
4026
|
getPath() {
|
|
4027
4027
|
const e = [];
|
|
4028
4028
|
return this.innerOverlay.getPath().forEach((r) => {
|
|
4029
|
-
e.push(
|
|
4029
|
+
e.push(v.fromGoogle(r, this.coordType));
|
|
4030
4030
|
}), e;
|
|
4031
4031
|
}
|
|
4032
4032
|
setPath(e) {
|
|
@@ -4046,15 +4046,15 @@ class $t extends St {
|
|
|
4046
4046
|
enableClicking: e.clickable,
|
|
4047
4047
|
enableEditing: e.editable,
|
|
4048
4048
|
strokeColor: e.strokeColor,
|
|
4049
|
-
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity +
|
|
4049
|
+
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity + B.OPACITY_DELTA : void 0,
|
|
4050
4050
|
strokeWeight: e.strokeWeight,
|
|
4051
4051
|
fillColor: e.fillColor,
|
|
4052
|
-
fillOpacity: e.fillOpacity != null ? e.fillOpacity +
|
|
4052
|
+
fillOpacity: e.fillOpacity != null ? e.fillOpacity + B.OPACITY_DELTA : void 0
|
|
4053
4053
|
});
|
|
4054
4054
|
return new $t(n, r, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
4055
4055
|
}
|
|
4056
4056
|
getPaths() {
|
|
4057
|
-
return [this.innerOverlay.getPath().map((e) =>
|
|
4057
|
+
return [this.innerOverlay.getPath().map((e) => v.fromBaidu(e, this.coordType))];
|
|
4058
4058
|
}
|
|
4059
4059
|
setPaths(e) {
|
|
4060
4060
|
e.length > 1 && console.warn("baidu不支持多path, 只会显示paths[0]"), this.coordType = this.map.coordType, this.setPathInternal((e[0] || []).map((r) => r.toBaidu(this.coordType)));
|
|
@@ -4105,7 +4105,7 @@ class zt extends qe {
|
|
|
4105
4105
|
return e.forEach((s) => {
|
|
4106
4106
|
const n = [];
|
|
4107
4107
|
r.push(n), s.forEach((a) => {
|
|
4108
|
-
n.push(
|
|
4108
|
+
n.push(v.fromGoogle(a, this.coordType));
|
|
4109
4109
|
});
|
|
4110
4110
|
}), r;
|
|
4111
4111
|
}
|
|
@@ -4130,9 +4130,9 @@ class Dt extends St {
|
|
|
4130
4130
|
if (a > r.length) {
|
|
4131
4131
|
for (let o = 0; o < a; o++)
|
|
4132
4132
|
if (r[o] == null || !Yt.equals(s[o], r[o])) {
|
|
4133
|
-
const l = s[(o - 2 + a) % a],
|
|
4133
|
+
const l = s[(o - 2 + a) % a], h = s[(o - 1 + a) % a], u = s[o], p = s[(o + 1) % a], f = s[(o + 2) % a];
|
|
4134
4134
|
let _;
|
|
4135
|
-
|
|
4135
|
+
h.lat === p.lat ? _ = new BMap.Point(h.lng, u.lat) : h.lng === p.lng ? _ = new BMap.Point(u.lng, h.lat) : _ = u, n = [l, f, _];
|
|
4136
4136
|
break;
|
|
4137
4137
|
}
|
|
4138
4138
|
} else if (a === r.length) {
|
|
@@ -4146,8 +4146,8 @@ class Dt extends St {
|
|
|
4146
4146
|
}
|
|
4147
4147
|
} else
|
|
4148
4148
|
a < r.length;
|
|
4149
|
-
const
|
|
4150
|
-
|
|
4149
|
+
const d = R.fromArray(n.map((o) => v.fromBaidu(o, this.coordType)));
|
|
4150
|
+
d && (this.isDoingUpdateRectangle = !0, this.innerOverlay.setPath(d.toRectArray().map((o) => o.toBaidu(this.coordType))), this.isDoingUpdateRectangle = !1);
|
|
4151
4151
|
}, 0);
|
|
4152
4152
|
});
|
|
4153
4153
|
this.addEventListener("bounds-changed", this.onBoundsChanged);
|
|
@@ -4157,10 +4157,10 @@ class Dt extends St {
|
|
|
4157
4157
|
enableClicking: e.clickable,
|
|
4158
4158
|
enableEditing: e.editable,
|
|
4159
4159
|
strokeColor: e.strokeColor,
|
|
4160
|
-
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity +
|
|
4160
|
+
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity + B.OPACITY_DELTA : void 0,
|
|
4161
4161
|
strokeWeight: e.strokeWeight,
|
|
4162
4162
|
fillColor: e.fillColor,
|
|
4163
|
-
fillOpacity: e.fillOpacity != null ? e.fillOpacity +
|
|
4163
|
+
fillOpacity: e.fillOpacity != null ? e.fillOpacity + B.OPACITY_DELTA : void 0
|
|
4164
4164
|
});
|
|
4165
4165
|
return new Dt(s, r, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
4166
4166
|
}
|
|
@@ -4197,8 +4197,8 @@ class Nt extends qe {
|
|
|
4197
4197
|
e.equals(this.innerOverlay.getBounds()) || this.innerOverlay.setBounds(e);
|
|
4198
4198
|
}
|
|
4199
4199
|
}
|
|
4200
|
-
const
|
|
4201
|
-
class
|
|
4200
|
+
const te = 1;
|
|
4201
|
+
class Ni extends Tt {
|
|
4202
4202
|
constructor(e, r) {
|
|
4203
4203
|
var s;
|
|
4204
4204
|
super(e);
|
|
@@ -4217,12 +4217,12 @@ class Gi extends Tt {
|
|
|
4217
4217
|
c(this, "createZoomControl", vt.create);
|
|
4218
4218
|
c(this, "createScaleControl", ft.create);
|
|
4219
4219
|
this.buildInMapTypeId2BIMT = $.BUILD_IN_MAP_TYPES.getValueMap(A.prototype.getId), this.baiduMapType2BIMT = $.BUILD_IN_MAP_TYPES.getValueMap(A.prototype.asBaiduMapType), this.map = new BMap.Map(e, {
|
|
4220
|
-
minZoom: r.minZoom && r.minZoom +
|
|
4221
|
-
maxZoom: r.maxZoom && r.maxZoom +
|
|
4220
|
+
minZoom: r.minZoom && r.minZoom + te,
|
|
4221
|
+
maxZoom: r.maxZoom && r.maxZoom + te,
|
|
4222
4222
|
mapType: r.buildInMapTypeId && ((s = this.buildInMapTypeId2BIMT.get(r.buildInMapTypeId)) == null ? void 0 : s.asBaiduMapType()),
|
|
4223
4223
|
enableMapClick: !1
|
|
4224
4224
|
// 关闭底图点击功能
|
|
4225
|
-
}), this.map.centerAndZoom(r.center.toBaidu(this.coordType), r.zoom +
|
|
4225
|
+
}), this.map.centerAndZoom(r.center.toBaidu(this.coordType), r.zoom + te), this.setGestureHandling(r.gestureHandling), r.infoWindowMode === "multi" && console.warn("baidu不支持多个InfoWindow, 可能会出现未知问题"), r.mapStyle && this.map.setMapStyleV2(r.mapStyle.baidu), this.setEventTargetDelegate(new le(this.map, this)), this.map.addEventListener("addoverlay", (n) => {
|
|
4226
4226
|
const a = n.target.__info_box__;
|
|
4227
4227
|
a && (console.debug("add:info-box", a), this.map.addOverlay(a));
|
|
4228
4228
|
}), this.map.addEventListener("removeoverlay", (n) => {
|
|
@@ -4264,7 +4264,7 @@ class Gi extends Tt {
|
|
|
4264
4264
|
super.removeEventListener(e, r);
|
|
4265
4265
|
}
|
|
4266
4266
|
fromContainerPointToLatLng(e) {
|
|
4267
|
-
return
|
|
4267
|
+
return v.fromBaidu(this.innerMap.pixelToPoint(new BMap.Pixel(e.x, e.y)), this.coordType);
|
|
4268
4268
|
}
|
|
4269
4269
|
fromLatLngToContainerPoint(e) {
|
|
4270
4270
|
return this.innerMap.pointToPixel(e.toBaidu(this.coordType));
|
|
@@ -4279,22 +4279,22 @@ class Gi extends Tt {
|
|
|
4279
4279
|
e ? this.map.enableDoubleClickZoom() : this.map.disableDoubleClickZoom();
|
|
4280
4280
|
}
|
|
4281
4281
|
getCenter() {
|
|
4282
|
-
return
|
|
4282
|
+
return v.fromBaidu(this.map.getCenter(), this.coordType);
|
|
4283
4283
|
}
|
|
4284
4284
|
setCenter(e) {
|
|
4285
4285
|
this.map.setCenter(e.toBaidu(this.coordType));
|
|
4286
4286
|
}
|
|
4287
4287
|
getZoom() {
|
|
4288
|
-
return super.getZoom() -
|
|
4288
|
+
return super.getZoom() - te;
|
|
4289
4289
|
}
|
|
4290
4290
|
setZoom(e) {
|
|
4291
|
-
return super.setZoom(e +
|
|
4291
|
+
return super.setZoom(e + te);
|
|
4292
4292
|
}
|
|
4293
4293
|
setMinZoom(e) {
|
|
4294
|
-
this.map.setMinZoom(e +
|
|
4294
|
+
this.map.setMinZoom(e + te);
|
|
4295
4295
|
}
|
|
4296
4296
|
setMaxZoom(e) {
|
|
4297
|
-
this.map.setMaxZoom(e +
|
|
4297
|
+
this.map.setMaxZoom(e + te);
|
|
4298
4298
|
}
|
|
4299
4299
|
setMapStyle(e) {
|
|
4300
4300
|
this.map.setMapStyleV2((e == null ? void 0 : e.baidu) ?? { styleJson: [] });
|
|
@@ -4361,39 +4361,39 @@ class Gi extends Tt {
|
|
|
4361
4361
|
}
|
|
4362
4362
|
}
|
|
4363
4363
|
removeCustomControl(e) {
|
|
4364
|
-
e.inner && (
|
|
4364
|
+
e.inner && (ae(e.inner instanceof BMap.Control, `control.inner(${e.inner})需要是BMap.Control`), this.map.removeControl(e.inner));
|
|
4365
4365
|
}
|
|
4366
4366
|
createMarkerClusterer(e) {
|
|
4367
|
-
return new
|
|
4367
|
+
return new ci(this, e);
|
|
4368
4368
|
}
|
|
4369
4369
|
createAutocomplete(e) {
|
|
4370
|
-
return new
|
|
4370
|
+
return new ni(this, e);
|
|
4371
4371
|
}
|
|
4372
4372
|
createSearchBox(e) {
|
|
4373
|
-
return new
|
|
4373
|
+
return new mi(this, e);
|
|
4374
4374
|
}
|
|
4375
4375
|
createPlacesService(e) {
|
|
4376
|
-
return new
|
|
4376
|
+
return new pi(this, e);
|
|
4377
4377
|
}
|
|
4378
4378
|
createMapUrls(e) {
|
|
4379
4379
|
return new Re(e);
|
|
4380
4380
|
}
|
|
4381
4381
|
}
|
|
4382
|
-
class
|
|
4382
|
+
class Gi extends Tt {
|
|
4383
4383
|
constructor(e, r) {
|
|
4384
4384
|
var n, a;
|
|
4385
4385
|
super(e);
|
|
4386
4386
|
c(this, "buildInMapTypeId2BIMT");
|
|
4387
4387
|
c(this, "googleMapTypeId2BIMT");
|
|
4388
4388
|
c(this, "map");
|
|
4389
|
-
c(this, "createLabel",
|
|
4389
|
+
c(this, "createLabel", It.create);
|
|
4390
4390
|
c(this, "createCircle", Ct.create);
|
|
4391
4391
|
c(this, "createPolygon", zt.create);
|
|
4392
4392
|
c(this, "createPolyline", Rt.create);
|
|
4393
4393
|
c(this, "createRectangle", Nt.create);
|
|
4394
4394
|
c(this, "createInfoWindow", Lt.create);
|
|
4395
4395
|
c(this, "createInfoBox", Pt.create);
|
|
4396
|
-
c(this, "createMarker",
|
|
4396
|
+
c(this, "createMarker", Bt.create);
|
|
4397
4397
|
c(this, "createMapTypeControl", Se.create);
|
|
4398
4398
|
c(this, "createZoomControl", _t.create);
|
|
4399
4399
|
c(this, "createScaleControl", yt.create);
|
|
@@ -4410,7 +4410,7 @@ class Zi extends Tt {
|
|
|
4410
4410
|
styles: (n = r.mapStyle) == null ? void 0 : n.google.styles,
|
|
4411
4411
|
mapId: (a = r.mapStyle) == null ? void 0 : a.google.mapId,
|
|
4412
4412
|
mapTypeId: s == null ? void 0 : s.getGoogleMapTypeId()
|
|
4413
|
-
}), this.setEventTargetDelegate(new
|
|
4413
|
+
}), this.setEventTargetDelegate(new ie(this.map, this));
|
|
4414
4414
|
}
|
|
4415
4415
|
setGestureHandling(e) {
|
|
4416
4416
|
this.map.setOptions({
|
|
@@ -4426,21 +4426,21 @@ class Zi extends Tt {
|
|
|
4426
4426
|
fromContainerPointToLatLng(e) {
|
|
4427
4427
|
const r = this.innerMap.getProjection(), s = this.innerMap.getBounds();
|
|
4428
4428
|
if (r == null || s == null)
|
|
4429
|
-
return
|
|
4430
|
-
const n = r.fromLatLngToPoint(s.getSouthWest()), a = r.fromLatLngToPoint(s.getNorthEast()),
|
|
4431
|
-
if (n == null || a == null ||
|
|
4432
|
-
return
|
|
4433
|
-
const o = Math.pow(2,
|
|
4434
|
-
return
|
|
4429
|
+
return v.ZERO;
|
|
4430
|
+
const n = r.fromLatLngToPoint(s.getSouthWest()), a = r.fromLatLngToPoint(s.getNorthEast()), d = this.innerMap.getZoom();
|
|
4431
|
+
if (n == null || a == null || d == null)
|
|
4432
|
+
return v.ZERO;
|
|
4433
|
+
const o = Math.pow(2, d), l = new google.maps.Point(e.x / o + n.x, e.y / o + a.y);
|
|
4434
|
+
return v.fromGoogle(r.fromPointToLatLng(l) ?? J.LATLNG_ZERO, this.coordType);
|
|
4435
4435
|
}
|
|
4436
4436
|
fromLatLngToContainerPoint(e) {
|
|
4437
4437
|
const r = this.innerMap.getProjection(), s = this.innerMap.getBounds();
|
|
4438
4438
|
if (r == null || s == null)
|
|
4439
4439
|
return X.ZERO;
|
|
4440
|
-
const n = r.fromLatLngToPoint(s.getSouthWest()), a = r.fromLatLngToPoint(s.getNorthEast()),
|
|
4441
|
-
if (n == null || a == null ||
|
|
4440
|
+
const n = r.fromLatLngToPoint(s.getSouthWest()), a = r.fromLatLngToPoint(s.getNorthEast()), d = this.innerMap.getZoom();
|
|
4441
|
+
if (n == null || a == null || d == null)
|
|
4442
4442
|
return X.ZERO;
|
|
4443
|
-
const o = Math.pow(2,
|
|
4443
|
+
const o = Math.pow(2, d), l = r.fromLatLngToPoint(e.toGoogle(this.coordType));
|
|
4444
4444
|
return l == null ? X.ZERO : { x: (l.x - n.x) * o, y: (l.y - a.y) * o };
|
|
4445
4445
|
}
|
|
4446
4446
|
setDefaultCursor(e) {
|
|
@@ -4453,7 +4453,7 @@ class Zi extends Tt {
|
|
|
4453
4453
|
this.map.setOptions({ disableDoubleClickZoom: !e });
|
|
4454
4454
|
}
|
|
4455
4455
|
getCenter() {
|
|
4456
|
-
return
|
|
4456
|
+
return v.fromGoogle(this.map.getCenter() ?? J.LATLNG_ZERO, this.coordType);
|
|
4457
4457
|
}
|
|
4458
4458
|
setCenter(e) {
|
|
4459
4459
|
this.map.setCenter(e.toGoogle(this.coordType));
|
|
@@ -4529,30 +4529,56 @@ class Zi extends Tt {
|
|
|
4529
4529
|
}
|
|
4530
4530
|
}
|
|
4531
4531
|
createMarkerClusterer(e) {
|
|
4532
|
-
return new
|
|
4532
|
+
return new di(this, e);
|
|
4533
4533
|
}
|
|
4534
4534
|
createAutocomplete(e) {
|
|
4535
|
-
return new
|
|
4535
|
+
return new si(this, e);
|
|
4536
4536
|
}
|
|
4537
4537
|
createSearchBox(e) {
|
|
4538
|
-
return new
|
|
4538
|
+
return new gi(this, e);
|
|
4539
4539
|
}
|
|
4540
4540
|
createPlacesService(e) {
|
|
4541
|
-
return new
|
|
4541
|
+
return new ui(this, e);
|
|
4542
4542
|
}
|
|
4543
4543
|
createMapUrls(e) {
|
|
4544
4544
|
return new Ae(e);
|
|
4545
4545
|
}
|
|
4546
4546
|
}
|
|
4547
|
-
|
|
4547
|
+
const Ze = ["3.0"], Zi = {
|
|
4548
|
+
baidu: {
|
|
4549
|
+
version: "3.0",
|
|
4550
|
+
// 在build时会被静态替换, 导致使用者不能无法设置它
|
|
4551
|
+
// @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
|
|
4552
|
+
// @see @vite_process_env_detail
|
|
4553
|
+
key: "kXOq8Hg9BZbZEWAjXKuzd1oGreynup8h"
|
|
4554
|
+
},
|
|
4555
|
+
google: {
|
|
4556
|
+
version: "quarterly",
|
|
4557
|
+
key: "AIzaSyBcyzMel3dYFNcfcr0LOklbBQNpWycyZXo",
|
|
4558
|
+
language: "en-us",
|
|
4559
|
+
libraries: ["places"]
|
|
4560
|
+
},
|
|
4561
|
+
here: {
|
|
4562
|
+
version: Ze[0],
|
|
4563
|
+
key: ""
|
|
4564
|
+
}
|
|
4565
|
+
};
|
|
4566
|
+
let Er;
|
|
4567
|
+
function Lr() {
|
|
4568
|
+
return Er || C("请先安装: Vue<PartialTgMapConfig>.use(TgMap, {})");
|
|
4569
|
+
}
|
|
4570
|
+
function Wi(i) {
|
|
4571
|
+
i != null && (Er = Mr(Zi, i));
|
|
4572
|
+
}
|
|
4573
|
+
class Hi extends Tt {
|
|
4548
4574
|
constructor(e, r) {
|
|
4549
4575
|
var a;
|
|
4550
4576
|
super(e);
|
|
4551
4577
|
c(this, "map");
|
|
4552
4578
|
c(this, "defaultLayers");
|
|
4553
4579
|
this.mapOptions = r;
|
|
4554
|
-
const s =
|
|
4555
|
-
|
|
4580
|
+
const s = Lr().here;
|
|
4581
|
+
Ze.includes(s.version) || C(`不支持${s.version}, HereMap当前只支持如下版本: ${Ze}`);
|
|
4556
4582
|
const n = new H.service.Platform({
|
|
4557
4583
|
app_id: s.key.split(",")[0],
|
|
4558
4584
|
app_code: s.key.split(",")[1]
|
|
@@ -4569,7 +4595,7 @@ class Wi extends Tt {
|
|
|
4569
4595
|
return x.wgs84;
|
|
4570
4596
|
}
|
|
4571
4597
|
getCenter() {
|
|
4572
|
-
return
|
|
4598
|
+
return v.fromHere(this.map.getCenter(), this.coordType);
|
|
4573
4599
|
}
|
|
4574
4600
|
setCenter(e) {
|
|
4575
4601
|
this.map.setCenter(e.toHere(this.coordType));
|
|
@@ -4702,22 +4728,26 @@ var G = /* @__PURE__ */ ((i) => (i.google = "google", i.baidu = "baidu", i.here
|
|
|
4702
4728
|
const n = lt.create(s);
|
|
4703
4729
|
switch (e) {
|
|
4704
4730
|
case "google":
|
|
4705
|
-
return new Zi(r, n);
|
|
4706
|
-
case "baidu":
|
|
4707
4731
|
return new Gi(r, n);
|
|
4732
|
+
case "baidu":
|
|
4733
|
+
return new Ni(r, n);
|
|
4708
4734
|
case "here":
|
|
4709
|
-
return new
|
|
4735
|
+
return new Hi(r, n);
|
|
4710
4736
|
}
|
|
4711
4737
|
}
|
|
4712
4738
|
i.createMap = t;
|
|
4713
4739
|
})(ht || (ht = {}));
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
|
|
4740
|
+
const ji = {};
|
|
4741
|
+
function Vi(i) {
|
|
4742
|
+
return Q.putIfAbsent(ji, i, () => qr(() => Fi({ type: i, config: Lr()[i] })))();
|
|
4743
|
+
}
|
|
4744
|
+
function Fi({ type: i, config: t }) {
|
|
4745
|
+
const e = window, r = Ui(i);
|
|
4746
|
+
if (Q.get(e, r))
|
|
4717
4747
|
return Promise.resolve();
|
|
4718
4748
|
switch (i !== G.here && !t.key && C(`请先配置${i}地图的key`), i) {
|
|
4719
4749
|
case G.google:
|
|
4720
|
-
return {}.VITE_FALSE ? (
|
|
4750
|
+
return {}.VITE_FALSE ? (ti({
|
|
4721
4751
|
key: t.key,
|
|
4722
4752
|
v: "3.52"
|
|
4723
4753
|
// v: config.version,
|
|
@@ -4725,40 +4755,40 @@ function ji({ type: i, config: t }) {
|
|
|
4725
4755
|
case G.baidu:
|
|
4726
4756
|
return qt(`https://api.map.baidu.com/api?v=${t.version}&ak=${t.key}`);
|
|
4727
4757
|
case G.here:
|
|
4728
|
-
return fe(
|
|
4758
|
+
return ye(fe("core", t.version)).then(() => Promise.all([
|
|
4729
4759
|
// 其他大多数模块都可以同时载入
|
|
4730
|
-
fe(
|
|
4731
|
-
fe(
|
|
4732
|
-
fe(
|
|
4733
|
-
fe(
|
|
4734
|
-
])).catch((s) => (
|
|
4760
|
+
ye(fe("service", t.version)),
|
|
4761
|
+
ye(fe("mapevents", t.version)),
|
|
4762
|
+
ye(fe("clustering", t.version)),
|
|
4763
|
+
ye(fe("ui", t.version))
|
|
4764
|
+
])).catch((s) => (Q.del(e, r), Promise.reject(s)));
|
|
4735
4765
|
default:
|
|
4736
4766
|
st(i);
|
|
4737
4767
|
}
|
|
4738
4768
|
}
|
|
4739
|
-
function
|
|
4769
|
+
function fe(i, t = Ze[0]) {
|
|
4740
4770
|
return `https://js.api.here.com/v3/${t}/mapsjs-${i}.js`;
|
|
4741
4771
|
}
|
|
4742
|
-
function
|
|
4772
|
+
function Ui(i) {
|
|
4743
4773
|
switch (i) {
|
|
4744
4774
|
case G.google:
|
|
4745
|
-
return "google";
|
|
4775
|
+
return "google.maps";
|
|
4746
4776
|
case G.baidu:
|
|
4747
4777
|
return "BMap";
|
|
4748
4778
|
case G.here:
|
|
4749
4779
|
return "H";
|
|
4750
4780
|
}
|
|
4751
4781
|
}
|
|
4752
|
-
let
|
|
4782
|
+
let Yi = 0;
|
|
4753
4783
|
function qt(i, t = "callback") {
|
|
4754
4784
|
return new Promise((e, r) => {
|
|
4755
|
-
const s = `__callback${
|
|
4785
|
+
const s = `__callback${Yi++}`;
|
|
4756
4786
|
window[s] = e;
|
|
4757
4787
|
const n = document.createElement("script");
|
|
4758
4788
|
n.src = `${i}&${t}=${s}`, n.onerror = r, document.body.appendChild(n);
|
|
4759
4789
|
});
|
|
4760
4790
|
}
|
|
4761
|
-
function
|
|
4791
|
+
function ye(i) {
|
|
4762
4792
|
return new Promise((t, e) => {
|
|
4763
4793
|
const r = document.createElement("script");
|
|
4764
4794
|
r.src = i, r.onload = t, r.onerror = e, document.body.appendChild(r);
|
|
@@ -4771,7 +4801,7 @@ function Z(i, t) {
|
|
|
4771
4801
|
validator: (e) => Object.values(i).includes(e)
|
|
4772
4802
|
};
|
|
4773
4803
|
}
|
|
4774
|
-
function
|
|
4804
|
+
function qi(i, t) {
|
|
4775
4805
|
return {
|
|
4776
4806
|
type: String,
|
|
4777
4807
|
default: t,
|
|
@@ -4790,7 +4820,7 @@ function m(i, t) {
|
|
|
4790
4820
|
default: t
|
|
4791
4821
|
};
|
|
4792
4822
|
}
|
|
4793
|
-
function
|
|
4823
|
+
function Js(i) {
|
|
4794
4824
|
const t = {};
|
|
4795
4825
|
return Object.entries(i).forEach(([e, r]) => {
|
|
4796
4826
|
const s = `__${e}`;
|
|
@@ -4807,37 +4837,37 @@ function qs(i) {
|
|
|
4807
4837
|
};
|
|
4808
4838
|
}), t;
|
|
4809
4839
|
}
|
|
4810
|
-
const
|
|
4840
|
+
const ve = {
|
|
4811
4841
|
enumerable: !0,
|
|
4812
4842
|
configurable: !0,
|
|
4813
|
-
get:
|
|
4814
|
-
set:
|
|
4843
|
+
get: Oe,
|
|
4844
|
+
set: Oe
|
|
4815
4845
|
};
|
|
4816
|
-
function
|
|
4846
|
+
function Ki(i) {
|
|
4817
4847
|
return Object.keys(i).forEach((t) => {
|
|
4818
4848
|
const e = i[t];
|
|
4819
4849
|
let r = !1;
|
|
4820
|
-
typeof e == "function" ? (
|
|
4850
|
+
typeof e == "function" ? (ve.get = e, ve.set = Oe, r = !0) : typeof e == "object" && typeof e.get == "function" && (ve.get = e.get, ve.set = e.set, r = !0), r && (i[t] = Object.defineProperty(i, t, ve));
|
|
4821
4851
|
}), i;
|
|
4822
4852
|
}
|
|
4823
|
-
function
|
|
4824
|
-
return
|
|
4853
|
+
function Qs(i) {
|
|
4854
|
+
return Ki(i);
|
|
4825
4855
|
}
|
|
4826
4856
|
function xr() {
|
|
4827
4857
|
return it();
|
|
4828
4858
|
}
|
|
4829
|
-
function
|
|
4859
|
+
function Be(i, t) {
|
|
4830
4860
|
const e = i.$options[t];
|
|
4831
4861
|
if (e)
|
|
4832
4862
|
for (const r of e)
|
|
4833
4863
|
r.call(i);
|
|
4834
4864
|
}
|
|
4835
|
-
function
|
|
4865
|
+
function en(i, t) {
|
|
4836
4866
|
for (const e of i)
|
|
4837
4867
|
if (e.$options.name === t.name)
|
|
4838
4868
|
return e;
|
|
4839
4869
|
}
|
|
4840
|
-
function
|
|
4870
|
+
function tn(i, t) {
|
|
4841
4871
|
if (!i.default)
|
|
4842
4872
|
return;
|
|
4843
4873
|
const e = i.default();
|
|
@@ -4845,12 +4875,12 @@ function Js(i, t) {
|
|
|
4845
4875
|
if ((r == null ? void 0 : r.type).name === t.name)
|
|
4846
4876
|
return r;
|
|
4847
4877
|
}
|
|
4848
|
-
function
|
|
4878
|
+
function Xi(i, t) {
|
|
4849
4879
|
const e = {}, r = {}, s = {};
|
|
4850
4880
|
return Object.keys(i).forEach((n) => {
|
|
4851
|
-
n.startsWith("on") ? e[
|
|
4881
|
+
n.startsWith("on") ? e[ue.pascal2kebab(n.substring(2))] = i[n] : r[n] = i[n];
|
|
4852
4882
|
}), t && Object.keys(t).forEach((n) => {
|
|
4853
|
-
n.startsWith("on") && (s[
|
|
4883
|
+
n.startsWith("on") && (s[ue.pascal2kebab(n.substring(2))] = t[n]);
|
|
4854
4884
|
}), {
|
|
4855
4885
|
/** class/style/未声明的属性 等 */
|
|
4856
4886
|
binds: r,
|
|
@@ -4861,12 +4891,12 @@ function Yi(i, t) {
|
|
|
4861
4891
|
};
|
|
4862
4892
|
}
|
|
4863
4893
|
function q(i, t) {
|
|
4864
|
-
return Xt(() =>
|
|
4894
|
+
return Xt(() => Xi(i, t));
|
|
4865
4895
|
}
|
|
4866
4896
|
function L() {
|
|
4867
4897
|
return Function;
|
|
4868
4898
|
}
|
|
4869
|
-
const
|
|
4899
|
+
const rn = () => {
|
|
4870
4900
|
let i, t;
|
|
4871
4901
|
function e(s) {
|
|
4872
4902
|
console.log(s), i = s && s.type, t = Date.now();
|
|
@@ -4878,20 +4908,20 @@ const Qs = () => {
|
|
|
4878
4908
|
}, Gt = "$map", xe = "onCreate", Pe = "onDestroy", k = w({
|
|
4879
4909
|
inject: [Gt],
|
|
4880
4910
|
mounted() {
|
|
4881
|
-
|
|
4911
|
+
Be(this, xe);
|
|
4882
4912
|
},
|
|
4883
4913
|
beforeUnmount() {
|
|
4884
|
-
|
|
4914
|
+
Be(this, Pe);
|
|
4885
4915
|
},
|
|
4886
4916
|
methods: {
|
|
4887
4917
|
recreate() {
|
|
4888
|
-
|
|
4918
|
+
Be(this, Pe), Be(this, xe);
|
|
4889
4919
|
}
|
|
4890
4920
|
},
|
|
4891
4921
|
render() {
|
|
4892
4922
|
return xr();
|
|
4893
4923
|
}
|
|
4894
|
-
}),
|
|
4924
|
+
}), Ji = w({
|
|
4895
4925
|
name: "tg-map",
|
|
4896
4926
|
provide() {
|
|
4897
4927
|
return {
|
|
@@ -4910,7 +4940,7 @@ const Qs = () => {
|
|
|
4910
4940
|
* - :last-center.sync="center": 获取tg-map销毁时的最后的center的值, 使用这种方式可以做到type切换时保留中心点位置
|
|
4911
4941
|
* @see AbstractMapEventMap.center-changed
|
|
4912
4942
|
* */
|
|
4913
|
-
center: D(
|
|
4943
|
+
center: D(v),
|
|
4914
4944
|
/**
|
|
4915
4945
|
* 同步center的延时
|
|
4916
4946
|
* @default 300
|
|
@@ -4921,23 +4951,23 @@ const Qs = () => {
|
|
|
4921
4951
|
* 仅用来获取center的值, 需要设置center的值请使用`center`属性
|
|
4922
4952
|
* @see center
|
|
4923
4953
|
* */
|
|
4924
|
-
currentCenter: m(
|
|
4954
|
+
currentCenter: m(v),
|
|
4925
4955
|
/**
|
|
4926
4956
|
* 仅用于获取tg-map销毁时的最后的center的值
|
|
4927
4957
|
* @see center
|
|
4928
4958
|
*/
|
|
4929
|
-
lastCenter: m(
|
|
4959
|
+
lastCenter: m(v),
|
|
4930
4960
|
zoom: D(Number),
|
|
4931
4961
|
/**
|
|
4932
4962
|
* 该属性不会响应式更新, 要让它立即生效, 请参考{@link file://./../views/map/InfoDemo.vue#L3}
|
|
4933
4963
|
* @see MapOptions.infoWindowMode
|
|
4934
4964
|
*/
|
|
4935
|
-
infoWindowMode:
|
|
4965
|
+
infoWindowMode: qi(Bi),
|
|
4936
4966
|
gestureHandling: Z(j),
|
|
4937
4967
|
minZoom: m(Number),
|
|
4938
4968
|
maxZoom: m(Number),
|
|
4939
4969
|
mapStyle: m(Object),
|
|
4940
|
-
mapTypeId: Z(
|
|
4970
|
+
mapTypeId: Z(or),
|
|
4941
4971
|
/** 地图类型对象, 优先级比mapTypeId高 */
|
|
4942
4972
|
mapType: m(Object),
|
|
4943
4973
|
hideLogo: m(Boolean),
|
|
@@ -4966,7 +4996,7 @@ const Qs = () => {
|
|
|
4966
4996
|
},
|
|
4967
4997
|
computed: {
|
|
4968
4998
|
propsJson() {
|
|
4969
|
-
return
|
|
4999
|
+
return Q.toJsonSafely(this.$props);
|
|
4970
5000
|
}
|
|
4971
5001
|
},
|
|
4972
5002
|
watch: {
|
|
@@ -4998,7 +5028,7 @@ const Qs = () => {
|
|
|
4998
5028
|
async mounted() {
|
|
4999
5029
|
const i = this.type;
|
|
5000
5030
|
try {
|
|
5001
|
-
await
|
|
5031
|
+
await Vi(i);
|
|
5002
5032
|
} catch (s) {
|
|
5003
5033
|
this.$emit("error", s);
|
|
5004
5034
|
return;
|
|
@@ -5031,8 +5061,8 @@ const Qs = () => {
|
|
|
5031
5061
|
() => this.zoom,
|
|
5032
5062
|
() => this.center
|
|
5033
5063
|
//
|
|
5034
|
-
], ([s, n], [a,
|
|
5035
|
-
s !== a && t.setZoom(s), n !==
|
|
5064
|
+
], ([s, n], [a, d]) => {
|
|
5065
|
+
s !== a && t.setZoom(s), n !== d && (t.getCenter().equals(n) || t.setCenter(n));
|
|
5036
5066
|
}), "update:center" in this.attrs.listenerProps) {
|
|
5037
5067
|
const s = () => this.$emit("update:center", t.getCenter());
|
|
5038
5068
|
t.addEventListener("center-changed", () => {
|
|
@@ -5061,8 +5091,8 @@ const K = (i, t) => {
|
|
|
5061
5091
|
e[r] = s;
|
|
5062
5092
|
return e;
|
|
5063
5093
|
};
|
|
5064
|
-
function
|
|
5065
|
-
return F(), U("div",
|
|
5094
|
+
function Qi(i, t, e, r, s, n) {
|
|
5095
|
+
return F(), U("div", me({ class: "tg-map" }, i.attrs.binds), [
|
|
5066
5096
|
zr("div", {
|
|
5067
5097
|
ref: "map",
|
|
5068
5098
|
class: Ve({
|
|
@@ -5075,8 +5105,8 @@ function Ki(i, t, e, r, s, n) {
|
|
|
5075
5105
|
W(i.$slots, "overlay")
|
|
5076
5106
|
], 16);
|
|
5077
5107
|
}
|
|
5078
|
-
const ke = /* @__PURE__ */ K(
|
|
5079
|
-
function
|
|
5108
|
+
const ke = /* @__PURE__ */ K(Ji, [["render", Qi]]);
|
|
5109
|
+
function es(i) {
|
|
5080
5110
|
if (i == null)
|
|
5081
5111
|
return;
|
|
5082
5112
|
let t;
|
|
@@ -5087,7 +5117,7 @@ function Xi(i) {
|
|
|
5087
5117
|
t = i;
|
|
5088
5118
|
return `${t}px`;
|
|
5089
5119
|
}
|
|
5090
|
-
const
|
|
5120
|
+
const ts = w({
|
|
5091
5121
|
name: "tg-map-widget",
|
|
5092
5122
|
props: {
|
|
5093
5123
|
left: {
|
|
@@ -5113,10 +5143,10 @@ const Ji = w({
|
|
|
5113
5143
|
}
|
|
5114
5144
|
},
|
|
5115
5145
|
methods: {
|
|
5116
|
-
dimen:
|
|
5146
|
+
dimen: es
|
|
5117
5147
|
}
|
|
5118
5148
|
});
|
|
5119
|
-
function
|
|
5149
|
+
function rs(i, t, e, r, s, n) {
|
|
5120
5150
|
return F(), U("div", {
|
|
5121
5151
|
class: Ve(i.$options.name),
|
|
5122
5152
|
style: Dr({ left: i.dimen(i.left), top: i.dimen(i.topValue), right: i.dimen(i.right), bottom: i.dimen(i.bottom) })
|
|
@@ -5124,7 +5154,7 @@ function Qi(i, t, e, r, s, n) {
|
|
|
5124
5154
|
W(i.$slots, "default")
|
|
5125
5155
|
], 6);
|
|
5126
5156
|
}
|
|
5127
|
-
const
|
|
5157
|
+
const is = /* @__PURE__ */ K(ts, [["render", rs]]), ss = w({
|
|
5128
5158
|
name: "tg-custom-control",
|
|
5129
5159
|
mixins: [k],
|
|
5130
5160
|
props: {
|
|
@@ -5142,7 +5172,7 @@ const es = /* @__PURE__ */ K(Ji, [["render", Qi]]), ts = w({
|
|
|
5142
5172
|
},
|
|
5143
5173
|
onCreate() {
|
|
5144
5174
|
tr(this.$parent, ke) || console.warn("请将tg-custom-control放到tg-map中");
|
|
5145
|
-
const { $el: i } = this, t = class extends
|
|
5175
|
+
const { $el: i } = this, t = class extends Qr {
|
|
5146
5176
|
onCreateElement() {
|
|
5147
5177
|
return i;
|
|
5148
5178
|
}
|
|
@@ -5153,19 +5183,19 @@ const es = /* @__PURE__ */ K(Ji, [["render", Qi]]), ts = w({
|
|
|
5153
5183
|
this.$map.removeCustomControl(this.control);
|
|
5154
5184
|
}
|
|
5155
5185
|
});
|
|
5156
|
-
function
|
|
5186
|
+
function ns(i, t, e, r, s, n) {
|
|
5157
5187
|
return F(), U("div", {
|
|
5158
5188
|
class: Ve(i.$options.name)
|
|
5159
5189
|
}, [
|
|
5160
5190
|
W(i.$slots, "default")
|
|
5161
5191
|
], 2);
|
|
5162
5192
|
}
|
|
5163
|
-
const
|
|
5193
|
+
const os = /* @__PURE__ */ K(ss, [["render", ns]]), as = w({
|
|
5164
5194
|
name: "tg-map-type-control",
|
|
5165
5195
|
mixins: [k],
|
|
5166
5196
|
props: {
|
|
5167
5197
|
position: Z(S, S.TOP_LEFT),
|
|
5168
|
-
type: Z(
|
|
5198
|
+
type: Z(ar),
|
|
5169
5199
|
mapTypes: m(Array)
|
|
5170
5200
|
},
|
|
5171
5201
|
setup() {
|
|
@@ -5193,7 +5223,7 @@ const is = /* @__PURE__ */ K(ts, [["render", rs]]), ss = w({
|
|
|
5193
5223
|
onDestroy() {
|
|
5194
5224
|
this.$map.removeControl(this.control);
|
|
5195
5225
|
}
|
|
5196
|
-
}),
|
|
5226
|
+
}), ls = w({
|
|
5197
5227
|
name: "tg-scale-control",
|
|
5198
5228
|
mixins: [k],
|
|
5199
5229
|
props: {
|
|
@@ -5222,11 +5252,11 @@ function Pr() {
|
|
|
5222
5252
|
let t = (i == null ? void 0 : i.name) ?? (i == null ? void 0 : i.__name);
|
|
5223
5253
|
if (!t) {
|
|
5224
5254
|
const r = i == null ? void 0 : i.__file;
|
|
5225
|
-
r && (t =
|
|
5255
|
+
r && (t = Ri.basename(r, ".vue"));
|
|
5226
5256
|
}
|
|
5227
5257
|
return t;
|
|
5228
5258
|
}
|
|
5229
|
-
function
|
|
5259
|
+
function hs() {
|
|
5230
5260
|
const i = Gr(Gt);
|
|
5231
5261
|
let t, e;
|
|
5232
5262
|
return i == null && C(`<${Pr() || "unknown"}>必须作为<tg-map>的子代组件`), {
|
|
@@ -5249,14 +5279,14 @@ function os() {
|
|
|
5249
5279
|
}
|
|
5250
5280
|
};
|
|
5251
5281
|
}
|
|
5252
|
-
const
|
|
5282
|
+
const cs = w({
|
|
5253
5283
|
name: "tg-zoom-control",
|
|
5254
5284
|
props: {
|
|
5255
5285
|
position: Z(S, S.RIGHT_BOTTOM)
|
|
5256
5286
|
},
|
|
5257
5287
|
setup(i) {
|
|
5258
5288
|
let t = void 0;
|
|
5259
|
-
const { map: e, onCreate: r, onDestroy: s } =
|
|
5289
|
+
const { map: e, onCreate: r, onDestroy: s } = hs();
|
|
5260
5290
|
return r(() => {
|
|
5261
5291
|
t = e.createZoomControl(i), e.addControl(t);
|
|
5262
5292
|
}), s(() => {
|
|
@@ -5265,7 +5295,7 @@ const as = w({
|
|
|
5265
5295
|
t.setPosition(n);
|
|
5266
5296
|
}), xr;
|
|
5267
5297
|
}
|
|
5268
|
-
}),
|
|
5298
|
+
}), ds = w({
|
|
5269
5299
|
name: "tg-marker-clusterer",
|
|
5270
5300
|
mixins: [k],
|
|
5271
5301
|
// markers从this.$children中读取, 故需要省略(Omit)
|
|
@@ -5329,14 +5359,14 @@ const as = w({
|
|
|
5329
5359
|
}
|
|
5330
5360
|
}
|
|
5331
5361
|
});
|
|
5332
|
-
function
|
|
5362
|
+
function us(i, t, e, r, s, n) {
|
|
5333
5363
|
return F(), U("div", {
|
|
5334
5364
|
class: Ve(i.$options.name)
|
|
5335
5365
|
}, [
|
|
5336
5366
|
W(i.$slots, "default")
|
|
5337
5367
|
], 2);
|
|
5338
5368
|
}
|
|
5339
|
-
const kr = /* @__PURE__ */ K(
|
|
5369
|
+
const kr = /* @__PURE__ */ K(ds, [["render", us]]), ps = w({
|
|
5340
5370
|
name: "tg-traffic-layer",
|
|
5341
5371
|
mixins: [k],
|
|
5342
5372
|
// 请直接使用v-if来控制它的显隐
|
|
@@ -5349,17 +5379,17 @@ const kr = /* @__PURE__ */ K(ls, [["render", hs]]), cs = w({
|
|
|
5349
5379
|
},
|
|
5350
5380
|
watch: {},
|
|
5351
5381
|
onCreate() {
|
|
5352
|
-
this.layer = new
|
|
5382
|
+
this.layer = new ei(), this.$map.addLayer(this.layer);
|
|
5353
5383
|
},
|
|
5354
5384
|
onDestroy() {
|
|
5355
5385
|
this.$map.removeLayer(this.layer);
|
|
5356
5386
|
}
|
|
5357
|
-
}),
|
|
5387
|
+
}), gs = w({
|
|
5358
5388
|
name: "tg-circle",
|
|
5359
5389
|
mixins: [k],
|
|
5360
5390
|
inheritAttrs: !1,
|
|
5361
5391
|
props: {
|
|
5362
|
-
center: D(
|
|
5392
|
+
center: D(v),
|
|
5363
5393
|
radius: D(Number),
|
|
5364
5394
|
clickable: m(Boolean),
|
|
5365
5395
|
editable: m(Boolean),
|
|
@@ -5434,7 +5464,7 @@ const kr = /* @__PURE__ */ K(ls, [["render", hs]]), cs = w({
|
|
|
5434
5464
|
this.$map.removeOverlay(this.overlay);
|
|
5435
5465
|
}
|
|
5436
5466
|
});
|
|
5437
|
-
class
|
|
5467
|
+
class ms extends $i {
|
|
5438
5468
|
constructor(t, e, r, s) {
|
|
5439
5469
|
super(t, e), this.content = r, this.position = s;
|
|
5440
5470
|
}
|
|
@@ -5449,12 +5479,12 @@ class us extends zi {
|
|
|
5449
5479
|
this.position = t, this.draw();
|
|
5450
5480
|
}
|
|
5451
5481
|
}
|
|
5452
|
-
const
|
|
5482
|
+
const fs = w({
|
|
5453
5483
|
name: "tg-element-overlay",
|
|
5454
5484
|
mixins: [k],
|
|
5455
5485
|
props: {
|
|
5456
5486
|
mapPane: Z(we, we.overlayMouseTarget),
|
|
5457
|
-
position: D(
|
|
5487
|
+
position: D(v)
|
|
5458
5488
|
},
|
|
5459
5489
|
setup() {
|
|
5460
5490
|
return {
|
|
@@ -5475,25 +5505,25 @@ const ps = w({
|
|
|
5475
5505
|
}
|
|
5476
5506
|
},
|
|
5477
5507
|
onCreate() {
|
|
5478
|
-
this.overlay = new
|
|
5508
|
+
this.overlay = new ms(this.$map, this, this.content(), this.position), this.$map.addElementOverlay(this.overlay);
|
|
5479
5509
|
},
|
|
5480
5510
|
onDestroy() {
|
|
5481
5511
|
this.$map.removeElementOverlay(this.overlay);
|
|
5482
5512
|
}
|
|
5483
5513
|
});
|
|
5484
|
-
function
|
|
5485
|
-
return F(), U("div",
|
|
5514
|
+
function ys(i, t, e, r, s, n) {
|
|
5515
|
+
return F(), U("div", me({
|
|
5486
5516
|
class: i.$options.name
|
|
5487
5517
|
}, i.$attrs), [
|
|
5488
5518
|
W(i.$slots, "default")
|
|
5489
5519
|
], 16);
|
|
5490
5520
|
}
|
|
5491
|
-
const
|
|
5521
|
+
const vs = /* @__PURE__ */ K(fs, [["render", ys]]), _s = w({
|
|
5492
5522
|
name: "tg-marker",
|
|
5493
5523
|
mixins: [k],
|
|
5494
5524
|
inheritAttrs: !1,
|
|
5495
5525
|
props: {
|
|
5496
|
-
position: D(
|
|
5526
|
+
position: D(v),
|
|
5497
5527
|
title: m(String),
|
|
5498
5528
|
icon: m(Object),
|
|
5499
5529
|
clickable: m(Boolean),
|
|
@@ -5517,7 +5547,8 @@ const ms = /* @__PURE__ */ K(ps, [["render", gs]]), fs = w({
|
|
|
5517
5547
|
marker: void 0,
|
|
5518
5548
|
label: nt(),
|
|
5519
5549
|
info: nt(),
|
|
5520
|
-
emittedPosition: void 0
|
|
5550
|
+
emittedPosition: void 0,
|
|
5551
|
+
autoAddToClustererWhenCreate: i.autoAddToClusterer
|
|
5521
5552
|
};
|
|
5522
5553
|
},
|
|
5523
5554
|
watch: {
|
|
@@ -5561,12 +5592,12 @@ const ms = /* @__PURE__ */ K(ps, [["render", gs]]), fs = w({
|
|
|
5561
5592
|
}
|
|
5562
5593
|
},
|
|
5563
5594
|
onCreate() {
|
|
5564
|
-
this.marker = this.$map.createMarker(this), this.label && this.marker.setLabel(this.label.overlay), this.$clusterer() && this.autoAddToClusterer ? this.$clusterer().onAddMarker(this.marker) : this.$map.addOverlay(this.marker), this.info && this.info.show && this.info.overlay.open(this.marker), Y(this.attrs.listeners, this.marker), "update:position" in this.attrs.listenerProps && this.marker.addEventListener("dragend", (i) => {
|
|
5595
|
+
this.marker = this.$map.createMarker(this), this.label && this.marker.setLabel(this.label.overlay), this.$clusterer() && this.autoAddToClusterer ? this.$clusterer().onAddMarker(this.marker) : this.$map.addOverlay(this.marker), this.autoAddToClustererWhenCreate = this.autoAddToClusterer, this.info && this.info.show && this.info.overlay.open(this.marker), Y(this.attrs.listeners, this.marker), "update:position" in this.attrs.listenerProps && this.marker.addEventListener("dragend", (i) => {
|
|
5565
5596
|
this.$emit("update:position", this.emittedPosition = i.position);
|
|
5566
5597
|
});
|
|
5567
5598
|
},
|
|
5568
5599
|
onDestroy() {
|
|
5569
|
-
this.$clusterer() && this.
|
|
5600
|
+
this.$clusterer() && this.autoAddToClustererWhenCreate ? this.$clusterer().onRemoveMarker(this.marker) : this.$map.removeOverlay(this.marker);
|
|
5570
5601
|
},
|
|
5571
5602
|
methods: {
|
|
5572
5603
|
$clusterer() {
|
|
@@ -5589,20 +5620,20 @@ const ms = /* @__PURE__ */ K(ps, [["render", gs]]), fs = w({
|
|
|
5589
5620
|
}
|
|
5590
5621
|
}
|
|
5591
5622
|
});
|
|
5592
|
-
function
|
|
5593
|
-
return F(), U("div",
|
|
5623
|
+
function bs(i, t, e, r, s, n) {
|
|
5624
|
+
return F(), U("div", me({
|
|
5594
5625
|
class: i.$options.name
|
|
5595
5626
|
}, i.attrs.binds), [
|
|
5596
5627
|
W(i.$slots, "default")
|
|
5597
5628
|
], 16);
|
|
5598
5629
|
}
|
|
5599
|
-
const Ke = /* @__PURE__ */ K(
|
|
5630
|
+
const Ke = /* @__PURE__ */ K(_s, [["render", bs]]), Ts = w({
|
|
5600
5631
|
name: "tg-info-box",
|
|
5601
5632
|
mixins: [k],
|
|
5602
5633
|
inheritAttrs: !1,
|
|
5603
5634
|
props: {
|
|
5604
5635
|
show: D(Boolean),
|
|
5605
|
-
position: m(
|
|
5636
|
+
position: m(v),
|
|
5606
5637
|
offset: m(Object),
|
|
5607
5638
|
maxWidth: m(Number),
|
|
5608
5639
|
borderClass: m(String),
|
|
@@ -5669,20 +5700,20 @@ const Ke = /* @__PURE__ */ K(fs, [["render", ys]]), vs = w({
|
|
|
5669
5700
|
}
|
|
5670
5701
|
}
|
|
5671
5702
|
});
|
|
5672
|
-
function
|
|
5673
|
-
return F(), U("div",
|
|
5703
|
+
function Ms(i, t, e, r, s, n) {
|
|
5704
|
+
return F(), U("div", me({
|
|
5674
5705
|
class: i.$options.name
|
|
5675
5706
|
}, i.attrs.binds), [
|
|
5676
5707
|
W(i.$slots, "default")
|
|
5677
5708
|
], 16);
|
|
5678
5709
|
}
|
|
5679
|
-
const
|
|
5710
|
+
const Os = /* @__PURE__ */ K(Ts, [["render", Ms]]), Cs = w({
|
|
5680
5711
|
name: "tg-info-window",
|
|
5681
5712
|
mixins: [k],
|
|
5682
5713
|
inheritAttrs: !1,
|
|
5683
5714
|
props: {
|
|
5684
5715
|
show: D(Boolean),
|
|
5685
|
-
position: m(
|
|
5716
|
+
position: m(v),
|
|
5686
5717
|
maxWidth: m(Number),
|
|
5687
5718
|
offset: m(Object),
|
|
5688
5719
|
disableAutoPan: m(Boolean),
|
|
@@ -5740,21 +5771,21 @@ const bs = /* @__PURE__ */ K(vs, [["render", _s]]), Ts = w({
|
|
|
5740
5771
|
this.$marker() ? this.$marker().onRemoveInfo(this) : this.overlay.close();
|
|
5741
5772
|
}
|
|
5742
5773
|
});
|
|
5743
|
-
function
|
|
5744
|
-
return
|
|
5774
|
+
function ws(i, t, e, r, s, n) {
|
|
5775
|
+
return Hr((F(), U("div", me({
|
|
5745
5776
|
class: i.$options.name
|
|
5746
5777
|
}, i.attrs.binds), [
|
|
5747
5778
|
W(i.$slots, "default")
|
|
5748
5779
|
], 16)), [
|
|
5749
|
-
[
|
|
5780
|
+
[jr, i.show]
|
|
5750
5781
|
]);
|
|
5751
5782
|
}
|
|
5752
|
-
const
|
|
5783
|
+
const Es = /* @__PURE__ */ K(Cs, [["render", ws]]), Ls = w({
|
|
5753
5784
|
name: "tg-label",
|
|
5754
5785
|
mixins: [k],
|
|
5755
5786
|
inheritAttrs: !1,
|
|
5756
5787
|
props: {
|
|
5757
|
-
position: m(
|
|
5788
|
+
position: m(v),
|
|
5758
5789
|
offset: m(Object),
|
|
5759
5790
|
zIndex: m(Number),
|
|
5760
5791
|
mapPane: Z(we)
|
|
@@ -5811,14 +5842,14 @@ const Os = /* @__PURE__ */ K(Ts, [["render", Ms]]), Cs = w({
|
|
|
5811
5842
|
this.$marker() ? this.$marker().onRemoveLabel(this) : this.$map.removeOverlay(this.overlay);
|
|
5812
5843
|
}
|
|
5813
5844
|
});
|
|
5814
|
-
function
|
|
5815
|
-
return F(), U("div",
|
|
5845
|
+
function xs(i, t, e, r, s, n) {
|
|
5846
|
+
return F(), U("div", me({
|
|
5816
5847
|
class: i.$options.name
|
|
5817
5848
|
}, i.attrs.binds), [
|
|
5818
5849
|
W(i.$slots, "default")
|
|
5819
5850
|
], 16);
|
|
5820
5851
|
}
|
|
5821
|
-
const
|
|
5852
|
+
const Ps = /* @__PURE__ */ K(Ls, [["render", xs]]), ks = w({
|
|
5822
5853
|
name: "tg-polygon",
|
|
5823
5854
|
mixins: [k],
|
|
5824
5855
|
inheritAttrs: !1,
|
|
@@ -5887,7 +5918,7 @@ const Es = /* @__PURE__ */ K(Cs, [["render", ws]]), Ls = w({
|
|
|
5887
5918
|
onDestroy() {
|
|
5888
5919
|
this.$map.removeOverlay(this.overlay);
|
|
5889
5920
|
}
|
|
5890
|
-
}),
|
|
5921
|
+
}), Is = w({
|
|
5891
5922
|
name: "tg-polyline",
|
|
5892
5923
|
mixins: [k],
|
|
5893
5924
|
inheritAttrs: !1,
|
|
@@ -5955,7 +5986,7 @@ const Es = /* @__PURE__ */ K(Cs, [["render", ws]]), Ls = w({
|
|
|
5955
5986
|
onDestroy() {
|
|
5956
5987
|
this.overlay.remove();
|
|
5957
5988
|
}
|
|
5958
|
-
}),
|
|
5989
|
+
}), Bs = w({
|
|
5959
5990
|
name: "tg-rectangle",
|
|
5960
5991
|
mixins: [k],
|
|
5961
5992
|
inheritAttrs: !1,
|
|
@@ -6021,14 +6052,14 @@ const Es = /* @__PURE__ */ K(Cs, [["render", ws]]), Ls = w({
|
|
|
6021
6052
|
onDestroy() {
|
|
6022
6053
|
this.$map.removeOverlay(this.overlay);
|
|
6023
6054
|
}
|
|
6024
|
-
}),
|
|
6055
|
+
}), Ss = ["beforeUpdate", "updated"], sn = {
|
|
6025
6056
|
install(i, t = {}) {
|
|
6026
6057
|
if (t.enable !== !1) {
|
|
6027
6058
|
const e = w({
|
|
6028
6059
|
beforeCreate() {
|
|
6029
6060
|
const r = Pr() ?? "", n = (t.nameRegex || /^[A-Z]/).test(r) ? (a) => {
|
|
6030
|
-
t.hookNames ? t.hookNames.includes(a) && console.debug("[lifecycle]", r, a) :
|
|
6031
|
-
} :
|
|
6061
|
+
t.hookNames ? t.hookNames.includes(a) && console.debug("[lifecycle]", r, a) : Ss.includes(a) || console.debug("[lifecycle]", r, a);
|
|
6062
|
+
} : Oe;
|
|
6032
6063
|
n("beforeCreate"), this.__life_impl = n;
|
|
6033
6064
|
},
|
|
6034
6065
|
created() {
|
|
@@ -6067,44 +6098,44 @@ const Es = /* @__PURE__ */ K(Cs, [["render", ws]]), Ls = w({
|
|
|
6067
6098
|
i.mixin(e);
|
|
6068
6099
|
}
|
|
6069
6100
|
}
|
|
6070
|
-
},
|
|
6071
|
-
function
|
|
6101
|
+
}, As = 6378137;
|
|
6102
|
+
function Te(i) {
|
|
6072
6103
|
return i * Math.PI / 180;
|
|
6073
6104
|
}
|
|
6074
6105
|
function Kt(i) {
|
|
6075
6106
|
return i * 180 / Math.PI;
|
|
6076
6107
|
}
|
|
6077
|
-
function
|
|
6108
|
+
function Rs(i, t) {
|
|
6078
6109
|
if (i.lat === t.lat && i.lng === t.lng)
|
|
6079
6110
|
return 0;
|
|
6080
|
-
const e =
|
|
6081
|
-
let n = Math.sin(r), a = Math.sin(s),
|
|
6082
|
-
const o =
|
|
6083
|
-
n = n * n, a = a * a,
|
|
6084
|
-
const
|
|
6085
|
-
return _ * (1 + l * (T *
|
|
6086
|
-
}
|
|
6087
|
-
function
|
|
6088
|
-
const s = 63567523142e-4, n = 1 / 298.257223563, a =
|
|
6089
|
-
let
|
|
6090
|
-
for (; Math.abs(E -
|
|
6091
|
-
|
|
6092
|
-
const Sr =
|
|
6093
|
-
|
|
6094
|
-
}
|
|
6095
|
-
const
|
|
6096
|
-
u * P +
|
|
6097
|
-
(1 - n) * Math.sqrt(
|
|
6098
|
-
),
|
|
6099
|
-
return { lng: i.lng + Kt(
|
|
6100
|
-
}
|
|
6101
|
-
const
|
|
6102
|
-
getDistance:
|
|
6103
|
-
getDestination:
|
|
6104
|
-
},
|
|
6111
|
+
const e = Te((i.lat + t.lat) / 2), r = Te((i.lat - t.lat) / 2), s = Te((i.lng - t.lng) / 2);
|
|
6112
|
+
let n = Math.sin(r), a = Math.sin(s), d = Math.sin(e);
|
|
6113
|
+
const o = As, l = 1 / 298.257;
|
|
6114
|
+
n = n * n, a = a * a, d = d * d;
|
|
6115
|
+
const h = n * (1 - a) + (1 - d) * a, u = (1 - n) * (1 - a) + d * a, p = Math.atan(Math.sqrt(h / u)), f = Math.sqrt(h * u) / p, _ = 2 * p * o, T = (3 * f - 1) / 2 / u, g = (3 * f + 1) / 2 / h;
|
|
6116
|
+
return _ * (1 + l * (T * d * (1 - n) - g * (1 - d) * n));
|
|
6117
|
+
}
|
|
6118
|
+
function $s(i, t, e) {
|
|
6119
|
+
const s = 63567523142e-4, n = 1 / 298.257223563, a = Te(t), d = Math.sin(a), o = Math.cos(a), l = (1 - n) * Math.tan(Te(i.lat)), h = 1 / Math.sqrt(1 + l * l), u = l * h, p = Math.atan2(l, o), f = h * d, _ = 1 - f * f, T = _ * (6378137 * 6378137 - s * s) / (s * s), g = 1 + T / 16384 * (4096 + T * (-768 + T * (320 - 175 * T))), y = T / 1024 * (256 + T * (-128 + T * (74 - 47 * T)));
|
|
6120
|
+
let b = 0, O = 0, P = 0, E = e / (s * g), ee = 2 * Math.PI;
|
|
6121
|
+
for (; Math.abs(E - ee) > 1e-12; ) {
|
|
6122
|
+
b = Math.cos(2 * p + E), O = Math.sin(E), P = Math.cos(E);
|
|
6123
|
+
const Sr = y * O * (b + y / 4 * (P * (-1 + 2 * b * b) - y / 6 * b * (-3 + 4 * O * O) * (-3 + 4 * b * b)));
|
|
6124
|
+
ee = E, E = e / (s * g) + Sr;
|
|
6125
|
+
}
|
|
6126
|
+
const se = u * O - h * P * o, Xe = Math.atan2(
|
|
6127
|
+
u * P + h * O * o,
|
|
6128
|
+
(1 - n) * Math.sqrt(f * f + se * se)
|
|
6129
|
+
), Ir = Math.atan2(O * d, h * P - u * O * o), Je = n / 16 * _ * (4 + n * (4 - 3 * _)), Br = Ir - (1 - Je) * n * f * (E + Je * O * (b + Je * P * (-1 + 2 * b * b)));
|
|
6130
|
+
return { lng: i.lng + Kt(Br), lat: Kt(Xe) };
|
|
6131
|
+
}
|
|
6132
|
+
const nn = {
|
|
6133
|
+
getDistance: Rs,
|
|
6134
|
+
getDestination: $s
|
|
6135
|
+
}, on = {
|
|
6105
6136
|
install(i, t) {
|
|
6106
|
-
if (
|
|
6107
|
-
const r = /* @__PURE__ */ Object.assign({ "./TgMap.vue": ke, "./TgMapWidget.vue":
|
|
6137
|
+
if (Wi(t), {}.VITE_FALSE) {
|
|
6138
|
+
const r = /* @__PURE__ */ Object.assign({ "./TgMap.vue": ke, "./TgMapWidget.vue": is, "./controls/TgCustomControl.vue": os, "./controls/TgMapTypeControl.vue": as, "./controls/TgScaleControl.vue": ls, "./controls/TgZoomControl.vue": cs, "./extra/TgMarkerClusterer.vue": kr, "./layers/TgTrafficLayer.vue": ps, "./overlays/TgCircle.vue": gs, "./overlays/TgElementOverlay.vue": vs, "./overlays/TgInfoBox.vue": Os, "./overlays/TgInfoWindow.vue": Es, "./overlays/TgLabel.vue": Ps, "./overlays/TgMarker.vue": Ke, "./overlays/TgPolygon.vue": ks, "./overlays/TgPolyline.vue": Is, "./overlays/TgRectangle.vue": Bs });
|
|
6108
6139
|
Object.keys(r).forEach((s) => {
|
|
6109
6140
|
const n = r[s];
|
|
6110
6141
|
i.component(n.name ?? C(`Tg开头的组件必须设置name: ${s}`), n);
|
|
@@ -6115,11 +6146,11 @@ const tn = {
|
|
|
6115
6146
|
}
|
|
6116
6147
|
};
|
|
6117
6148
|
export {
|
|
6118
|
-
|
|
6149
|
+
nr as AbstractControl,
|
|
6119
6150
|
Tt as AbstractMap,
|
|
6120
6151
|
he as Arrays,
|
|
6121
|
-
|
|
6122
|
-
|
|
6152
|
+
dr as Autocomplete,
|
|
6153
|
+
ni as BaiduAutocomplete,
|
|
6123
6154
|
Ot as BaiduCircle,
|
|
6124
6155
|
pt as BaiduControl,
|
|
6125
6156
|
xt as BaiduInfoBoxOverlay,
|
|
@@ -6127,52 +6158,52 @@ export {
|
|
|
6127
6158
|
mt as BaiduMapTypeControl,
|
|
6128
6159
|
Re as BaiduMapUrls,
|
|
6129
6160
|
Le as BaiduMarker,
|
|
6130
|
-
|
|
6161
|
+
ci as BaiduMarkerClusterer,
|
|
6131
6162
|
Ye as BaiduOverlay,
|
|
6132
|
-
|
|
6163
|
+
pi as BaiduPlacesService,
|
|
6133
6164
|
St as BaiduPolyShape,
|
|
6134
6165
|
$t as BaiduPolygon,
|
|
6135
6166
|
At as BaiduPolyline,
|
|
6136
6167
|
Dt as BaiduRectangle,
|
|
6137
6168
|
ft as BaiduScaleControl,
|
|
6138
|
-
|
|
6169
|
+
mi as BaiduSearchBox,
|
|
6139
6170
|
vt as BaiduZoomControl,
|
|
6140
6171
|
A as BuildInMapType,
|
|
6141
|
-
|
|
6142
|
-
|
|
6172
|
+
or as BuildInMapTypeId,
|
|
6173
|
+
_e as CachedValue,
|
|
6143
6174
|
S as ControlPosition,
|
|
6144
6175
|
z as ControlPositionConverter,
|
|
6145
6176
|
x as CoordType,
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6177
|
+
Qr as CustomControl,
|
|
6178
|
+
$i as ElementOverlay,
|
|
6179
|
+
Jr as FastFindValues,
|
|
6149
6180
|
j as GestureHandlingOptions,
|
|
6150
|
-
|
|
6181
|
+
si as GoogleAutocomplete,
|
|
6151
6182
|
Ct as GoogleCircle,
|
|
6152
6183
|
gt as GoogleControl,
|
|
6153
6184
|
Pt as GoogleInfoBoxOverlay,
|
|
6154
6185
|
Lt as GoogleInfoWindow,
|
|
6155
6186
|
Se as GoogleMapTypeControl,
|
|
6156
6187
|
Ae as GoogleMapUrls,
|
|
6157
|
-
|
|
6158
|
-
|
|
6188
|
+
Bt as GoogleMarker,
|
|
6189
|
+
di as GoogleMarkerClusterer,
|
|
6159
6190
|
Mt as GoogleOverlay,
|
|
6160
|
-
|
|
6191
|
+
ui as GooglePlacesService,
|
|
6161
6192
|
zt as GooglePolygon,
|
|
6162
6193
|
Rt as GooglePolyline,
|
|
6163
6194
|
Nt as GoogleRectangle,
|
|
6164
6195
|
yt as GoogleScaleControl,
|
|
6165
|
-
|
|
6196
|
+
gi as GoogleSearchBox,
|
|
6166
6197
|
_t as GoogleZoomControl,
|
|
6167
|
-
|
|
6168
|
-
|
|
6169
|
-
|
|
6198
|
+
Ne as Icon,
|
|
6199
|
+
Ge as IconSequence,
|
|
6200
|
+
Us as ImageMapType,
|
|
6170
6201
|
wt as InfoWindow,
|
|
6171
|
-
|
|
6202
|
+
Bi as InfoWindowModeValues,
|
|
6172
6203
|
Ht as KeyValue,
|
|
6173
|
-
|
|
6204
|
+
v as LatLng,
|
|
6174
6205
|
R as LatLngBounds,
|
|
6175
|
-
|
|
6206
|
+
sn as LifecycleLogPlugin,
|
|
6176
6207
|
V as Location,
|
|
6177
6208
|
xe as MIXIN_HOOK_CREATE,
|
|
6178
6209
|
Pe as MIXIN_HOOK_DESTROY,
|
|
@@ -6183,77 +6214,78 @@ export {
|
|
|
6183
6214
|
we as MapPane,
|
|
6184
6215
|
Ee as MapPanes,
|
|
6185
6216
|
$ as MapType,
|
|
6186
|
-
|
|
6187
|
-
|
|
6188
|
-
|
|
6189
|
-
|
|
6190
|
-
|
|
6191
|
-
|
|
6192
|
-
|
|
6217
|
+
ar as MapTypeControlType,
|
|
6218
|
+
ur as MapUrls,
|
|
6219
|
+
fi as MapZoom,
|
|
6220
|
+
vr as MarkerClusterer,
|
|
6221
|
+
Q as Objects,
|
|
6222
|
+
Cr as Overlay,
|
|
6223
|
+
_r as PlacesService,
|
|
6193
6224
|
X as Point,
|
|
6194
|
-
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
|
-
|
|
6204
|
-
|
|
6225
|
+
br as SearchBox,
|
|
6226
|
+
nn as SphericalUtils,
|
|
6227
|
+
ue as Strings,
|
|
6228
|
+
ge as SymbolIcon,
|
|
6229
|
+
Xs as SymbolPath,
|
|
6230
|
+
gs as TgCircle,
|
|
6231
|
+
os as TgCustomControl,
|
|
6232
|
+
vs as TgElementOverlay,
|
|
6233
|
+
Os as TgInfoBox,
|
|
6234
|
+
Es as TgInfoWindow,
|
|
6235
|
+
Ps as TgLabel,
|
|
6205
6236
|
ke as TgMap,
|
|
6206
6237
|
ht as TgMapFactory,
|
|
6207
6238
|
G as TgMapType,
|
|
6208
|
-
|
|
6209
|
-
|
|
6239
|
+
as as TgMapTypeControl,
|
|
6240
|
+
is as TgMapWidget,
|
|
6210
6241
|
Ke as TgMarker,
|
|
6211
6242
|
kr as TgMarkerClusterer,
|
|
6212
|
-
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
|
-
|
|
6218
|
-
|
|
6219
|
-
|
|
6220
|
-
|
|
6243
|
+
ks as TgPolygon,
|
|
6244
|
+
Is as TgPolyline,
|
|
6245
|
+
Bs as TgRectangle,
|
|
6246
|
+
ls as TgScaleControl,
|
|
6247
|
+
ps as TgTrafficLayer,
|
|
6248
|
+
cs as TgZoomControl,
|
|
6249
|
+
ei as TrafficLayer,
|
|
6250
|
+
De as UnionIcon,
|
|
6251
|
+
ae as assert,
|
|
6221
6252
|
st as assertNever,
|
|
6222
|
-
|
|
6223
|
-
|
|
6253
|
+
Be as callHook,
|
|
6254
|
+
Js as computedSaveOnThis,
|
|
6255
|
+
qr as createAsyncSingleton,
|
|
6224
6256
|
xr as createEmptyVNode,
|
|
6225
|
-
|
|
6226
|
-
|
|
6227
|
-
|
|
6228
|
-
|
|
6257
|
+
Ki as createPropertyObject,
|
|
6258
|
+
Qs as createPropertyObjectTyped,
|
|
6259
|
+
Vs as debug,
|
|
6260
|
+
on as default,
|
|
6229
6261
|
L as eventProp,
|
|
6230
|
-
|
|
6262
|
+
tn as extractVNodeFromSlotsByComponent,
|
|
6231
6263
|
dt as findAncestorComponentByType,
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
|
|
6264
|
+
en as findByComponentType,
|
|
6265
|
+
$s as getDestination,
|
|
6266
|
+
Lr as getTgMapConfig,
|
|
6235
6267
|
ot as isComponentByType,
|
|
6236
|
-
|
|
6268
|
+
Fs as isDef,
|
|
6237
6269
|
Yr as isEntryValueDef,
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
|
|
6270
|
+
Zs as isInstanceOf,
|
|
6271
|
+
Gs as lateinit,
|
|
6272
|
+
Oe as noop,
|
|
6241
6273
|
m as optionalProp,
|
|
6242
|
-
|
|
6274
|
+
Ri as path,
|
|
6243
6275
|
D as requiredProp,
|
|
6244
|
-
|
|
6276
|
+
Ws as safeAs,
|
|
6245
6277
|
tr as safeAsComponent,
|
|
6246
|
-
|
|
6247
|
-
|
|
6278
|
+
Wi as setTgMapConfig,
|
|
6279
|
+
Xi as splitAttrs,
|
|
6248
6280
|
Z as stringEnumProp,
|
|
6249
|
-
|
|
6281
|
+
qi as stringUnionPropFromValues,
|
|
6250
6282
|
C as throwError,
|
|
6251
6283
|
ut as throwUnsupported,
|
|
6252
|
-
|
|
6284
|
+
js as todo,
|
|
6253
6285
|
nt as typed,
|
|
6254
|
-
|
|
6255
|
-
|
|
6286
|
+
Hs as unwrapStringEnumValue,
|
|
6287
|
+
rn as useEventLogMethods,
|
|
6256
6288
|
q as useSplittedAttrs,
|
|
6257
|
-
|
|
6289
|
+
hs as useTgMapInner
|
|
6258
6290
|
};
|
|
6259
6291
|
//# sourceMappingURL=tg-map.js.map
|