tg-map-vue3 3.6.3 → 3.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/src/components/overlays/TgInfoBox.vue.d.ts +5 -5
- package/dist/src/components/overlays/TgInfoWindow.vue.d.ts +5 -5
- package/dist/src/components/overlays/TgLabel.vue.d.ts +3 -3
- package/dist/src/components/overlays/TgMarker.vue.d.ts +6 -0
- package/dist/src/map/lat-lng.d.ts +27 -1
- package/dist/src/map/map/extra/marker-clusterer.d.ts +5 -1
- package/dist/src/map/map/overlay/marker.d.ts +10 -0
- package/dist/src/utils/arrays.d.ts +0 -2
- package/dist/src/utils/mapped-types.d.ts +10 -0
- package/dist/tg-map.js +916 -869
- 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
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode('.baidu-info-box-container{transform:translateY(-11px);font-size:13px;font-weight:300;width:100vw}.baidu-info-box-container__border{position:absolute;padding:12px;background-color:#fff;box-shadow:0 2px 7px 1px #0000004d;border-radius:8px;transform:translate(-50%,-100%)}.baidu-info-box-container__inner{overflow:auto}.baidu-info-box-container__close{position:absolute;right:-6px;top:-6px;width:14px;height:14px;margin:8px;opacity:.6;cursor:pointer}.baidu-info-box-container__close:hover{opacity:1}.baidu-info-box-container:after{position:absolute;background-color:#fff;content:"";width:15px;height:15px;left:0px;top:0px;box-shadow:-2px 2px 2px #b2b2b266;transform:translate(-50%,-50%) rotate(-45deg)}.element-overlay{position:absolute}.tg-map{height:100%;position:relative}.tg-map__map{width:100%;height:100%}.tg-map__map--hide-logo-google .gm-style a[target=_blank]:has(> div > img){display:none!important}.tg-map__map--hide-logo-google .gm-style>div:last-child>div:last-child>div{display:none}.tg-map__map--hide-logo-baidu div.anchorBL>a[target=_blank]>img{display:none}.tg-map__map--hide-logo-baidu div.BMap_cpyCtrl{display:none}.tg-map-widget{position:absolute}.tg-map>.tg-custom-control{display:none}.tg-map .tg-element-overlay{display:none}.tg-map__map .tg-element-overlay{display:block}.tg-map .tg-info-box{display:none}.tg-map__map .tg-info-box{display:block}.tg-map .tg-label{display:none}.tg-map__map .tg-label{display:block}')),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
import { createCommentVNode as Je, computed as
|
|
2
|
+
var Ir = Object.defineProperty;
|
|
3
|
+
var Sr = (i, t, e) => t in i ? Ir(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
4
|
+
var c = (i, t, e) => (Sr(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
5
|
+
import { createCommentVNode as Je, computed as Yt, defineComponent as w, markRaw as Ar, watch as qt, openBlock as V, createElementBlock as F, mergeProps as ue, createElementVNode as Rr, normalizeClass as Ze, renderSlot as W, normalizeStyle as $r, getCurrentInstance as zr, inject as Dr, onMounted as Nr, onBeforeUnmount as Gr, toRaw as We, withDirectives as Zr, vShow as Wr } from "vue";
|
|
6
6
|
function U(i, t, e) {
|
|
7
7
|
Object.keys(i).forEach((r) => {
|
|
8
8
|
r.startsWith("update:") || e != null && e.includes(r) || t.addEventListener(r, i[r]);
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
|
-
let
|
|
12
|
-
function
|
|
13
|
-
return
|
|
11
|
+
let Hr = 1;
|
|
12
|
+
function jr() {
|
|
13
|
+
return Hr++;
|
|
14
14
|
}
|
|
15
15
|
function Se(i, t) {
|
|
16
|
-
return t.__id__ || (t.__id__ =
|
|
16
|
+
return t.__id__ || (t.__id__ = jr()), `${i}::${t.__id__}`;
|
|
17
17
|
}
|
|
18
|
-
var
|
|
19
|
-
function
|
|
18
|
+
var Kt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
19
|
+
function nt(i) {
|
|
20
20
|
return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
|
|
21
21
|
}
|
|
22
|
-
var
|
|
22
|
+
var Xt = { exports: {} };
|
|
23
23
|
(function(i) {
|
|
24
24
|
(function(t, e) {
|
|
25
25
|
i.exports ? i.exports = e() : t.coordtransform = e();
|
|
26
|
-
})(
|
|
26
|
+
})(Kt, function() {
|
|
27
27
|
var t = 52.35987755982988, e = 3.141592653589793, r = 6378245, s = 0.006693421622965943;
|
|
28
28
|
function n(g, f, v, O) {
|
|
29
29
|
this.west = Math.min(g, v), this.north = Math.max(f, O), this.east = Math.max(g, v), this.south = Math.min(f, O);
|
|
@@ -38,7 +38,7 @@ var qt = { 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
|
+
], h = [
|
|
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),
|
|
@@ -50,20 +50,20 @@ var qt = { exports: {} };
|
|
|
50
50
|
function o(g, f) {
|
|
51
51
|
for (var v = 0; v < a.length; v++)
|
|
52
52
|
if (a[v].contain(g, f)) {
|
|
53
|
-
for (var O = 0; O <
|
|
54
|
-
if (
|
|
53
|
+
for (var O = 0; O < h.length; O++)
|
|
54
|
+
if (h[O].contain(g, f))
|
|
55
55
|
return !1;
|
|
56
56
|
return !0;
|
|
57
57
|
}
|
|
58
58
|
return !1;
|
|
59
59
|
}
|
|
60
60
|
function l(g, f) {
|
|
61
|
-
var v = g - 65e-4, O = f - 6e-3,
|
|
61
|
+
var v = g - 65e-4, O = f - 6e-3, P = Math.sqrt(v * v + O * O) - 2e-5 * Math.sin(O * t), E = Math.atan2(O, v) - 3e-6 * Math.cos(v * t), Q = P * Math.cos(E), ie = P * Math.sin(E);
|
|
62
62
|
return [Q, ie];
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
var v = Math.sqrt(g * g + f * f) + 2e-5 * Math.sin(f * t), O = Math.atan2(f, g) + 3e-6 * Math.cos(g * t),
|
|
66
|
-
return [
|
|
64
|
+
function d(g, f) {
|
|
65
|
+
var v = Math.sqrt(g * g + f * f) + 2e-5 * Math.sin(f * t), O = Math.atan2(f, g) + 3e-6 * Math.cos(g * t), P = v * Math.cos(O) + 65e-4, E = v * Math.sin(O) + 6e-3;
|
|
66
|
+
return [P, E];
|
|
67
67
|
}
|
|
68
68
|
function u(g, f) {
|
|
69
69
|
return o(g, f) ? b(g, f) : [g, f];
|
|
@@ -75,10 +75,10 @@ var qt = { exports: {} };
|
|
|
75
75
|
return [g * 2 - v[0], f * 2 - v[1]];
|
|
76
76
|
}
|
|
77
77
|
function b(g, f) {
|
|
78
|
-
var v = _(g - 105, f - 35), O = T(g - 105, f - 35),
|
|
78
|
+
var v = _(g - 105, f - 35), O = T(g - 105, f - 35), P = f / 180 * e, E = Math.sin(P);
|
|
79
79
|
E = 1 - s * E * E;
|
|
80
80
|
var Q = Math.sqrt(E);
|
|
81
|
-
v = v * 180 / (r * (1 - s) / (E * Q) * e), O = O * 180 / (r / Q * Math.cos(
|
|
81
|
+
v = v * 180 / (r * (1 - s) / (E * Q) * e), O = O * 180 / (r / Q * Math.cos(P) * e);
|
|
82
82
|
var ie = f + v, Ue = g + O;
|
|
83
83
|
return [Ue, ie];
|
|
84
84
|
}
|
|
@@ -93,12 +93,12 @@ var qt = { exports: {} };
|
|
|
93
93
|
return {
|
|
94
94
|
// 向前兼容
|
|
95
95
|
bd09togcj02: l,
|
|
96
|
-
gcj02tobd09:
|
|
96
|
+
gcj02tobd09: d,
|
|
97
97
|
wgs84togcj02: u,
|
|
98
98
|
gcj02towgs84: p,
|
|
99
99
|
// 小驼峰命名风格
|
|
100
100
|
bd09ToGcj02: l,
|
|
101
|
-
gcj02ToBd09:
|
|
101
|
+
gcj02ToBd09: d,
|
|
102
102
|
wgs84ToGcj02: u,
|
|
103
103
|
gcj02ToWgs84: p,
|
|
104
104
|
bd09ToWgs84: function(g, f) {
|
|
@@ -111,13 +111,13 @@ var qt = { exports: {} };
|
|
|
111
111
|
if (!o(g, f))
|
|
112
112
|
return [g, f];
|
|
113
113
|
var v = u(g, f);
|
|
114
|
-
return
|
|
114
|
+
return d(v[0], v[1]);
|
|
115
115
|
}
|
|
116
116
|
};
|
|
117
117
|
});
|
|
118
|
-
})(
|
|
119
|
-
var
|
|
120
|
-
const se = /* @__PURE__ */
|
|
118
|
+
})(Xt);
|
|
119
|
+
var Vr = Xt.exports;
|
|
120
|
+
const se = /* @__PURE__ */ nt(Vr);
|
|
121
121
|
function oe(i, t) {
|
|
122
122
|
if (!i)
|
|
123
123
|
throw new Error(`AssertionError: ${t}`);
|
|
@@ -125,69 +125,97 @@ function oe(i, t) {
|
|
|
125
125
|
function Qe(i) {
|
|
126
126
|
throw new Error(`Unexpected object: ${i}`);
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function As() {
|
|
129
129
|
}
|
|
130
130
|
function et(i) {
|
|
131
131
|
return i;
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function Rs(i, t) {
|
|
134
134
|
return i instanceof t;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function $s(i, t) {
|
|
137
137
|
if (i instanceof t)
|
|
138
138
|
return i;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
|
|
142
|
-
|
|
140
|
+
function tt(i, t) {
|
|
141
|
+
return (i == null ? void 0 : i.$options.name) === t.name;
|
|
142
|
+
}
|
|
143
|
+
function Jt(i, t) {
|
|
144
|
+
return tt(i, t) ? i : void 0;
|
|
145
|
+
}
|
|
146
|
+
function ot(i, t, e) {
|
|
147
|
+
let r = t;
|
|
148
|
+
for (; r; ) {
|
|
149
|
+
if (tt(r, i))
|
|
150
|
+
return r;
|
|
151
|
+
if (e && tt(r, e))
|
|
152
|
+
return;
|
|
153
|
+
r = r.$parent;
|
|
154
|
+
}
|
|
143
155
|
}
|
|
144
|
-
function
|
|
156
|
+
function zs(i) {
|
|
145
157
|
return i;
|
|
146
158
|
}
|
|
147
159
|
function C(i) {
|
|
148
160
|
throw new Error(i);
|
|
149
161
|
}
|
|
150
|
-
function
|
|
162
|
+
function at(i) {
|
|
151
163
|
throw new Error(`Unsupported: ${i}`);
|
|
152
164
|
}
|
|
153
|
-
function
|
|
165
|
+
function Ds(i) {
|
|
154
166
|
throw new Error(`todo: ${i}`);
|
|
155
167
|
}
|
|
156
|
-
function
|
|
168
|
+
function Ns(i) {
|
|
157
169
|
return i;
|
|
158
170
|
}
|
|
159
171
|
function ve(...i) {
|
|
160
172
|
}
|
|
161
|
-
function
|
|
173
|
+
function Gs(i) {
|
|
162
174
|
return i != null;
|
|
163
175
|
}
|
|
164
|
-
function
|
|
176
|
+
function Qt(i) {
|
|
165
177
|
return i[1] != null;
|
|
166
178
|
}
|
|
167
|
-
var
|
|
168
|
-
const qe = "wgs84",
|
|
179
|
+
var S = /* @__PURE__ */ ((i) => (i.wgs84 = "wgs84", i.gcj02 = "gcj02", i.bd09 = "bd09", i))(S || {});
|
|
180
|
+
const qe = "wgs84", k = class {
|
|
169
181
|
constructor(t, e, r) {
|
|
170
182
|
this.lat = t, this.lng = e, this.coord = r;
|
|
171
183
|
}
|
|
184
|
+
/**
|
|
185
|
+
* {@template latlng_normalize}
|
|
186
|
+
*
|
|
187
|
+
* 对经纬度进行标准化, 参考google的实现
|
|
188
|
+
*
|
|
189
|
+
* ## 行为不一致
|
|
190
|
+
* - google: google.maps.LatLng的构造器会对经纬度进行标准化, 所有点都能正常显示
|
|
191
|
+
* - baidu: BMap.Point的构造器不会对经纬度进行标准化, 超出范围的点显示到(0, 0)位置
|
|
192
|
+
*
|
|
193
|
+
* {@endtemplate}
|
|
194
|
+
*/
|
|
195
|
+
/* private */
|
|
196
|
+
static _normalize(t, e) {
|
|
197
|
+
const r = e > 90 ? 90 : e < -90 ? -90 : e;
|
|
198
|
+
return [t > 180 ? (t + 180) % 360 - 180 : t < -180 ? (t - 180) % 360 + 180 : t, r];
|
|
199
|
+
}
|
|
172
200
|
/** @param coord Baidu Map的坐标一般都是bd09 */
|
|
173
201
|
static fromBaidu(t, e) {
|
|
174
|
-
return new
|
|
202
|
+
return new k(t.lat, t.lng, e);
|
|
175
203
|
}
|
|
176
204
|
/** @param coord Google Map的坐标依据地图类型不同是不一样的 */
|
|
177
205
|
static fromGoogle(t, e) {
|
|
178
|
-
return new
|
|
206
|
+
return new k(t.lat(), t.lng(), e);
|
|
179
207
|
}
|
|
180
208
|
static fromHere(t, e) {
|
|
181
|
-
return new
|
|
209
|
+
return new k(t.lat, t.lng, e);
|
|
182
210
|
}
|
|
183
211
|
static fromLiteral(t) {
|
|
184
|
-
return new
|
|
212
|
+
return new k(t.lat, t.lng, t.coord || qe);
|
|
185
213
|
}
|
|
186
214
|
static fromLngLat(t, e, r = qe) {
|
|
187
|
-
return new
|
|
215
|
+
return new k(e, t, r);
|
|
188
216
|
}
|
|
189
217
|
static create(t, e, r = qe) {
|
|
190
|
-
return new
|
|
218
|
+
return new k(t, e, r);
|
|
191
219
|
}
|
|
192
220
|
/** 转换坐标到指定坐标系 */
|
|
193
221
|
to(t) {
|
|
@@ -195,12 +223,21 @@ const qe = "wgs84", N = class {
|
|
|
195
223
|
if (this.coord === e)
|
|
196
224
|
return this;
|
|
197
225
|
const [r, s] = this._convert(e);
|
|
198
|
-
return new
|
|
226
|
+
return new k(s, r, e);
|
|
199
227
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
228
|
+
/**
|
|
229
|
+
* 转换成baidu的经纬度
|
|
230
|
+
* @param normalize 转换时是否进行标准化, 默认false
|
|
231
|
+
* @see _normalize {@macro latlng_normalize}
|
|
232
|
+
*/
|
|
233
|
+
toBaidu(t, e = !1) {
|
|
234
|
+
let r = this.lat, s = this.lng;
|
|
235
|
+
return this.coord !== t && ([s, r] = this._convert(t)), e && ([s, r] = k._normalize(s, r)), new BMap.Point(s, r);
|
|
203
236
|
}
|
|
237
|
+
/**
|
|
238
|
+
* 转换成google的经纬度, 内部会自动进行标准化
|
|
239
|
+
* @see _normalize {@macro latlng_normalize}
|
|
240
|
+
*/
|
|
204
241
|
toGoogle(t) {
|
|
205
242
|
let e = this.lat, r = this.lng;
|
|
206
243
|
return this.coord !== t && ([r, e] = this._convert(t)), new google.maps.LatLng(e, r);
|
|
@@ -229,6 +266,14 @@ const qe = "wgs84", N = class {
|
|
|
229
266
|
}
|
|
230
267
|
throw new Error(`不支持的坐标转换: ${this.coord}=>${t}`);
|
|
231
268
|
}
|
|
269
|
+
/**
|
|
270
|
+
* 标准化, 返回合法的坐标点
|
|
271
|
+
* @see _normalize {@macro latlng_normalize}
|
|
272
|
+
*/
|
|
273
|
+
normalize() {
|
|
274
|
+
const [t, e] = k._normalize(this.lng, this.lat);
|
|
275
|
+
return e === this.lat && t === this.lng ? this : new k(e, t, this.coord);
|
|
276
|
+
}
|
|
232
277
|
equals(t) {
|
|
233
278
|
return this === t ? !0 : this.lat === t.lat && this.lng === t.lng && this.coord === t.coord;
|
|
234
279
|
}
|
|
@@ -236,8 +281,8 @@ const qe = "wgs84", N = class {
|
|
|
236
281
|
return JSON.stringify(this);
|
|
237
282
|
}
|
|
238
283
|
};
|
|
239
|
-
let y =
|
|
240
|
-
|
|
284
|
+
let y = k;
|
|
285
|
+
c(y, "ZERO", k.create(0, 0));
|
|
241
286
|
const te = class {
|
|
242
287
|
/**
|
|
243
288
|
* 不推荐直接创建LatLngBounds, sw和ne的大小关系可能没法保证, 推荐用LatLngBounds.Builder或者LatLngBounds.from等静态方法来创建
|
|
@@ -245,7 +290,7 @@ const te = class {
|
|
|
245
290
|
* @param ne 东北, lat/lng更大
|
|
246
291
|
*/
|
|
247
292
|
constructor(t, e) {
|
|
248
|
-
|
|
293
|
+
c(this, "coord");
|
|
249
294
|
this.sw = t, this.ne = e, oe(t.coord === e.coord, "sw和ne的coord应该相同"), oe(Number.isFinite(t.lat) && Number.isFinite(t.lng) && Number.isFinite(e.lat) && Number.isFinite(e.lng), `sw(${t})和ne(${e})不能包含NaN或Infinite`), oe(t.lat <= e.lat, `sw.lat(${t.lat})应该比ne.lat(${e.lat})小`), this.coord = t.coord;
|
|
250
295
|
}
|
|
251
296
|
static isBetweenLng(t, e, r) {
|
|
@@ -319,16 +364,16 @@ const te = class {
|
|
|
319
364
|
return [this.sw.toBaidu(t), this.ne.toBaidu(t)];
|
|
320
365
|
}
|
|
321
366
|
};
|
|
322
|
-
let
|
|
323
|
-
|
|
367
|
+
let R = te;
|
|
368
|
+
c(R, "EMPTY", new te(y.ZERO, y.ZERO));
|
|
324
369
|
((i) => {
|
|
325
370
|
class t {
|
|
326
371
|
constructor(r) {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
372
|
+
c(this, "coord");
|
|
373
|
+
c(this, "minLat");
|
|
374
|
+
c(this, "minLng");
|
|
375
|
+
c(this, "maxLat");
|
|
376
|
+
c(this, "maxLng");
|
|
332
377
|
this.coord = r.coord, this.minLat = this.maxLat = r.lat, this.minLng = this.maxLng = r.lng;
|
|
333
378
|
}
|
|
334
379
|
build() {
|
|
@@ -348,7 +393,7 @@ h(A, "EMPTY", new te(y.ZERO, y.ZERO));
|
|
|
348
393
|
}
|
|
349
394
|
}
|
|
350
395
|
i.Builder = t;
|
|
351
|
-
})(
|
|
396
|
+
})(R || (R = {}));
|
|
352
397
|
var K;
|
|
353
398
|
((i) => {
|
|
354
399
|
function t(r, s) {
|
|
@@ -365,67 +410,67 @@ var K;
|
|
|
365
410
|
}
|
|
366
411
|
i.getCoordType = e;
|
|
367
412
|
})(K || (K = {}));
|
|
368
|
-
var
|
|
369
|
-
return
|
|
413
|
+
var Fr = function(t) {
|
|
414
|
+
return Ur(t) && !Yr(t);
|
|
370
415
|
};
|
|
371
|
-
function
|
|
416
|
+
function Ur(i) {
|
|
372
417
|
return !!i && typeof i == "object";
|
|
373
418
|
}
|
|
374
|
-
function
|
|
419
|
+
function Yr(i) {
|
|
375
420
|
var t = Object.prototype.toString.call(i);
|
|
376
|
-
return t === "[object RegExp]" || t === "[object Date]" ||
|
|
421
|
+
return t === "[object RegExp]" || t === "[object Date]" || Xr(i);
|
|
377
422
|
}
|
|
378
|
-
var
|
|
379
|
-
function
|
|
380
|
-
return i.$$typeof ===
|
|
423
|
+
var qr = typeof Symbol == "function" && Symbol.for, Kr = qr ? Symbol.for("react.element") : 60103;
|
|
424
|
+
function Xr(i) {
|
|
425
|
+
return i.$$typeof === Kr;
|
|
381
426
|
}
|
|
382
|
-
function
|
|
427
|
+
function Jr(i) {
|
|
383
428
|
return Array.isArray(i) ? [] : {};
|
|
384
429
|
}
|
|
385
430
|
function _e(i, t) {
|
|
386
|
-
return t.clone !== !1 && t.isMergeableObject(i) ? le(
|
|
431
|
+
return t.clone !== !1 && t.isMergeableObject(i) ? le(Jr(i), i, t) : i;
|
|
387
432
|
}
|
|
388
|
-
function
|
|
433
|
+
function Qr(i, t, e) {
|
|
389
434
|
return i.concat(t).map(function(r) {
|
|
390
435
|
return _e(r, e);
|
|
391
436
|
});
|
|
392
437
|
}
|
|
393
|
-
function
|
|
438
|
+
function ei(i, t) {
|
|
394
439
|
if (!t.customMerge)
|
|
395
440
|
return le;
|
|
396
441
|
var e = t.customMerge(i);
|
|
397
442
|
return typeof e == "function" ? e : le;
|
|
398
443
|
}
|
|
399
|
-
function
|
|
444
|
+
function ti(i) {
|
|
400
445
|
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(i).filter(function(t) {
|
|
401
446
|
return Object.propertyIsEnumerable.call(i, t);
|
|
402
447
|
}) : [];
|
|
403
448
|
}
|
|
404
|
-
function
|
|
405
|
-
return Object.keys(i).concat(
|
|
449
|
+
function Nt(i) {
|
|
450
|
+
return Object.keys(i).concat(ti(i));
|
|
406
451
|
}
|
|
407
|
-
function
|
|
452
|
+
function er(i, t) {
|
|
408
453
|
try {
|
|
409
454
|
return t in i;
|
|
410
455
|
} catch {
|
|
411
456
|
return !1;
|
|
412
457
|
}
|
|
413
458
|
}
|
|
414
|
-
function
|
|
415
|
-
return
|
|
459
|
+
function ri(i, t) {
|
|
460
|
+
return er(i, t) && !(Object.hasOwnProperty.call(i, t) && Object.propertyIsEnumerable.call(i, t));
|
|
416
461
|
}
|
|
417
|
-
function
|
|
462
|
+
function ii(i, t, e) {
|
|
418
463
|
var r = {};
|
|
419
|
-
return e.isMergeableObject(i) &&
|
|
464
|
+
return e.isMergeableObject(i) && Nt(i).forEach(function(s) {
|
|
420
465
|
r[s] = _e(i[s], e);
|
|
421
|
-
}),
|
|
422
|
-
|
|
466
|
+
}), Nt(t).forEach(function(s) {
|
|
467
|
+
ri(i, s) || (er(i, s) && e.isMergeableObject(t[s]) ? r[s] = ei(s, e)(i[s], t[s], e) : r[s] = _e(t[s], e));
|
|
423
468
|
}), r;
|
|
424
469
|
}
|
|
425
470
|
function le(i, t, e) {
|
|
426
|
-
e = e || {}, e.arrayMerge = e.arrayMerge ||
|
|
471
|
+
e = e || {}, e.arrayMerge = e.arrayMerge || Qr, e.isMergeableObject = e.isMergeableObject || Fr, e.cloneUnlessOtherwiseSpecified = _e;
|
|
427
472
|
var r = Array.isArray(t), s = Array.isArray(i), n = r === s;
|
|
428
|
-
return n ? r ? e.arrayMerge(i, t, e) :
|
|
473
|
+
return n ? r ? e.arrayMerge(i, t, e) : ii(i, t, e) : _e(t, e);
|
|
429
474
|
}
|
|
430
475
|
le.all = function(t, e) {
|
|
431
476
|
if (!Array.isArray(t))
|
|
@@ -434,8 +479,8 @@ le.all = function(t, e) {
|
|
|
434
479
|
return le(r, s, e);
|
|
435
480
|
}, {});
|
|
436
481
|
};
|
|
437
|
-
var
|
|
438
|
-
const
|
|
482
|
+
var si = le, ni = si;
|
|
483
|
+
const tr = /* @__PURE__ */ nt(ni), Ae = ["3.0"], oi = {
|
|
439
484
|
baidu: {
|
|
440
485
|
version: "3.0",
|
|
441
486
|
// 在build时会被静态替换, 导致使用者不能无法设置它
|
|
@@ -454,65 +499,61 @@ const Jt = /* @__PURE__ */ st(ii), Ae = ["3.0"], si = {
|
|
|
454
499
|
key: ""
|
|
455
500
|
}
|
|
456
501
|
};
|
|
457
|
-
let
|
|
458
|
-
function
|
|
459
|
-
return
|
|
502
|
+
let rr;
|
|
503
|
+
function ir() {
|
|
504
|
+
return rr || C("请先安装: Vue<PartialTgMapConfig>.use(TgMap, {})");
|
|
460
505
|
}
|
|
461
|
-
function
|
|
462
|
-
i != null && (
|
|
506
|
+
function ai(i) {
|
|
507
|
+
i != null && (rr = tr(oi, i));
|
|
463
508
|
}
|
|
464
|
-
var
|
|
509
|
+
var rt;
|
|
465
510
|
((i) => {
|
|
466
511
|
function t(e) {
|
|
467
512
|
return e.scrollWidth > e.clientWidth || e.scrollHeight > e.clientHeight;
|
|
468
513
|
}
|
|
469
514
|
i.isScrollable = t;
|
|
470
|
-
})(
|
|
515
|
+
})(rt || (rt = {}));
|
|
471
516
|
var he;
|
|
472
517
|
((i) => {
|
|
473
|
-
function t(
|
|
474
|
-
return
|
|
518
|
+
function t(h, o) {
|
|
519
|
+
return h.length === o.length && h.every((l, d) => l === o[d]);
|
|
475
520
|
}
|
|
476
521
|
i.equals = t;
|
|
477
|
-
function e(
|
|
478
|
-
const
|
|
479
|
-
if (
|
|
480
|
-
return
|
|
522
|
+
function e(h, o) {
|
|
523
|
+
const l = h.indexOf(o);
|
|
524
|
+
if (l !== -1)
|
|
525
|
+
return h.splice(l, 1)[0];
|
|
481
526
|
}
|
|
482
527
|
i.remove = e;
|
|
483
|
-
function r(
|
|
484
|
-
for (const
|
|
485
|
-
if (
|
|
486
|
-
return
|
|
528
|
+
function r(h, o) {
|
|
529
|
+
for (const l of h)
|
|
530
|
+
if (l instanceof o)
|
|
531
|
+
return l;
|
|
487
532
|
}
|
|
488
533
|
i.findByType = r;
|
|
489
|
-
function s(
|
|
490
|
-
return
|
|
534
|
+
function s(h, o) {
|
|
535
|
+
return h.includes(o);
|
|
491
536
|
}
|
|
492
537
|
i.includesTyped = s;
|
|
493
|
-
function n(o, l
|
|
494
|
-
const
|
|
495
|
-
if (
|
|
496
|
-
return
|
|
497
|
-
|
|
538
|
+
function n(h, o, l) {
|
|
539
|
+
const d = o >= 0 ? o : h.length + o;
|
|
540
|
+
if (l === void 0)
|
|
541
|
+
return h[d];
|
|
542
|
+
h[d] = l;
|
|
498
543
|
}
|
|
499
544
|
i.at = n;
|
|
500
|
-
function a(
|
|
501
|
-
return
|
|
545
|
+
function a(h) {
|
|
546
|
+
return h.length > 0;
|
|
502
547
|
}
|
|
503
548
|
i.isNotEmpty = a;
|
|
504
|
-
function d(o) {
|
|
505
|
-
return !(o != null && o.length);
|
|
506
|
-
}
|
|
507
|
-
i.isNullOrEmpty = d;
|
|
508
549
|
})(he || (he = {}));
|
|
509
550
|
var ce;
|
|
510
551
|
((i) => {
|
|
511
552
|
function t(s, n) {
|
|
512
553
|
const a = s.getLength();
|
|
513
|
-
for (let
|
|
514
|
-
if (s.getAt(
|
|
515
|
-
return
|
|
554
|
+
for (let h = 0; h < a; h++)
|
|
555
|
+
if (s.getAt(h) === n)
|
|
556
|
+
return h;
|
|
516
557
|
return -1;
|
|
517
558
|
}
|
|
518
559
|
i.indexOf = t;
|
|
@@ -531,22 +572,22 @@ var ce;
|
|
|
531
572
|
}
|
|
532
573
|
i.listenChanged = r;
|
|
533
574
|
})(ce || (ce = {}));
|
|
534
|
-
function
|
|
575
|
+
function sr(i, t, e) {
|
|
535
576
|
return i.addListener(t, e).remove;
|
|
536
577
|
}
|
|
537
|
-
function
|
|
578
|
+
function li(i, t, e) {
|
|
538
579
|
return i.addEventListener(t, e), () => i.removeEventListener(t, e);
|
|
539
580
|
}
|
|
540
|
-
function
|
|
581
|
+
function hi(i, t, e, r) {
|
|
541
582
|
return i.addEventListener(t, e, r), () => i.removeEventListener(t, e, r);
|
|
542
583
|
}
|
|
543
|
-
function
|
|
584
|
+
function Gt(i, t, e) {
|
|
544
585
|
return i.addEventListener(t, e), () => i.removeEventListener(t, e);
|
|
545
586
|
}
|
|
546
|
-
class
|
|
587
|
+
class nr {
|
|
547
588
|
constructor(t, e) {
|
|
548
|
-
|
|
549
|
-
|
|
589
|
+
c(this, "eventMap", /* @__PURE__ */ new Map());
|
|
590
|
+
c(this, "target", void 0);
|
|
550
591
|
this.inner = t, this.coordTypeSupplier = e, this.addEventListener = this.addEventListener.bind(this), this.removeEventListener = this.removeEventListener.bind(this);
|
|
551
592
|
}
|
|
552
593
|
setTarget(t) {
|
|
@@ -555,7 +596,7 @@ class rr {
|
|
|
555
596
|
}
|
|
556
597
|
class He {
|
|
557
598
|
constructor(t, e) {
|
|
558
|
-
|
|
599
|
+
c(this, "eventHub", new or());
|
|
559
600
|
this.delegate = t, this.options = e;
|
|
560
601
|
}
|
|
561
602
|
notify(t) {
|
|
@@ -582,14 +623,14 @@ class He {
|
|
|
582
623
|
this.delegate.removeEventListener(t, e);
|
|
583
624
|
}
|
|
584
625
|
}
|
|
585
|
-
const
|
|
626
|
+
const $t = class extends nr {
|
|
586
627
|
addEventListener(t, e) {
|
|
587
628
|
const r = Se(t, e);
|
|
588
629
|
if (this.eventMap.get(r)) {
|
|
589
630
|
console.warn("listener已经添加过了", r, e);
|
|
590
631
|
return;
|
|
591
632
|
}
|
|
592
|
-
const s = this.inner.addListener(
|
|
633
|
+
const s = this.inner.addListener($t.EVENT_TYPE_MAP[t] || t, (n) => {
|
|
593
634
|
const a = {
|
|
594
635
|
type: t,
|
|
595
636
|
target: this.target,
|
|
@@ -604,9 +645,9 @@ const At = class extends rr {
|
|
|
604
645
|
s ? (s.remove(), this.eventMap.delete(r)) : console.warn("移除失败, 不存在该listener", r, e);
|
|
605
646
|
}
|
|
606
647
|
};
|
|
607
|
-
let re =
|
|
648
|
+
let re = $t;
|
|
608
649
|
// 事件类型映射: tg => google
|
|
609
|
-
|
|
650
|
+
c(re, "EVENT_TYPE_MAP", {
|
|
610
651
|
"center-changed": "center_changed",
|
|
611
652
|
"zoom-changed": "zoom_changed",
|
|
612
653
|
"radius-changed": "radius_changed",
|
|
@@ -622,7 +663,7 @@ h(re, "EVENT_TYPE_MAP", {
|
|
|
622
663
|
"map-mouseup": "mouseup",
|
|
623
664
|
"map-dblclick": "dblclick"
|
|
624
665
|
});
|
|
625
|
-
const Ne = class extends
|
|
666
|
+
const Ne = class extends nr {
|
|
626
667
|
addEventListener(t, e) {
|
|
627
668
|
const r = Se(t, e);
|
|
628
669
|
if (this.eventMap.get(r)) {
|
|
@@ -647,7 +688,7 @@ const Ne = class extends rr {
|
|
|
647
688
|
let ae = Ne;
|
|
648
689
|
// cSpell:words clickclose
|
|
649
690
|
// 事件类型映射, tg => baidu
|
|
650
|
-
|
|
691
|
+
c(ae, "EVENT_TYPE_MAP", {
|
|
651
692
|
drag: "dragging",
|
|
652
693
|
closeclick: "clickclose",
|
|
653
694
|
// baidu不支持contextmenu事件, 将其映射为rightclick
|
|
@@ -655,9 +696,9 @@ h(ae, "EVENT_TYPE_MAP", {
|
|
|
655
696
|
"zoom-changed": "zoomend",
|
|
656
697
|
"map-type-changed": "maptypechange"
|
|
657
698
|
});
|
|
658
|
-
class
|
|
699
|
+
class or {
|
|
659
700
|
constructor() {
|
|
660
|
-
|
|
701
|
+
c(this, "typeMap", /* @__PURE__ */ new Map());
|
|
661
702
|
}
|
|
662
703
|
addEventListener(t, e) {
|
|
663
704
|
let r = this.typeMap.get(t);
|
|
@@ -676,13 +717,13 @@ class ir {
|
|
|
676
717
|
e && e.forEach((r) => r.call(t.target, t));
|
|
677
718
|
}
|
|
678
719
|
}
|
|
679
|
-
class
|
|
720
|
+
class Zt {
|
|
680
721
|
/**
|
|
681
722
|
* `keys`和`values`数组中可以有相同的值, 若存在相同值, 则index越小的优先级越高
|
|
682
723
|
*/
|
|
683
724
|
constructor(t, e) {
|
|
684
|
-
|
|
685
|
-
|
|
725
|
+
c(this, "keyToValue", /* @__PURE__ */ new Map());
|
|
726
|
+
c(this, "valueToKey", /* @__PURE__ */ new Map());
|
|
686
727
|
oe(t.length === e.length);
|
|
687
728
|
for (let r = t.length - 1; r >= 0; r--)
|
|
688
729
|
this.keyToValue.set(t[r], e[r]), this.valueToKey.set(e[r], t[r]);
|
|
@@ -694,9 +735,9 @@ class Nt {
|
|
|
694
735
|
return this.keyToValue.get(t) ?? C();
|
|
695
736
|
}
|
|
696
737
|
}
|
|
697
|
-
class
|
|
738
|
+
class ci {
|
|
698
739
|
constructor(t, e = 10) {
|
|
699
|
-
|
|
740
|
+
c(this, "map", /* @__PURE__ */ new Map());
|
|
700
741
|
this.values = t, this.maxSize4Debug = e;
|
|
701
742
|
}
|
|
702
743
|
/** 获取保存key-value映射的Map */
|
|
@@ -725,14 +766,14 @@ class li {
|
|
|
725
766
|
}
|
|
726
767
|
class fe {
|
|
727
768
|
constructor(t) {
|
|
728
|
-
|
|
769
|
+
c(this, "value");
|
|
729
770
|
this.creator = t;
|
|
730
771
|
}
|
|
731
772
|
get() {
|
|
732
773
|
return this.value === void 0 && (this.value = this.creator()), this.value;
|
|
733
774
|
}
|
|
734
775
|
}
|
|
735
|
-
var I = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-center", i.TOP_RIGHT = "top-right", i.BOTTOM_LEFT = "bottom-left", i.BOTTOM_CENTER = "bottom-center", i.BOTTOM_RIGHT = "bottom-right", i.LEFT_TOP = "left-top", i.LEFT_CENTER = "left-center", i.LEFT_BOTTOM = "left-bottom", i.RIGHT_TOP = "right-top", i.RIGHT_CENTER = "right-center", i.RIGHT_BOTTOM = "right-bottom", i))(I || {}),
|
|
776
|
+
var I = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-center", i.TOP_RIGHT = "top-right", i.BOTTOM_LEFT = "bottom-left", i.BOTTOM_CENTER = "bottom-center", i.BOTTOM_RIGHT = "bottom-right", i.LEFT_TOP = "left-top", i.LEFT_CENTER = "left-center", i.LEFT_BOTTOM = "left-bottom", i.RIGHT_TOP = "right-top", i.RIGHT_CENTER = "right-center", i.RIGHT_BOTTOM = "right-bottom", i))(I || {}), z;
|
|
736
777
|
((i) => {
|
|
737
778
|
let t, e;
|
|
738
779
|
const r = [
|
|
@@ -751,7 +792,7 @@ var I = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
|
|
|
751
792
|
/* RIGHT_BOTTOM */
|
|
752
793
|
];
|
|
753
794
|
function s() {
|
|
754
|
-
return t || (t = new
|
|
795
|
+
return t || (t = new Zt(r, [
|
|
755
796
|
/* | @tg/map |名字相同| baidu | */
|
|
756
797
|
/* TOP_LEFT = */
|
|
757
798
|
BMAP_ANCHOR_TOP_LEFT,
|
|
@@ -781,7 +822,7 @@ var I = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
|
|
|
781
822
|
}
|
|
782
823
|
i.getBaidu = s;
|
|
783
824
|
function n() {
|
|
784
|
-
return e || (e = new
|
|
825
|
+
return e || (e = new Zt(r, [
|
|
785
826
|
google.maps.ControlPosition.TOP_LEFT,
|
|
786
827
|
google.maps.ControlPosition.TOP_CENTER,
|
|
787
828
|
google.maps.ControlPosition.TOP_RIGHT,
|
|
@@ -797,17 +838,17 @@ var I = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
|
|
|
797
838
|
])), e;
|
|
798
839
|
}
|
|
799
840
|
i.getGoogle = n;
|
|
800
|
-
})(
|
|
801
|
-
class
|
|
841
|
+
})(z || (z = {}));
|
|
842
|
+
class di {
|
|
802
843
|
constructor(t) {
|
|
803
844
|
/** 实际添加到地图中的control对象 */
|
|
804
|
-
|
|
845
|
+
c(this, "inner");
|
|
805
846
|
this.position = t;
|
|
806
847
|
}
|
|
807
848
|
}
|
|
808
|
-
class
|
|
849
|
+
class ar {
|
|
809
850
|
}
|
|
810
|
-
class
|
|
851
|
+
class lt extends ar {
|
|
811
852
|
constructor(t, e) {
|
|
812
853
|
super(), this.inner = t, this.position = e;
|
|
813
854
|
}
|
|
@@ -818,10 +859,10 @@ class ot extends sr {
|
|
|
818
859
|
t ? this.inner.show() : this.inner.hide();
|
|
819
860
|
}
|
|
820
861
|
getPosition() {
|
|
821
|
-
return this.position ??
|
|
862
|
+
return this.position ?? z.getBaidu().toKey(this.inner.getAnchor());
|
|
822
863
|
}
|
|
823
864
|
setPosition(t) {
|
|
824
|
-
this.position = t, this.inner.setAnchor(
|
|
865
|
+
this.position = t, this.inner.setAnchor(z.getBaidu().toValue(t));
|
|
825
866
|
}
|
|
826
867
|
addTo(t) {
|
|
827
868
|
t.innerMap.addControl(this.inner);
|
|
@@ -830,11 +871,11 @@ class ot extends sr {
|
|
|
830
871
|
t.innerMap.removeControl(this.inner);
|
|
831
872
|
}
|
|
832
873
|
}
|
|
833
|
-
class
|
|
874
|
+
class ht extends ar {
|
|
834
875
|
constructor(e, r) {
|
|
835
876
|
super();
|
|
836
|
-
|
|
837
|
-
|
|
877
|
+
c(this, "visible", !1);
|
|
878
|
+
c(this, "map");
|
|
838
879
|
this._type = e, this.position = r;
|
|
839
880
|
}
|
|
840
881
|
isVisible() {
|
|
@@ -857,7 +898,7 @@ class at extends sr {
|
|
|
857
898
|
}
|
|
858
899
|
onCreateOptions() {
|
|
859
900
|
return {
|
|
860
|
-
position:
|
|
901
|
+
position: z.getGoogle().toValue(this.position)
|
|
861
902
|
};
|
|
862
903
|
}
|
|
863
904
|
tryUpdateOptions() {
|
|
@@ -867,8 +908,8 @@ class at extends sr {
|
|
|
867
908
|
});
|
|
868
909
|
}
|
|
869
910
|
}
|
|
870
|
-
var
|
|
871
|
-
class
|
|
911
|
+
var lr = /* @__PURE__ */ ((i) => (i.normal = "normal", i.satellite = "satellite", i.hybrid = "hybrid", i))(lr || {});
|
|
912
|
+
class A {
|
|
872
913
|
constructor(t, e, r, s) {
|
|
873
914
|
this.id = t, this.baidu = e, this.google = r, this.googleCoordType = s;
|
|
874
915
|
}
|
|
@@ -876,7 +917,7 @@ class S {
|
|
|
876
917
|
return this.id;
|
|
877
918
|
}
|
|
878
919
|
getBaiduCoordType() {
|
|
879
|
-
return
|
|
920
|
+
return S.bd09;
|
|
880
921
|
}
|
|
881
922
|
asBaiduMapType() {
|
|
882
923
|
return this.baidu();
|
|
@@ -889,19 +930,19 @@ class S {
|
|
|
889
930
|
return this.google();
|
|
890
931
|
}
|
|
891
932
|
asGoogleMapType() {
|
|
892
|
-
|
|
933
|
+
at("google的内置地图没有对应的实例");
|
|
893
934
|
}
|
|
894
935
|
}
|
|
895
|
-
class
|
|
936
|
+
class Zs {
|
|
896
937
|
constructor(t, e) {
|
|
897
|
-
|
|
938
|
+
c(this, "baiduLayerCached", new fe(() => {
|
|
898
939
|
const t = new BMap.TileLayer({});
|
|
899
940
|
return t.getTilesUrl = (e, r) => {
|
|
900
941
|
const s = Math.pow(2, r - 1), n = e.x + s, a = s - 1 - e.y;
|
|
901
942
|
return this.options.getTileUrl({ x: n, y: a }, r);
|
|
902
943
|
}, t;
|
|
903
944
|
}));
|
|
904
|
-
|
|
945
|
+
c(this, "baiduMapTypeCached", new fe(() => {
|
|
905
946
|
const t = new BMap.MapType(this.options.name, this.baiduLayerCached.get(), {
|
|
906
947
|
maxZoom: this.options.maxZoom,
|
|
907
948
|
minZoom: this.options.minZoom,
|
|
@@ -909,7 +950,7 @@ class Ns {
|
|
|
909
950
|
});
|
|
910
951
|
return t.__baidu_map_type__ = this, t;
|
|
911
952
|
}));
|
|
912
|
-
|
|
953
|
+
c(this, "googleCached", new fe(() => {
|
|
913
954
|
const t = new google.maps.ImageMapType({
|
|
914
955
|
getTileUrl: (e, r) => this.options.getTileUrl(e, r),
|
|
915
956
|
tileSize: new google.maps.Size(256, 256),
|
|
@@ -941,13 +982,13 @@ class Ns {
|
|
|
941
982
|
return this.googleCached.get();
|
|
942
983
|
}
|
|
943
984
|
asGoogleLayer() {
|
|
944
|
-
|
|
985
|
+
at("这个方法不会被调用");
|
|
945
986
|
}
|
|
946
987
|
}
|
|
947
|
-
class
|
|
988
|
+
class ui {
|
|
948
989
|
constructor() {
|
|
949
|
-
|
|
950
|
-
|
|
990
|
+
c(this, "baiduCache", new fe(() => new BMap.TrafficLayer()));
|
|
991
|
+
c(this, "googleCache", new fe(() => new google.maps.TrafficLayer()));
|
|
951
992
|
}
|
|
952
993
|
asBaiduLayer() {
|
|
953
994
|
return this.baiduCache.get();
|
|
@@ -956,21 +997,21 @@ class ci {
|
|
|
956
997
|
return this.googleCache.get();
|
|
957
998
|
}
|
|
958
999
|
}
|
|
959
|
-
var
|
|
1000
|
+
var $;
|
|
960
1001
|
((i) => {
|
|
961
|
-
i.NORMAL = new
|
|
1002
|
+
i.NORMAL = new A("normal", () => BMAP_NORMAL_MAP, () => google.maps.MapTypeId.ROADMAP, S.gcj02), i.SATELLITE = new A("satellite", () => BMAP_SATELLITE_MAP, () => google.maps.MapTypeId.SATELLITE, S.wgs84), i.HYBRID = new A("hybrid", () => BMAP_HYBRID_MAP, () => google.maps.MapTypeId.HYBRID, S.gcj02), i.TERRAIN = new A("terrain", () => (
|
|
962
1003
|
/* 三维 */
|
|
963
1004
|
BMAP_PERSPECTIVE_MAP
|
|
964
1005
|
), () => (
|
|
965
1006
|
/* 地形 */
|
|
966
1007
|
google.maps.MapTypeId.TERRAIN
|
|
967
|
-
),
|
|
968
|
-
})(
|
|
969
|
-
var
|
|
970
|
-
const
|
|
971
|
-
class
|
|
1008
|
+
), S.wgs84), i.BUILD_IN_MAP_TYPES = new ci([i.NORMAL, i.SATELLITE, i.HYBRID, i.TERRAIN]);
|
|
1009
|
+
})($ || ($ = {}));
|
|
1010
|
+
var hr = /* @__PURE__ */ ((i) => (i.DEFAULT = "default", i.HORIZONTAL = "horizontal", i.DROPDOWN = "dropdown", i))(hr || {});
|
|
1011
|
+
const cr = [$.NORMAL, $.SATELLITE, $.HYBRID];
|
|
1012
|
+
class ct extends lt {
|
|
972
1013
|
static create(t) {
|
|
973
|
-
const e = t.mapTypes ??
|
|
1014
|
+
const e = t.mapTypes ?? cr, r = {
|
|
974
1015
|
default: BMAP_MAPTYPE_CONTROL_HORIZONTAL,
|
|
975
1016
|
horizontal: BMAP_MAPTYPE_CONTROL_HORIZONTAL,
|
|
976
1017
|
dropdown: BMAP_MAPTYPE_CONTROL_DROPDOWN
|
|
@@ -978,11 +1019,11 @@ class lt extends ot {
|
|
|
978
1019
|
type: t.type && r[t.type],
|
|
979
1020
|
mapTypes: e.map((n) => n.asBaiduMapType())
|
|
980
1021
|
});
|
|
981
|
-
return t.position && s.setAnchor(
|
|
1022
|
+
return t.position && s.setAnchor(z.getBaidu().toValue(t.position)), new ct(s, t.position);
|
|
982
1023
|
}
|
|
983
1024
|
}
|
|
984
|
-
const ne = class extends
|
|
985
|
-
constructor(t = "default", e = I.TOP_LEFT, r =
|
|
1025
|
+
const ne = class extends ht {
|
|
1026
|
+
constructor(t = "default", e = I.TOP_LEFT, r = cr) {
|
|
986
1027
|
super("mapType", e), this.type = t, this.mapTypes = r, ne.type2google || (ne.type2google = {
|
|
987
1028
|
default: google.maps.MapTypeControlStyle.DEFAULT,
|
|
988
1029
|
horizontal: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
|
|
@@ -994,72 +1035,72 @@ const ne = class extends at {
|
|
|
994
1035
|
}
|
|
995
1036
|
onCreateOptions() {
|
|
996
1037
|
const t = super.onCreateOptions();
|
|
997
|
-
return t.style = ne.type2google[this.type], t.mapTypeIds = this.mapTypes.map((e) => e instanceof
|
|
1038
|
+
return t.style = ne.type2google[this.type], t.mapTypeIds = this.mapTypes.map((e) => e instanceof A ? e.getGoogleMapTypeId() : e.id), t;
|
|
998
1039
|
}
|
|
999
1040
|
addTo(t) {
|
|
1000
1041
|
super.addTo(t), this.mapTypes.forEach((e) => {
|
|
1001
|
-
e instanceof
|
|
1042
|
+
e instanceof A || t.innerMap.mapTypes.set(e.id, e.asGoogleMapType());
|
|
1002
1043
|
});
|
|
1003
1044
|
}
|
|
1004
1045
|
};
|
|
1005
1046
|
let ke = ne;
|
|
1006
|
-
|
|
1007
|
-
class
|
|
1047
|
+
c(ke, "type2google");
|
|
1048
|
+
class dt extends lt {
|
|
1008
1049
|
static create(t) {
|
|
1009
1050
|
const e = new BMap.ScaleControl({
|
|
1010
|
-
anchor: t.position &&
|
|
1051
|
+
anchor: t.position && z.getBaidu().toValue(t.position)
|
|
1011
1052
|
});
|
|
1012
|
-
return new
|
|
1053
|
+
return new dt(e, t.position);
|
|
1013
1054
|
}
|
|
1014
1055
|
}
|
|
1015
|
-
class
|
|
1056
|
+
class ut extends ht {
|
|
1016
1057
|
static create(t) {
|
|
1017
|
-
return new
|
|
1058
|
+
return new ut(t.position);
|
|
1018
1059
|
}
|
|
1019
1060
|
constructor(t = I.BOTTOM_RIGHT) {
|
|
1020
1061
|
super("scale", t);
|
|
1021
1062
|
}
|
|
1022
1063
|
}
|
|
1023
|
-
class
|
|
1064
|
+
class pt extends lt {
|
|
1024
1065
|
static create(t) {
|
|
1025
1066
|
const e = new BMap.NavigationControl({
|
|
1026
1067
|
type: BMAP_NAVIGATION_CONTROL_ZOOM,
|
|
1027
1068
|
// enableGeolocation: true,
|
|
1028
|
-
anchor: t.position &&
|
|
1069
|
+
anchor: t.position && z.getBaidu().toValue(t.position)
|
|
1029
1070
|
});
|
|
1030
|
-
return new
|
|
1071
|
+
return new pt(e, t.position);
|
|
1031
1072
|
}
|
|
1032
1073
|
}
|
|
1033
|
-
class
|
|
1074
|
+
class gt extends ht {
|
|
1034
1075
|
static create(t) {
|
|
1035
|
-
return new
|
|
1076
|
+
return new gt(t.position);
|
|
1036
1077
|
}
|
|
1037
1078
|
constructor(t = I.RIGHT_BOTTOM) {
|
|
1038
1079
|
super("zoom", t);
|
|
1039
1080
|
}
|
|
1040
1081
|
}
|
|
1041
|
-
function
|
|
1082
|
+
function pi(i) {
|
|
1042
1083
|
let t, e, r;
|
|
1043
|
-
const s = "The Google Maps JavaScript API", n = "google", a = "importLibrary",
|
|
1084
|
+
const s = "The Google Maps JavaScript API", n = "google", a = "importLibrary", h = "__ib__", o = document, l = window, d = l[n] || (l[n] = {}), u = d.maps || (d.maps = {}), p = /* @__PURE__ */ new Set(), b = new URLSearchParams(), _ = () => t || (t = new Promise(async (T, g) => {
|
|
1044
1085
|
var f;
|
|
1045
1086
|
await (e = o.createElement("script")), b.set("libraries", [...p] + "");
|
|
1046
1087
|
for (r in i)
|
|
1047
1088
|
b.set(r.replace(/[A-Z]/g, (v) => "_" + v[0].toLowerCase()), i[r]);
|
|
1048
|
-
b.set("callback", n + ".maps." +
|
|
1089
|
+
b.set("callback", n + ".maps." + h), e.src = `https://maps.${n}apis.com/maps/api/js?` + b, u[h] = T, e.onerror = () => t = g(Error(s + " could not load.")), e.nonce = ((f = o.querySelector("script[nonce]")) == null ? void 0 : f.nonce) || "", o.head.append(e);
|
|
1049
1090
|
}));
|
|
1050
1091
|
u[a] ? console.warn(s + " only loads once. Ignoring:", i) : u[a] = (T, ...g) => p.add(T) && _().then(() => u[a](T, ...g));
|
|
1051
1092
|
}
|
|
1052
|
-
let
|
|
1093
|
+
let gi, mi;
|
|
1053
1094
|
const J = {
|
|
1054
1095
|
/** Google的坐标0点 */
|
|
1055
1096
|
get LATLNG_ZERO() {
|
|
1056
|
-
return
|
|
1097
|
+
return gi ?? (gi = new google.maps.LatLng({ lat: 0, lng: 0 }));
|
|
1057
1098
|
},
|
|
1058
1099
|
get BOUNDS_ZERO() {
|
|
1059
|
-
return
|
|
1100
|
+
return mi ?? (mi = new google.maps.LatLngBounds(this.LATLNG_ZERO, this.LATLNG_ZERO));
|
|
1060
1101
|
}
|
|
1061
1102
|
};
|
|
1062
|
-
function
|
|
1103
|
+
function dr(i, t = { country: "", province: "", city: "", district: "", street: "", streetNumber: "" }) {
|
|
1063
1104
|
for (const e of i)
|
|
1064
1105
|
for (const r of e.types)
|
|
1065
1106
|
switch (r) {
|
|
@@ -1084,9 +1125,9 @@ function lr(i, t = { country: "", province: "", city: "", district: "", street:
|
|
|
1084
1125
|
}
|
|
1085
1126
|
return t;
|
|
1086
1127
|
}
|
|
1087
|
-
function
|
|
1128
|
+
function ur(i, t) {
|
|
1088
1129
|
var r;
|
|
1089
|
-
const e = i.address_components &&
|
|
1130
|
+
const e = i.address_components && dr(i.address_components);
|
|
1090
1131
|
return {
|
|
1091
1132
|
country: (e == null ? void 0 : e.country) ?? "",
|
|
1092
1133
|
province: (e == null ? void 0 : e.province) ?? "",
|
|
@@ -1097,12 +1138,12 @@ function hr(i, t) {
|
|
|
1097
1138
|
title: i.name ?? ""
|
|
1098
1139
|
};
|
|
1099
1140
|
}
|
|
1100
|
-
class
|
|
1141
|
+
class pr {
|
|
1101
1142
|
}
|
|
1102
|
-
class
|
|
1143
|
+
class fi extends pr {
|
|
1103
1144
|
constructor(e, r) {
|
|
1104
1145
|
super();
|
|
1105
|
-
|
|
1146
|
+
c(this, "inner");
|
|
1106
1147
|
this.map = e, this.inner = new google.maps.places.Autocomplete(r.input, {
|
|
1107
1148
|
fields: [
|
|
1108
1149
|
"address_components",
|
|
@@ -1115,7 +1156,7 @@ class gi extends cr {
|
|
|
1115
1156
|
this.inner.setBounds(e.toGoogle(this.map.coordType));
|
|
1116
1157
|
}
|
|
1117
1158
|
addResultListener(e) {
|
|
1118
|
-
return
|
|
1159
|
+
return sr(this.inner, "place_changed", () => {
|
|
1119
1160
|
const r = this.inner.getPlace(), s = {
|
|
1120
1161
|
title: r.name ?? "",
|
|
1121
1162
|
province: "",
|
|
@@ -1125,17 +1166,17 @@ class gi extends cr {
|
|
|
1125
1166
|
streetNumber: "",
|
|
1126
1167
|
country: ""
|
|
1127
1168
|
};
|
|
1128
|
-
r.address_components &&
|
|
1169
|
+
r.address_components && dr(r.address_components, s), e(s);
|
|
1129
1170
|
});
|
|
1130
1171
|
}
|
|
1131
1172
|
}
|
|
1132
|
-
class
|
|
1173
|
+
class yi extends pr {
|
|
1133
1174
|
constructor(e, r) {
|
|
1134
1175
|
super();
|
|
1135
|
-
|
|
1136
|
-
|
|
1176
|
+
c(this, "inner");
|
|
1177
|
+
c(this, "input");
|
|
1137
1178
|
// TODO: 要不要添加个移除监听的方法?
|
|
1138
|
-
|
|
1179
|
+
c(this, "removeableArray", []);
|
|
1139
1180
|
if (this.map = e, this.input = r.input, this.inner = new BMap.Autocomplete({
|
|
1140
1181
|
input: r.input,
|
|
1141
1182
|
location: r.bindToMap ? e.innerMap : void 0
|
|
@@ -1143,7 +1184,7 @@ class mi extends cr {
|
|
|
1143
1184
|
const s = () => {
|
|
1144
1185
|
this.inner.setLocation(this.map.innerMap);
|
|
1145
1186
|
};
|
|
1146
|
-
this.removeableArray.push(
|
|
1187
|
+
this.removeableArray.push(Gt(this.map, "center-changed", s)), this.removeableArray.push(Gt(this.map, "zoom-changed", s));
|
|
1147
1188
|
}
|
|
1148
1189
|
}
|
|
1149
1190
|
setBounds(e) {
|
|
@@ -1151,14 +1192,14 @@ class mi extends cr {
|
|
|
1151
1192
|
}
|
|
1152
1193
|
addResultListener(e) {
|
|
1153
1194
|
let r = 0;
|
|
1154
|
-
const s =
|
|
1155
|
-
const
|
|
1195
|
+
const s = li(this.inner, "confirm", (a) => {
|
|
1196
|
+
const h = a.item.value;
|
|
1156
1197
|
r = Date.now(), e(Object.assign({
|
|
1157
|
-
title:
|
|
1198
|
+
title: h.business,
|
|
1158
1199
|
country: ""
|
|
1159
1200
|
// Baidu的自动完成只支持中国
|
|
1160
|
-
},
|
|
1161
|
-
}), n =
|
|
1201
|
+
}, h));
|
|
1202
|
+
}), n = hi(this.input, "keyup", (a) => {
|
|
1162
1203
|
a.key === "Enter" && Date.now() - r > 100 && e({
|
|
1163
1204
|
title: this.input.value,
|
|
1164
1205
|
country: "",
|
|
@@ -1174,56 +1215,56 @@ class mi extends cr {
|
|
|
1174
1215
|
};
|
|
1175
1216
|
}
|
|
1176
1217
|
}
|
|
1177
|
-
class
|
|
1218
|
+
class gr {
|
|
1178
1219
|
constructor(t) {
|
|
1179
1220
|
this.options = t;
|
|
1180
1221
|
}
|
|
1181
1222
|
}
|
|
1182
|
-
const
|
|
1223
|
+
const zt = class extends gr {
|
|
1183
1224
|
/** @see https://developers.google.com/maps/documentation/urls/get-started#directions-action */
|
|
1184
1225
|
directions(t, e, r) {
|
|
1185
|
-
const s = new URL("dir/",
|
|
1226
|
+
const s = new URL("dir/", zt.BASE_URL), n = new URLSearchParams(Object.entries({
|
|
1186
1227
|
api: "1",
|
|
1187
|
-
origin: K.toString(t,
|
|
1188
|
-
destination: K.toString(e,
|
|
1228
|
+
origin: K.toString(t, S.wgs84),
|
|
1229
|
+
destination: K.toString(e, S.wgs84),
|
|
1189
1230
|
travelmode: r
|
|
1190
|
-
}).filter(
|
|
1231
|
+
}).filter(Qt));
|
|
1191
1232
|
return s.search = "?" + n.toString(), s;
|
|
1192
1233
|
}
|
|
1193
1234
|
};
|
|
1194
|
-
let
|
|
1195
|
-
|
|
1196
|
-
const
|
|
1235
|
+
let Be = zt;
|
|
1236
|
+
c(Be, "BASE_URL", "https://www.google.com/maps/");
|
|
1237
|
+
const Dt = class extends gr {
|
|
1197
1238
|
/** @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 */
|
|
1198
1239
|
directions(t, e, r = "driving") {
|
|
1199
|
-
const s = new URL("direction",
|
|
1240
|
+
const s = new URL("direction", Dt.BASE_URL), n = K.getCoordType(e) ?? K.getCoordType(t) ?? S.bd09, a = K.toString(e, n), h = new URLSearchParams(Object.entries({
|
|
1200
1241
|
// baidu地图, 一定要有起点, 故这里用终点当起点, 防止导航失败
|
|
1201
1242
|
origin: K.toString(t, n) ?? (typeof e != "string" ? `name:请选择起点|latlng:${a}` : a),
|
|
1202
1243
|
destination: a,
|
|
1203
1244
|
// 默认就是bd09
|
|
1204
|
-
coord_type: n ===
|
|
1245
|
+
coord_type: n === S.bd09 ? void 0 : n,
|
|
1205
1246
|
mode: r,
|
|
1206
1247
|
output: "html",
|
|
1207
1248
|
region: "中国",
|
|
1208
1249
|
src: window.location.hostname
|
|
1209
|
-
}).filter(
|
|
1210
|
-
return s.search = "?" +
|
|
1250
|
+
}).filter(Qt));
|
|
1251
|
+
return s.search = "?" + h.toString(), s;
|
|
1211
1252
|
}
|
|
1212
1253
|
};
|
|
1213
|
-
let
|
|
1214
|
-
|
|
1215
|
-
let
|
|
1254
|
+
let Ie = Dt;
|
|
1255
|
+
c(Ie, "BASE_URL", "https://api.map.baidu.com/");
|
|
1256
|
+
let vi = class mr {
|
|
1216
1257
|
constructor(t, e, r) {
|
|
1217
|
-
this.extend(
|
|
1258
|
+
this.extend(mr, 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;
|
|
1218
1259
|
var s = r || {};
|
|
1219
1260
|
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();
|
|
1220
1261
|
var n = this;
|
|
1221
1262
|
google.maps.event.addListener(this.map_, "zoom_changed", function() {
|
|
1222
|
-
var a = n.map_.getZoom(),
|
|
1263
|
+
var a = n.map_.getZoom(), h = n.map_.minZoom || 0, o = Math.min(
|
|
1223
1264
|
n.map_.maxZoom || 100,
|
|
1224
1265
|
n.map_.mapTypes[n.map_.getMapTypeId()].maxZoom
|
|
1225
1266
|
);
|
|
1226
|
-
a = Math.min(Math.max(a,
|
|
1267
|
+
a = Math.min(Math.max(a, h), o), n.prevZoom_ != a && (n.prevZoom_ = a, n.resetViewport());
|
|
1227
1268
|
}), google.maps.event.addListener(this.map_, "idle", function() {
|
|
1228
1269
|
n.redraw();
|
|
1229
1270
|
}), e && (e.length || Object.keys(e).length) && this.addMarkers(e, !1);
|
|
@@ -1466,8 +1507,8 @@ let fi = class ur {
|
|
|
1466
1507
|
*/
|
|
1467
1508
|
removeMarkers(t, e) {
|
|
1468
1509
|
for (var r = t === this.getMarkers() ? t.slice() : t, s = !1, n = 0, a; a = r[n]; n++) {
|
|
1469
|
-
var
|
|
1470
|
-
s = s ||
|
|
1510
|
+
var h = this.removeMarker_(a);
|
|
1511
|
+
s = s || h;
|
|
1471
1512
|
}
|
|
1472
1513
|
if (!e && s)
|
|
1473
1514
|
return this.resetViewport(), this.redraw(), !0;
|
|
@@ -1554,8 +1595,8 @@ let fi = class ur {
|
|
|
1554
1595
|
n.x += this.gridSize_, n.y -= this.gridSize_;
|
|
1555
1596
|
var a = e.fromLatLngToDivPixel(s);
|
|
1556
1597
|
a.x -= this.gridSize_, a.y += this.gridSize_;
|
|
1557
|
-
var
|
|
1558
|
-
return t.extend(
|
|
1598
|
+
var h = e.fromDivPixelToLatLng(n), o = e.fromDivPixelToLatLng(a);
|
|
1599
|
+
return t.extend(h), t.extend(o), t;
|
|
1559
1600
|
}
|
|
1560
1601
|
/**
|
|
1561
1602
|
* Determins if a marker is contained in a bounds.
|
|
@@ -1613,7 +1654,7 @@ let fi = class ur {
|
|
|
1613
1654
|
distanceBetweenPoints_(t, e) {
|
|
1614
1655
|
if (!t || !e)
|
|
1615
1656
|
return 0;
|
|
1616
|
-
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),
|
|
1657
|
+
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), h = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)), o = r * h;
|
|
1617
1658
|
return o;
|
|
1618
1659
|
}
|
|
1619
1660
|
/**
|
|
@@ -1626,14 +1667,14 @@ let fi = class ur {
|
|
|
1626
1667
|
for (var e = 4e4, r = null, s = 0, n; n = this.clusters_[s]; s++) {
|
|
1627
1668
|
var a = n.getCenter();
|
|
1628
1669
|
if (a) {
|
|
1629
|
-
var
|
|
1630
|
-
|
|
1670
|
+
var h = this.distanceBetweenPoints_(a, t.getPosition());
|
|
1671
|
+
h < e && (e = h, r = n);
|
|
1631
1672
|
}
|
|
1632
1673
|
}
|
|
1633
1674
|
if (r && r.isMarkerInClusterBounds(t))
|
|
1634
1675
|
r.addMarker(t);
|
|
1635
1676
|
else {
|
|
1636
|
-
var o = new
|
|
1677
|
+
var o = new _i(this);
|
|
1637
1678
|
o.addMarker(t), this.clusters_.push(o);
|
|
1638
1679
|
}
|
|
1639
1680
|
}
|
|
@@ -1650,9 +1691,9 @@ let fi = class ur {
|
|
|
1650
1691
|
), e = this.getExtendedBounds(t), r = 0, s; s = this.markers_[r]; r++)
|
|
1651
1692
|
!s.isAdded && this.isMarkerInBounds_(s, e) && this.addToClosestCluster_(s);
|
|
1652
1693
|
}
|
|
1653
|
-
},
|
|
1694
|
+
}, _i = class {
|
|
1654
1695
|
constructor(t) {
|
|
1655
|
-
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
|
|
1696
|
+
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 mt(
|
|
1656
1697
|
this,
|
|
1657
1698
|
t.getStyles(),
|
|
1658
1699
|
t.getGridSize()
|
|
@@ -1786,9 +1827,9 @@ let fi = class ur {
|
|
|
1786
1827
|
this.clusterIcon_.setCenter(this.center_), this.clusterIcon_.setSums(a), this.clusterIcon_.show();
|
|
1787
1828
|
}
|
|
1788
1829
|
};
|
|
1789
|
-
class
|
|
1830
|
+
class mt {
|
|
1790
1831
|
constructor(t, e, r) {
|
|
1791
|
-
t.getMarkerClusterer().extend(
|
|
1832
|
+
t.getMarkerClusterer().extend(mt, google.maps.OverlayView), this.styles_ = e, this.padding_ = r || 0, this.cluster_ = t, this.center_ = null, this.map_ = t.getMap(), this.div_ = null, this.sums_ = null, this.visible_ = !1, this.setMap(this.map_);
|
|
1792
1833
|
}
|
|
1793
1834
|
/**
|
|
1794
1835
|
* Triggers the clusterclick event and zoom's if the option is set.
|
|
@@ -1919,11 +1960,11 @@ class pt {
|
|
|
1919
1960
|
), e.join("");
|
|
1920
1961
|
}
|
|
1921
1962
|
}
|
|
1922
|
-
var
|
|
1963
|
+
var fr = { exports: {} };
|
|
1923
1964
|
(function(i, t) {
|
|
1924
1965
|
(function(e, r) {
|
|
1925
1966
|
i.exports = r();
|
|
1926
|
-
})(
|
|
1967
|
+
})(Kt, function() {
|
|
1927
1968
|
var e, r = e = r || { version: "1.3.8" }, s = {};
|
|
1928
1969
|
r.guid = "$BAIDU$", s[r.guid] = s[r.guid] || {}, r.dom = r.dom || {}, r.dom.g = function(o) {
|
|
1929
1970
|
return typeof o == "string" || o instanceof String ? document.getElementById(o) : o && o.nodeName && (o.nodeType == 1 || o.nodeType == 9) ? o : null;
|
|
@@ -1935,55 +1976,55 @@ var pr = { exports: {} };
|
|
|
1935
1976
|
return r.lang.isString(o) ? document.getElementById(o) : o;
|
|
1936
1977
|
}, 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) {
|
|
1937
1978
|
o = r.dom._g(o);
|
|
1938
|
-
var
|
|
1939
|
-
return
|
|
1940
|
-
}, r.dom._styleFixer = r.dom._styleFixer || {}, r.dom._styleFilter = r.dom._styleFilter || [], r.dom._styleFilter.filter = function(o, l,
|
|
1979
|
+
var d = r.dom.getDocument(o), u;
|
|
1980
|
+
return d.defaultView && d.defaultView.getComputedStyle && (u = d.defaultView.getComputedStyle(o, null), u) ? u[l] || u.getPropertyValue(l) : "";
|
|
1981
|
+
}, r.dom._styleFixer = r.dom._styleFixer || {}, r.dom._styleFilter = r.dom._styleFilter || [], r.dom._styleFilter.filter = function(o, l, d) {
|
|
1941
1982
|
for (var u = 0, p = r.dom._styleFilter, b; b = p[u]; u++)
|
|
1942
|
-
(b = b[
|
|
1983
|
+
(b = b[d]) && (l = b(o, l));
|
|
1943
1984
|
return l;
|
|
1944
1985
|
}, r.string = r.string || {}, r.string.toCamelCase = function(o) {
|
|
1945
1986
|
return o.indexOf("-") < 0 && o.indexOf("_") < 0 ? o : o.replace(/[-_][^-_]/g, function(l) {
|
|
1946
1987
|
return l.charAt(1).toUpperCase();
|
|
1947
1988
|
});
|
|
1948
1989
|
}, r.dom.getStyle = function(o, l) {
|
|
1949
|
-
var
|
|
1950
|
-
o =
|
|
1951
|
-
var u = o.style[l] || (o.currentStyle ? o.currentStyle[l] : "") ||
|
|
1990
|
+
var d = r.dom;
|
|
1991
|
+
o = d.g(o), l = r.string.toCamelCase(l);
|
|
1992
|
+
var u = o.style[l] || (o.currentStyle ? o.currentStyle[l] : "") || d.getComputedStyle(o, l);
|
|
1952
1993
|
if (!u) {
|
|
1953
|
-
var p =
|
|
1994
|
+
var p = d._styleFixer[l];
|
|
1954
1995
|
p && (u = p.get ? p.get(o) : r.dom.getStyle(o, p));
|
|
1955
1996
|
}
|
|
1956
|
-
return (p =
|
|
1997
|
+
return (p = d._styleFilter) && (u = p.filter(l, u, "get")), u;
|
|
1957
1998
|
}, 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) {
|
|
1958
1999
|
o = r.dom.g(o);
|
|
1959
|
-
var l = r.dom.getDocument(o),
|
|
1960
|
-
|
|
1961
|
-
var p = { left: 0, top: 0 }, b =
|
|
2000
|
+
var l = r.dom.getDocument(o), d = r.browser, u = r.dom.getStyle;
|
|
2001
|
+
d.isGecko > 0 && l.getBoxObjectFor && u(o, "position") == "absolute" && (o.style.top === "" || o.style.left);
|
|
2002
|
+
var p = { left: 0, top: 0 }, b = d.ie && !d.isStrict ? l.body : l.documentElement, _, T;
|
|
1962
2003
|
if (o == b)
|
|
1963
2004
|
return p;
|
|
1964
2005
|
if (o.getBoundingClientRect) {
|
|
1965
2006
|
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;
|
|
1966
2007
|
var g = l.body, f = parseInt(u(g, "borderLeftWidth")), v = parseInt(u(g, "borderTopWidth"));
|
|
1967
|
-
|
|
2008
|
+
d.ie && !d.isStrict && (p.left -= isNaN(f) ? 2 : f, p.top -= isNaN(v) ? 2 : v);
|
|
1968
2009
|
} else {
|
|
1969
2010
|
_ = o;
|
|
1970
2011
|
do {
|
|
1971
|
-
if (p.left += _.offsetLeft, p.top += _.offsetTop,
|
|
2012
|
+
if (p.left += _.offsetLeft, p.top += _.offsetTop, d.isWebkit > 0 && u(_, "position") == "fixed") {
|
|
1972
2013
|
p.left += l.body.scrollLeft, p.top += l.body.scrollTop;
|
|
1973
2014
|
break;
|
|
1974
2015
|
}
|
|
1975
2016
|
_ = _.offsetParent;
|
|
1976
2017
|
} while (_ && _ != o);
|
|
1977
|
-
for ((
|
|
1978
|
-
p.left -= _.scrollLeft, (!
|
|
2018
|
+
for ((d.opera > 0 || d.isWebkit > 0 && u(o, "position") == "absolute") && (p.top -= l.body.offsetTop), _ = o.offsetParent; _ && _ != l.body; )
|
|
2019
|
+
p.left -= _.scrollLeft, (!d.opera || _.tagName != "TR") && (p.top -= _.scrollTop), _ = _.offsetParent;
|
|
1979
2020
|
}
|
|
1980
2021
|
return p;
|
|
1981
|
-
}, r.event = r.event || {}, r.event._listeners = r.event._listeners || [], r.event.on = function(o, l,
|
|
2022
|
+
}, r.event = r.event || {}, r.event._listeners = r.event._listeners || [], r.event.on = function(o, l, d) {
|
|
1982
2023
|
l = l.replace(/^on/i, ""), o = r.dom._g(o);
|
|
1983
2024
|
var u = function(g) {
|
|
1984
|
-
|
|
2025
|
+
d.call(o, g);
|
|
1985
2026
|
}, p = r.event._listeners, b = r.event._eventFilter, _, T = l;
|
|
1986
|
-
return l = l.toLowerCase(), b && b[l] && (_ = b[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,
|
|
2027
|
+
return l = l.toLowerCase(), b && b[l] && (_ = b[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, d, u, T], o;
|
|
1987
2028
|
}, r.on = r.event.on, function() {
|
|
1988
2029
|
var o = s[r.guid];
|
|
1989
2030
|
r.lang.guid = function() {
|
|
@@ -2002,87 +2043,87 @@ var pr = { exports: {} };
|
|
|
2002
2043
|
return "[object " + (this._className || "Object") + "]";
|
|
2003
2044
|
}, r.lang.Event = function(o, l) {
|
|
2004
2045
|
this.type = o, this.returnValue = !0, this.target = l || null, this.currentTarget = null;
|
|
2005
|
-
}, r.lang.Class.prototype.addEventListener = function(o, l,
|
|
2046
|
+
}, r.lang.Class.prototype.addEventListener = function(o, l, d) {
|
|
2006
2047
|
if (r.lang.isFunction(l)) {
|
|
2007
2048
|
!this.__listeners && (this.__listeners = {});
|
|
2008
2049
|
var u = this.__listeners, p;
|
|
2009
|
-
if (typeof
|
|
2010
|
-
if (/[^\w\-]/.test(
|
|
2011
|
-
throw "nonstandard key:" +
|
|
2012
|
-
l.hashCode =
|
|
2050
|
+
if (typeof d == "string" && d) {
|
|
2051
|
+
if (/[^\w\-]/.test(d))
|
|
2052
|
+
throw "nonstandard key:" + d;
|
|
2053
|
+
l.hashCode = d, p = d;
|
|
2013
2054
|
}
|
|
2014
2055
|
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;
|
|
2015
2056
|
}
|
|
2016
2057
|
}, r.lang.Class.prototype.removeEventListener = function(o, l) {
|
|
2017
2058
|
if (!(typeof l < "u" && (r.lang.isFunction(l) && !(l = l.hashCode) || !r.lang.isString(l)))) {
|
|
2018
2059
|
!this.__listeners && (this.__listeners = {}), o.indexOf("on") != 0 && (o = "on" + o);
|
|
2019
|
-
var
|
|
2020
|
-
if (
|
|
2060
|
+
var d = this.__listeners;
|
|
2061
|
+
if (d[o])
|
|
2021
2062
|
if (typeof l < "u")
|
|
2022
|
-
|
|
2063
|
+
d[o][l] && delete d[o][l];
|
|
2023
2064
|
else
|
|
2024
|
-
for (var u in
|
|
2025
|
-
delete
|
|
2065
|
+
for (var u in d[o])
|
|
2066
|
+
delete d[o][u];
|
|
2026
2067
|
}
|
|
2027
2068
|
}, r.lang.Class.prototype.dispatchEvent = function(o, l) {
|
|
2028
2069
|
r.lang.isString(o) && (o = new r.lang.Event(o)), !this.__listeners && (this.__listeners = {}), l = l || {};
|
|
2029
|
-
for (var
|
|
2030
|
-
o[
|
|
2031
|
-
var
|
|
2070
|
+
for (var d in l)
|
|
2071
|
+
o[d] = l[d];
|
|
2072
|
+
var d, u = this.__listeners, p = o.type;
|
|
2032
2073
|
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")
|
|
2033
|
-
for (
|
|
2034
|
-
u[p][
|
|
2074
|
+
for (d in u[p])
|
|
2075
|
+
u[p][d].apply(this, arguments);
|
|
2035
2076
|
return o.returnValue;
|
|
2036
|
-
}, r.lang.inherits = function(o, l,
|
|
2077
|
+
}, r.lang.inherits = function(o, l, d) {
|
|
2037
2078
|
var u, p, b = o.prototype, _ = new Function();
|
|
2038
2079
|
_.prototype = l.prototype, p = o.prototype = new _();
|
|
2039
2080
|
for (u in b)
|
|
2040
2081
|
p[u] = b[u];
|
|
2041
|
-
o.prototype.constructor = o, o.superClass = l.prototype, typeof
|
|
2082
|
+
o.prototype.constructor = o, o.superClass = l.prototype, typeof d == "string" && (p._className = d);
|
|
2042
2083
|
}, r.inherits = r.lang.inherits;
|
|
2043
|
-
var n = "http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m", a = "png",
|
|
2084
|
+
var n = "http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m", a = "png", h = function(o, l, d) {
|
|
2044
2085
|
try {
|
|
2045
2086
|
BMap;
|
|
2046
2087
|
} catch {
|
|
2047
2088
|
throw Error("Baidu Map JS API is not ready yet!");
|
|
2048
2089
|
}
|
|
2049
|
-
e.lang.inherits(
|
|
2090
|
+
e.lang.inherits(h, BMap.Overlay, "TextIconOverlay"), this._position = o, this._text = l, this._options = d || {}, this._styles = this._options.styles || [], this._zIndex = this._options.zIndex, !this._styles.length && this._setupDefaultStyles();
|
|
2050
2091
|
};
|
|
2051
|
-
return
|
|
2052
|
-
for (var o = [53, 56, 66, 78, 90], l = 0,
|
|
2092
|
+
return h.prototype._setupDefaultStyles = function() {
|
|
2093
|
+
for (var o = [53, 56, 66, 78, 90], l = 0, d; d = o[l]; l++)
|
|
2053
2094
|
this._styles.push({
|
|
2054
2095
|
url: n + l + "." + a,
|
|
2055
|
-
size: new BMap.Size(
|
|
2096
|
+
size: new BMap.Size(d, d)
|
|
2056
2097
|
});
|
|
2057
|
-
},
|
|
2098
|
+
}, h.prototype.initialize = function(o) {
|
|
2058
2099
|
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;
|
|
2059
|
-
},
|
|
2100
|
+
}, h.prototype.draw = function() {
|
|
2060
2101
|
this._map && this._updatePosition();
|
|
2061
|
-
},
|
|
2102
|
+
}, h.prototype.getText = function() {
|
|
2062
2103
|
return this._text;
|
|
2063
|
-
},
|
|
2104
|
+
}, h.prototype.setText = function(o) {
|
|
2064
2105
|
o && (!this._text || this._text.toString() != o.toString()) && (this._text = o, this._updateText(), this._updateCss(), this._updatePosition());
|
|
2065
|
-
},
|
|
2106
|
+
}, h.prototype.getPosition = function() {
|
|
2066
2107
|
return this._position;
|
|
2067
|
-
},
|
|
2108
|
+
}, h.prototype.setPosition = function(o) {
|
|
2068
2109
|
o && (!this._position || !this._position.equals(o)) && (this._position = o, this._updatePosition());
|
|
2069
|
-
},
|
|
2070
|
-
var
|
|
2110
|
+
}, h.prototype.getStyleByText = function(o, l) {
|
|
2111
|
+
var d = parseInt(o), u = parseInt(d / 10);
|
|
2071
2112
|
return u = Math.max(0, u), u = Math.min(u, l.length - 1), l[u];
|
|
2072
|
-
},
|
|
2113
|
+
}, h.prototype._updateCss = function() {
|
|
2073
2114
|
if (this._domElement) {
|
|
2074
2115
|
var o = this.getStyleByText(this._text, this._styles);
|
|
2075
2116
|
this._domElement.style.cssText = this._buildCssText(o);
|
|
2076
2117
|
}
|
|
2077
|
-
},
|
|
2118
|
+
}, h.prototype._updateText = function() {
|
|
2078
2119
|
this._domElement && (this._domElement.innerHTML = this._text);
|
|
2079
|
-
},
|
|
2120
|
+
}, h.prototype._updatePosition = function() {
|
|
2080
2121
|
if (this._domElement && this._position) {
|
|
2081
2122
|
var o = this._domElement.style, l = this._map.pointToOverlayPixel(this._position);
|
|
2082
2123
|
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";
|
|
2083
2124
|
}
|
|
2084
|
-
},
|
|
2085
|
-
var l = o.url,
|
|
2125
|
+
}, h.prototype._buildCssText = function(o) {
|
|
2126
|
+
var l = o.url, d = o.size, u = o.anchor, p = o.offset, b = o.textColor || "black", _ = o.textSize || 10, T = [];
|
|
2086
2127
|
if (this._zIndex && T.push("z-index:" + this._zIndex + ";"), e.browser.ie < 7)
|
|
2087
2128
|
T.push('filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="' + l + '");');
|
|
2088
2129
|
else {
|
|
@@ -2090,11 +2131,11 @@ var pr = { exports: {} };
|
|
|
2090
2131
|
var g = "0 0";
|
|
2091
2132
|
p instanceof BMap.Size && (g = p.width + "px " + p.height + "px"), T.push("background-position:" + g + ";");
|
|
2092
2133
|
}
|
|
2093
|
-
return
|
|
2094
|
-
},
|
|
2134
|
+
return d instanceof BMap.Size && (u instanceof BMap.Size ? (u.height > 0 && u.height < d.height && T.push("height:" + (d.height - u.height) + "px; padding-top:" + u.height + "px;"), u.width > 0 && u.width < d.width && T.push("width:" + (d.width - u.width) + "px; padding-left:" + u.width + "px;")) : (T.push("height:" + d.height + "px; line-height:" + d.height + "px;"), T.push("width:" + d.width + "px; text-align:center;"))), T.push("cursor:pointer; color:" + b + "; position:absolute; font-size:" + _ + "px; font-family:Arial,sans-serif; font-weight:bold"), T.join("");
|
|
2135
|
+
}, h.prototype._bind = function() {
|
|
2095
2136
|
if (!this._domElement)
|
|
2096
2137
|
return;
|
|
2097
|
-
var o = this, l = this._map,
|
|
2138
|
+
var o = this, l = this._map, d = e.lang.Event;
|
|
2098
2139
|
function u(p, b) {
|
|
2099
2140
|
var _ = p.srcElement || p.target, T = p.clientX || p.pageX, g = p.clientY || p.pageY;
|
|
2100
2141
|
if (p && b && T && g && _) {
|
|
@@ -2104,33 +2145,33 @@ var pr = { exports: {} };
|
|
|
2104
2145
|
return b;
|
|
2105
2146
|
}
|
|
2106
2147
|
e.event.on(this._domElement, "mouseover", function(p) {
|
|
2107
|
-
o.dispatchEvent(u(p, new
|
|
2148
|
+
o.dispatchEvent(u(p, new d("onmouseover")));
|
|
2108
2149
|
}), e.event.on(this._domElement, "mouseout", function(p) {
|
|
2109
|
-
o.dispatchEvent(u(p, new
|
|
2150
|
+
o.dispatchEvent(u(p, new d("onmouseout")));
|
|
2110
2151
|
}), e.event.on(this._domElement, "click", function(p) {
|
|
2111
|
-
o.dispatchEvent(u(p, new
|
|
2152
|
+
o.dispatchEvent(u(p, new d("onclick")));
|
|
2112
2153
|
});
|
|
2113
|
-
},
|
|
2154
|
+
}, h;
|
|
2114
2155
|
});
|
|
2115
|
-
})(
|
|
2116
|
-
var
|
|
2117
|
-
const
|
|
2118
|
-
var
|
|
2119
|
-
t =
|
|
2156
|
+
})(fr);
|
|
2157
|
+
var bi = fr.exports;
|
|
2158
|
+
const Wt = /* @__PURE__ */ nt(bi);
|
|
2159
|
+
var yr = function(i, t, e) {
|
|
2160
|
+
t = Ti(t);
|
|
2120
2161
|
var r = i.pointToPixel(t.getNorthEast()), s = i.pointToPixel(t.getSouthWest());
|
|
2121
2162
|
r.x += e, r.y -= e, s.x -= e, s.y += e;
|
|
2122
2163
|
var n = i.pixelToPoint(r), a = i.pixelToPoint(s);
|
|
2123
2164
|
return new BMap.Bounds(a, n);
|
|
2124
|
-
},
|
|
2125
|
-
var t =
|
|
2165
|
+
}, Ti = function(i) {
|
|
2166
|
+
var t = Pe(i.getNorthEast().lng, -180, 180), e = Pe(i.getSouthWest().lng, -180, 180), r = Pe(i.getNorthEast().lat, -74, 74), s = Pe(i.getSouthWest().lat, -74, 74);
|
|
2126
2167
|
return new BMap.Bounds(new BMap.Point(e, s), new BMap.Point(t, r));
|
|
2127
|
-
},
|
|
2168
|
+
}, Pe = function(i, t, e) {
|
|
2128
2169
|
return t && (i = Math.max(i, t)), e && (i = Math.min(i, e)), i;
|
|
2129
|
-
},
|
|
2170
|
+
}, vr = function(i) {
|
|
2130
2171
|
return Object.prototype.toString.call(i) === "[object Array]";
|
|
2131
|
-
},
|
|
2172
|
+
}, _r = function(i, t) {
|
|
2132
2173
|
var e = -1;
|
|
2133
|
-
if (
|
|
2174
|
+
if (vr(t)) {
|
|
2134
2175
|
if (t.indexOf)
|
|
2135
2176
|
e = t.indexOf(i);
|
|
2136
2177
|
else
|
|
@@ -2158,7 +2199,7 @@ var gr = function(i, t, e) {
|
|
|
2158
2199
|
r._redraw();
|
|
2159
2200
|
});
|
|
2160
2201
|
var s = e.markers;
|
|
2161
|
-
|
|
2202
|
+
vr(s) && this.addMarkers(s);
|
|
2162
2203
|
}
|
|
2163
2204
|
};
|
|
2164
2205
|
M.prototype.addMarkers = function(i) {
|
|
@@ -2169,7 +2210,7 @@ M.prototype.addMarkers = function(i) {
|
|
|
2169
2210
|
}
|
|
2170
2211
|
};
|
|
2171
2212
|
M.prototype._pushMarkerTo = function(i) {
|
|
2172
|
-
var t =
|
|
2213
|
+
var t = _r(i, this._markers);
|
|
2173
2214
|
t === -1 && (i.isInCluster = !1, this._markers.push(i));
|
|
2174
2215
|
};
|
|
2175
2216
|
M.prototype.addMarker = function(i) {
|
|
@@ -2178,7 +2219,7 @@ M.prototype.addMarker = function(i) {
|
|
|
2178
2219
|
M.prototype._createClusters = function() {
|
|
2179
2220
|
var i = this._map.getBounds();
|
|
2180
2221
|
if (i.getCenter()) {
|
|
2181
|
-
for (var t =
|
|
2222
|
+
for (var t = yr(this._map, i, this._gridSize), e = 0, r; r = this._markers[e]; e++)
|
|
2182
2223
|
!r.isInCluster && t.containsPoint(r.getPosition()) && this._addToClosestCluster(r);
|
|
2183
2224
|
for (var s = this._markers.length, e = 0; e < s; e++)
|
|
2184
2225
|
this._clusters[e] && this._clusters[e].render();
|
|
@@ -2197,7 +2238,7 @@ M.prototype._addToClosestCluster = function(i) {
|
|
|
2197
2238
|
if (e && e.isMarkerInClusterBounds(i))
|
|
2198
2239
|
e.addMarker(i);
|
|
2199
2240
|
else {
|
|
2200
|
-
var s = new
|
|
2241
|
+
var s = new N(this);
|
|
2201
2242
|
s.addMarker(i), this._clusters.push(s);
|
|
2202
2243
|
}
|
|
2203
2244
|
};
|
|
@@ -2218,7 +2259,7 @@ M.prototype._removeMarkersFromMap = function() {
|
|
|
2218
2259
|
}
|
|
2219
2260
|
};
|
|
2220
2261
|
M.prototype._removeMarker = function(i) {
|
|
2221
|
-
var t =
|
|
2262
|
+
var t = _r(i, this._markers);
|
|
2222
2263
|
return t === -1 ? !1 : (this._map.removeOverlay(i), this._markers.splice(t, 1), !0);
|
|
2223
2264
|
};
|
|
2224
2265
|
M.prototype.removeMarker = function(i) {
|
|
@@ -2292,9 +2333,9 @@ M.prototype.setTextCalculator = function(i) {
|
|
|
2292
2333
|
M.prototype.setStylesIndexCalculator = function(i) {
|
|
2293
2334
|
this._stylesIndexCalculator = i;
|
|
2294
2335
|
};
|
|
2295
|
-
function
|
|
2336
|
+
function N(i) {
|
|
2296
2337
|
var t = this;
|
|
2297
|
-
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
|
|
2338
|
+
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 Wt(this._center, this._markers.length, {
|
|
2298
2339
|
styles: this._markerClusterer.getStyles(),
|
|
2299
2340
|
zIndex: i._zIndex
|
|
2300
2341
|
}), this._clusterMarker.getStyleByText = function(e, r) {
|
|
@@ -2302,12 +2343,12 @@ function z(i) {
|
|
|
2302
2343
|
var s = t._markerClusterer._stylesIndexCalculator(t._markers, r.length);
|
|
2303
2344
|
return r[s];
|
|
2304
2345
|
}
|
|
2305
|
-
return
|
|
2346
|
+
return Wt.prototype.getStyleByText.call(this, e, r);
|
|
2306
2347
|
}, this._clusterMarker.addEventListener && this._clusterMarker.addEventListener("click", function(e) {
|
|
2307
2348
|
t._map.setViewport(t.getBounds());
|
|
2308
2349
|
});
|
|
2309
2350
|
}
|
|
2310
|
-
|
|
2351
|
+
N.prototype.addMarker = function(i) {
|
|
2311
2352
|
if (this.isMarkerInCluster(i))
|
|
2312
2353
|
return !1;
|
|
2313
2354
|
if (!this._center)
|
|
@@ -2318,7 +2359,7 @@ z.prototype.addMarker = function(i) {
|
|
|
2318
2359
|
}
|
|
2319
2360
|
return i.isInCluster = !0, this._markers.push(i), !0;
|
|
2320
2361
|
};
|
|
2321
|
-
|
|
2362
|
+
N.prototype.render = function() {
|
|
2322
2363
|
var i = this._markers.length;
|
|
2323
2364
|
if (i < this._minClusterSize)
|
|
2324
2365
|
for (var t = 0; t < i; t++)
|
|
@@ -2326,7 +2367,7 @@ z.prototype.render = function() {
|
|
|
2326
2367
|
else
|
|
2327
2368
|
this._map.addOverlay(this._clusterMarker), this._isReal = !0, this.updateClusterMarker();
|
|
2328
2369
|
};
|
|
2329
|
-
|
|
2370
|
+
N.prototype.isMarkerInCluster = function(i) {
|
|
2330
2371
|
if (this._markers.indexOf)
|
|
2331
2372
|
return this._markers.indexOf(i) != -1;
|
|
2332
2373
|
for (var t = 0, e; e = this._markers[t]; t++)
|
|
@@ -2334,17 +2375,17 @@ z.prototype.isMarkerInCluster = function(i) {
|
|
|
2334
2375
|
return !0;
|
|
2335
2376
|
return !1;
|
|
2336
2377
|
};
|
|
2337
|
-
|
|
2378
|
+
N.prototype.isMarkerInClusterBounds = function(i) {
|
|
2338
2379
|
return this._gridBounds.containsPoint(i.getPosition());
|
|
2339
2380
|
};
|
|
2340
|
-
|
|
2381
|
+
N.prototype.isReal = function(i) {
|
|
2341
2382
|
return this._isReal;
|
|
2342
2383
|
};
|
|
2343
|
-
|
|
2384
|
+
N.prototype.updateGridBounds = function() {
|
|
2344
2385
|
var i = new BMap.Bounds(this._center, this._center);
|
|
2345
|
-
this._gridBounds =
|
|
2386
|
+
this._gridBounds = yr(this._map, i, this._markerClusterer.getGridSize());
|
|
2346
2387
|
};
|
|
2347
|
-
|
|
2388
|
+
N.prototype.updateClusterMarker = function() {
|
|
2348
2389
|
if (this._map.getZoom() > this._markerClusterer.getMaxZoom()) {
|
|
2349
2390
|
this._clusterMarker && this._map.removeOverlay(this._clusterMarker);
|
|
2350
2391
|
for (var i = 0, t; t = this._markers[i]; i++)
|
|
@@ -2357,19 +2398,19 @@ z.prototype.updateClusterMarker = function() {
|
|
|
2357
2398
|
}
|
|
2358
2399
|
this._clusterMarker.setPosition(this._center), this._clusterMarker.setText(this._markerClusterer._textCalculator(this._markers));
|
|
2359
2400
|
};
|
|
2360
|
-
|
|
2401
|
+
N.prototype.remove = function() {
|
|
2361
2402
|
for (var i = 0, t; t = this._markers[i]; i++) {
|
|
2362
2403
|
var e = this._markers[i].getLabel();
|
|
2363
2404
|
this._markers[i].getMap() && this._map.removeOverlay(this._markers[i]), this._markers[i].setLabel(e);
|
|
2364
2405
|
}
|
|
2365
2406
|
this._map.removeOverlay(this._clusterMarker), this._markers.length = 0, delete this._markers;
|
|
2366
2407
|
};
|
|
2367
|
-
|
|
2408
|
+
N.prototype.getBounds = function() {
|
|
2368
2409
|
for (var i = new BMap.Bounds(this._center, this._center), t = 0, e; e = this._markers[t]; t++)
|
|
2369
2410
|
i.extend(e.getPosition());
|
|
2370
2411
|
return i;
|
|
2371
2412
|
};
|
|
2372
|
-
|
|
2413
|
+
N.prototype.getCenter = function() {
|
|
2373
2414
|
return this._center;
|
|
2374
2415
|
};
|
|
2375
2416
|
var Re;
|
|
@@ -2398,9 +2439,8 @@ var Re;
|
|
|
2398
2439
|
}
|
|
2399
2440
|
i.toGoogle = e;
|
|
2400
2441
|
})(Re || (Re = {}));
|
|
2401
|
-
class
|
|
2442
|
+
class br {
|
|
2402
2443
|
constructor(t) {
|
|
2403
|
-
h(this, "inner");
|
|
2404
2444
|
this.map = t;
|
|
2405
2445
|
}
|
|
2406
2446
|
/** baidu/google 拥有相同的函数名 */
|
|
@@ -2424,61 +2464,65 @@ class yr {
|
|
|
2424
2464
|
return this.inner.removeMarkers(t.map((e) => e.innerOverlay));
|
|
2425
2465
|
}
|
|
2426
2466
|
}
|
|
2427
|
-
class
|
|
2428
|
-
constructor(
|
|
2429
|
-
var
|
|
2430
|
-
super(
|
|
2467
|
+
class Mi extends br {
|
|
2468
|
+
constructor(e, r) {
|
|
2469
|
+
var n;
|
|
2470
|
+
super(e);
|
|
2471
|
+
c(this, "inner");
|
|
2472
|
+
this.inner = new M(e.innerMap, {
|
|
2431
2473
|
// baidu的构造器中的markers, 会触发重绘, 会导致使用旧的calculator计算cluster
|
|
2432
2474
|
// markers: options.markers?.map(it => (it as BaiduMarker).innerOverlay),
|
|
2433
|
-
gridSize:
|
|
2434
|
-
maxZoom:
|
|
2435
|
-
minClusterSize:
|
|
2436
|
-
isAverageCenter:
|
|
2437
|
-
styles: (
|
|
2438
|
-
zIndex:
|
|
2475
|
+
gridSize: r.gridSize,
|
|
2476
|
+
maxZoom: r.maxZoom,
|
|
2477
|
+
minClusterSize: r.minClusterSize,
|
|
2478
|
+
isAverageCenter: r.averageCenter,
|
|
2479
|
+
styles: (n = r.styles) == null ? void 0 : n.map((a) => Re.toBaidu(a)),
|
|
2480
|
+
zIndex: r.zIndex
|
|
2439
2481
|
});
|
|
2440
|
-
const
|
|
2441
|
-
|
|
2482
|
+
const s = r.stylesIndexCalculator;
|
|
2483
|
+
s && this.inner.setStylesIndexCalculator((a, h) => s(a.length, h)), r.markers && this.addMarkers(r.markers);
|
|
2442
2484
|
}
|
|
2443
2485
|
recreate() {
|
|
2444
2486
|
this.inner._redraw();
|
|
2445
2487
|
}
|
|
2446
2488
|
}
|
|
2447
|
-
class
|
|
2448
|
-
constructor(
|
|
2449
|
-
var
|
|
2450
|
-
super(
|
|
2451
|
-
|
|
2489
|
+
class Oi extends br {
|
|
2490
|
+
constructor(e, r) {
|
|
2491
|
+
var n, a;
|
|
2492
|
+
super(e);
|
|
2493
|
+
c(this, "inner");
|
|
2494
|
+
this.inner = new vi(
|
|
2495
|
+
e.innerMap,
|
|
2452
2496
|
// google的构造器中的markers,不会触发重绘, 第一次绘制通过监听地图的'idle'事件触发, 可以直接设置
|
|
2453
|
-
(
|
|
2497
|
+
(n = r.markers) == null ? void 0 : n.map((h) => h.innerOverlay),
|
|
2454
2498
|
{
|
|
2455
|
-
gridSize:
|
|
2456
|
-
maxZoom:
|
|
2457
|
-
minimumClusterSize:
|
|
2458
|
-
averageCenter:
|
|
2459
|
-
styles: (
|
|
2460
|
-
zIndex:
|
|
2499
|
+
gridSize: r.gridSize,
|
|
2500
|
+
maxZoom: r.maxZoom,
|
|
2501
|
+
minimumClusterSize: r.minClusterSize,
|
|
2502
|
+
averageCenter: r.averageCenter,
|
|
2503
|
+
styles: (a = r.styles) == null ? void 0 : a.map((h) => Re.toGoogle(h)),
|
|
2504
|
+
zIndex: r.zIndex
|
|
2461
2505
|
}
|
|
2462
2506
|
);
|
|
2463
|
-
const
|
|
2464
|
-
|
|
2465
|
-
text:
|
|
2507
|
+
const s = r.stylesIndexCalculator;
|
|
2508
|
+
s && this.inner.setCalculator((h, o) => ({
|
|
2509
|
+
text: h.length,
|
|
2466
2510
|
// google内部, 取index时, 会`-1`...故我们这里`+1`, 抵消掉它
|
|
2467
|
-
index:
|
|
2511
|
+
index: s(h.length, o) + 1
|
|
2468
2512
|
}));
|
|
2469
2513
|
}
|
|
2470
2514
|
recreate() {
|
|
2471
2515
|
this.inner.repaint();
|
|
2472
2516
|
}
|
|
2473
2517
|
}
|
|
2474
|
-
class
|
|
2518
|
+
class Tr {
|
|
2475
2519
|
constructor() {
|
|
2476
2520
|
}
|
|
2477
2521
|
}
|
|
2478
|
-
class
|
|
2522
|
+
class Ci extends Tr {
|
|
2479
2523
|
constructor(e, r) {
|
|
2480
2524
|
super();
|
|
2481
|
-
|
|
2525
|
+
c(this, "inner");
|
|
2482
2526
|
this.map = e, this.inner = new google.maps.places.PlacesService(e.innerMap);
|
|
2483
2527
|
}
|
|
2484
2528
|
search(e, r) {
|
|
@@ -2505,27 +2549,27 @@ class Mi extends vr {
|
|
|
2505
2549
|
// 'address_components', // TODO: 2023/04/28 ipcjs 查询请求不支持该字段...
|
|
2506
2550
|
],
|
|
2507
2551
|
locationBias: r
|
|
2508
|
-
}, (a,
|
|
2509
|
-
switch (
|
|
2552
|
+
}, (a, h) => {
|
|
2553
|
+
switch (h) {
|
|
2510
2554
|
case google.maps.places.PlacesServiceStatus.ZERO_RESULTS:
|
|
2511
2555
|
case google.maps.places.PlacesServiceStatus.OK: {
|
|
2512
|
-
const o = (a ?? []).map((l) =>
|
|
2556
|
+
const o = (a ?? []).map((l) => ur(l, this.map));
|
|
2513
2557
|
s(o);
|
|
2514
2558
|
break;
|
|
2515
2559
|
}
|
|
2516
2560
|
default:
|
|
2517
|
-
n(new Error(`status: ${
|
|
2561
|
+
n(new Error(`status: ${h}`));
|
|
2518
2562
|
break;
|
|
2519
2563
|
}
|
|
2520
2564
|
});
|
|
2521
2565
|
});
|
|
2522
2566
|
}
|
|
2523
2567
|
}
|
|
2524
|
-
class
|
|
2568
|
+
class wi extends Tr {
|
|
2525
2569
|
constructor(e, r) {
|
|
2526
2570
|
super();
|
|
2527
|
-
|
|
2528
|
-
|
|
2571
|
+
c(this, "searchRequestMap", /* @__PURE__ */ new Map());
|
|
2572
|
+
c(this, "currentSearch");
|
|
2529
2573
|
this.map = e;
|
|
2530
2574
|
}
|
|
2531
2575
|
get inner() {
|
|
@@ -2552,14 +2596,14 @@ class Oi extends vr {
|
|
|
2552
2596
|
newSearch(e, r) {
|
|
2553
2597
|
return new Promise((s, n) => {
|
|
2554
2598
|
const a = new BMap.LocalSearch(e ?? this.map.innerMap, {
|
|
2555
|
-
onSearchComplete: (
|
|
2556
|
-
Array.isArray(
|
|
2599
|
+
onSearchComplete: (h) => {
|
|
2600
|
+
Array.isArray(h) && at("当前只支持一次搜索一条数据");
|
|
2557
2601
|
const o = a.getStatus();
|
|
2558
2602
|
switch (o) {
|
|
2559
2603
|
case BMAP_STATUS_SUCCESS: {
|
|
2560
2604
|
const l = [];
|
|
2561
|
-
for (let
|
|
2562
|
-
const u =
|
|
2605
|
+
for (let d = 0; d < h.getCurrentNumPois(); d++) {
|
|
2606
|
+
const u = h.getPoi(d);
|
|
2563
2607
|
l.push({
|
|
2564
2608
|
id: u.uid,
|
|
2565
2609
|
city: u.city,
|
|
@@ -2587,10 +2631,10 @@ class Oi extends vr {
|
|
|
2587
2631
|
});
|
|
2588
2632
|
}
|
|
2589
2633
|
}
|
|
2590
|
-
class
|
|
2634
|
+
class Mr {
|
|
2591
2635
|
constructor(t, e) {
|
|
2592
|
-
|
|
2593
|
-
|
|
2636
|
+
c(this, "onData");
|
|
2637
|
+
c(this, "onError");
|
|
2594
2638
|
this.map = t, this.input = e;
|
|
2595
2639
|
}
|
|
2596
2640
|
/**
|
|
@@ -2602,27 +2646,27 @@ class _r {
|
|
|
2602
2646
|
return this.onData && C("setSearchListener只能调用一次"), this.onData = t, this.onError = e, ve;
|
|
2603
2647
|
}
|
|
2604
2648
|
}
|
|
2605
|
-
class
|
|
2649
|
+
class Ei extends Mr {
|
|
2606
2650
|
constructor(e, r) {
|
|
2607
2651
|
super(e, r.input);
|
|
2608
|
-
|
|
2652
|
+
c(this, "searchBox");
|
|
2609
2653
|
this.searchBox = new google.maps.places.SearchBox(r.input), this.searchBox.bindTo("bounds", e.innerMap);
|
|
2610
2654
|
}
|
|
2611
2655
|
setSearchListener(e, r) {
|
|
2612
|
-
return super.setSearchListener(e, r),
|
|
2656
|
+
return super.setSearchListener(e, r), sr(this.searchBox, "places_changed", () => {
|
|
2613
2657
|
const s = this.searchBox.getPlaces();
|
|
2614
|
-
e((s ?? []).map((n) =>
|
|
2658
|
+
e((s ?? []).map((n) => ur(n, this.map)));
|
|
2615
2659
|
});
|
|
2616
2660
|
}
|
|
2617
2661
|
search() {
|
|
2618
2662
|
this.input.value && (google.maps.event.trigger(this.input, "focus", {}), google.maps.event.trigger(this.input, "keydown", { keyCode: 13 }));
|
|
2619
2663
|
}
|
|
2620
2664
|
}
|
|
2621
|
-
class
|
|
2665
|
+
class Li extends Mr {
|
|
2622
2666
|
constructor(e, r) {
|
|
2623
2667
|
super(e, r.input);
|
|
2624
|
-
|
|
2625
|
-
|
|
2668
|
+
c(this, "autocomplete");
|
|
2669
|
+
c(this, "placesService");
|
|
2626
2670
|
this.autocomplete = e.createAutocomplete({ input: r.input, bindToMap: !0 }), this.placesService = e.createPlacesService({});
|
|
2627
2671
|
}
|
|
2628
2672
|
setSearchListener(e, r) {
|
|
@@ -2637,12 +2681,12 @@ class wi extends _r {
|
|
|
2637
2681
|
this.placesService.search(e).then(this.onData, this.onError);
|
|
2638
2682
|
}
|
|
2639
2683
|
}
|
|
2640
|
-
var
|
|
2641
|
-
class
|
|
2684
|
+
var Pi = /* @__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))(Pi || {});
|
|
2685
|
+
class ft {
|
|
2642
2686
|
constructor(t) {
|
|
2643
|
-
|
|
2687
|
+
c(this, "latestInfoWindow");
|
|
2644
2688
|
/** 使用{@link setEventTargetDelegate}初始化 */
|
|
2645
|
-
|
|
2689
|
+
c(this, "delegate", void 0);
|
|
2646
2690
|
this.element = t, process.env.NODE_ENV !== "production" && setTimeout(() => {
|
|
2647
2691
|
this.delegate || console.warn(`${this.constructor.name}继承了AbstractMap, 但未调用setEventTargetDelegate(delegate)`);
|
|
2648
2692
|
});
|
|
@@ -2691,7 +2735,7 @@ class gt {
|
|
|
2691
2735
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
2692
2736
|
* Released under the MIT License.
|
|
2693
2737
|
*/
|
|
2694
|
-
function
|
|
2738
|
+
function xi(i) {
|
|
2695
2739
|
return i != null && typeof i == "object" && Array.isArray(i) === !1;
|
|
2696
2740
|
}
|
|
2697
2741
|
/*!
|
|
@@ -2700,49 +2744,49 @@ function Li(i) {
|
|
|
2700
2744
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
2701
2745
|
* Released under the MIT License.
|
|
2702
2746
|
*/
|
|
2703
|
-
function
|
|
2704
|
-
return
|
|
2747
|
+
function Ht(i) {
|
|
2748
|
+
return xi(i) === !0 && Object.prototype.toString.call(i) === "[object Object]";
|
|
2705
2749
|
}
|
|
2706
|
-
function
|
|
2750
|
+
function Or(i) {
|
|
2707
2751
|
var t, e;
|
|
2708
|
-
return !(
|
|
2752
|
+
return !(Ht(i) === !1 || (t = i.constructor, typeof t != "function") || (e = t.prototype, Ht(e) === !1) || e.hasOwnProperty("isPrototypeOf") === !1);
|
|
2709
2753
|
}
|
|
2710
2754
|
var be;
|
|
2711
2755
|
((i) => {
|
|
2712
|
-
function t(
|
|
2713
|
-
return
|
|
2756
|
+
function t(h, o) {
|
|
2757
|
+
return h.reduce((l, d) => (l[o(d)] = d, l), {});
|
|
2714
2758
|
}
|
|
2715
2759
|
i.fromArray = t;
|
|
2716
|
-
function e(
|
|
2717
|
-
return
|
|
2760
|
+
function e(h) {
|
|
2761
|
+
return h.reduce((o, l) => (o[l[0]] = l[1], o), {});
|
|
2718
2762
|
}
|
|
2719
2763
|
i.fromEntries = e;
|
|
2720
|
-
function r(
|
|
2721
|
-
return JSON.stringify(
|
|
2764
|
+
function r(h) {
|
|
2765
|
+
return JSON.stringify(h, (o, l) => typeof l == "object" && Object.getPrototypeOf(l) !== Object.prototype ? l.toString !== Object.prototype.toString ? l.toString() : `[object ${Object.getPrototypeOf(l).constructor.name}]` : l);
|
|
2722
2766
|
}
|
|
2723
2767
|
i.toJsonSafely = r;
|
|
2724
|
-
function s(
|
|
2725
|
-
|
|
2726
|
-
|
|
2768
|
+
function s(h) {
|
|
2769
|
+
Or(h) && Object.keys(h).forEach((o) => {
|
|
2770
|
+
h[o] === void 0 ? delete h[o] : s(h[o]);
|
|
2727
2771
|
});
|
|
2728
2772
|
}
|
|
2729
2773
|
i.deleteUndefinedPropertyOnPlainObjectDeeply = s;
|
|
2730
|
-
function n(
|
|
2731
|
-
const l =
|
|
2732
|
-
for (const u in
|
|
2733
|
-
l(u) || (
|
|
2734
|
-
return
|
|
2774
|
+
function n(h, ...o) {
|
|
2775
|
+
const l = jt(o), d = {};
|
|
2776
|
+
for (const u in h)
|
|
2777
|
+
l(u) || (d[u] = h[u]);
|
|
2778
|
+
return d;
|
|
2735
2779
|
}
|
|
2736
2780
|
i.omit = n;
|
|
2737
|
-
function a(
|
|
2738
|
-
const l =
|
|
2739
|
-
for (const u in
|
|
2740
|
-
l(u) && (
|
|
2741
|
-
return
|
|
2781
|
+
function a(h, ...o) {
|
|
2782
|
+
const l = jt(o), d = {};
|
|
2783
|
+
for (const u in h)
|
|
2784
|
+
l(u) && (d[u] = h[u]);
|
|
2785
|
+
return d;
|
|
2742
2786
|
}
|
|
2743
2787
|
i.pick = a;
|
|
2744
2788
|
})(be || (be = {}));
|
|
2745
|
-
function
|
|
2789
|
+
function jt(i) {
|
|
2746
2790
|
if (i.length <= 4)
|
|
2747
2791
|
return i.includes.bind(i);
|
|
2748
2792
|
{
|
|
@@ -2751,21 +2795,21 @@ function Wt(i) {
|
|
|
2751
2795
|
}
|
|
2752
2796
|
}
|
|
2753
2797
|
be.toJsonSafely;
|
|
2754
|
-
const
|
|
2755
|
-
var j = /* @__PURE__ */ ((i) => (i.auto = "auto", i.none = "none", i.greedy = "greedy", i.cooperative = "cooperative", i))(j || {}),
|
|
2798
|
+
const ki = ["single", "multi"];
|
|
2799
|
+
var j = /* @__PURE__ */ ((i) => (i.auto = "auto", i.none = "none", i.greedy = "greedy", i.cooperative = "cooperative", i))(j || {}), it;
|
|
2756
2800
|
((i) => {
|
|
2757
2801
|
function t(e) {
|
|
2758
2802
|
be.deleteUndefinedPropertyOnPlainObjectDeeply(e);
|
|
2759
2803
|
const r = { center: y.ZERO, zoom: 5 };
|
|
2760
|
-
return
|
|
2761
|
-
isMergeableObject:
|
|
2804
|
+
return tr(r, e || {}, {
|
|
2805
|
+
isMergeableObject: Or
|
|
2762
2806
|
});
|
|
2763
2807
|
}
|
|
2764
2808
|
i.create = t;
|
|
2765
|
-
})(
|
|
2766
|
-
class
|
|
2809
|
+
})(it || (it = {}));
|
|
2810
|
+
class Cr {
|
|
2767
2811
|
constructor(t, e, r) {
|
|
2768
|
-
|
|
2812
|
+
c(this, "_delegate");
|
|
2769
2813
|
this.innerOverlay = t, this.coordType = e, this.map = r;
|
|
2770
2814
|
}
|
|
2771
2815
|
get delegate() {
|
|
@@ -2781,7 +2825,7 @@ class Tr {
|
|
|
2781
2825
|
this.map.removeOverlay(this);
|
|
2782
2826
|
}
|
|
2783
2827
|
}
|
|
2784
|
-
class
|
|
2828
|
+
class yt extends Cr {
|
|
2785
2829
|
constructor(t, e, r) {
|
|
2786
2830
|
super(t, e, r);
|
|
2787
2831
|
}
|
|
@@ -2795,7 +2839,7 @@ class mt extends Tr {
|
|
|
2795
2839
|
this.innerOverlay.setVisible(t);
|
|
2796
2840
|
}
|
|
2797
2841
|
}
|
|
2798
|
-
class je extends
|
|
2842
|
+
class je extends Cr {
|
|
2799
2843
|
constructor(t, e, r) {
|
|
2800
2844
|
super(t, e, r);
|
|
2801
2845
|
}
|
|
@@ -2843,15 +2887,15 @@ const Ge = class extends je {
|
|
|
2843
2887
|
this.innerOverlay.setFillOpacity(t + Ge.OPACITY_DELTA);
|
|
2844
2888
|
}
|
|
2845
2889
|
};
|
|
2846
|
-
let
|
|
2890
|
+
let B = Ge;
|
|
2847
2891
|
/**
|
|
2848
2892
|
* baidu地图的透明度属性有如下问题:
|
|
2849
2893
|
* - 在透明度为0时, 无法隐藏掉颜色
|
|
2850
2894
|
* - 透明度为0.7和0.8时, 在maintain的发布模式下, polyline的线条会不可见 (原因未知, 在tg-map中无法复现)
|
|
2851
2895
|
* 故统一加个0.001, 规避这些问题...
|
|
2852
2896
|
*/
|
|
2853
|
-
|
|
2854
|
-
class Ve extends
|
|
2897
|
+
c(B, "OPACITY_DELTA", 1e-3);
|
|
2898
|
+
class Ve extends yt {
|
|
2855
2899
|
isEditable() {
|
|
2856
2900
|
return this.innerOverlay.getEditable();
|
|
2857
2901
|
}
|
|
@@ -2874,25 +2918,25 @@ class Ve extends mt {
|
|
|
2874
2918
|
this.innerOverlay.setOptions({ fillOpacity: t });
|
|
2875
2919
|
}
|
|
2876
2920
|
}
|
|
2877
|
-
class
|
|
2921
|
+
class vt extends B {
|
|
2878
2922
|
constructor() {
|
|
2879
2923
|
super(...arguments);
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2924
|
+
c(this, "prevCenter");
|
|
2925
|
+
c(this, "prevRadius");
|
|
2926
|
+
c(this, "isDoingSetCenter", !1);
|
|
2927
|
+
c(this, "isDoingSetRadius", !1);
|
|
2928
|
+
c(this, "eventHubDelegate");
|
|
2929
|
+
c(this, "onRadiusChanged", () => {
|
|
2886
2930
|
var r;
|
|
2887
2931
|
const e = this.innerOverlay.getRadius();
|
|
2888
2932
|
this.prevRadius !== e && (this.isDoingSetRadius || (r = this.eventHubDelegate) == null || r.notify({ type: "radius-changed", target: this }), this.prevRadius = e);
|
|
2889
2933
|
});
|
|
2890
|
-
|
|
2934
|
+
c(this, "onCenterChanged", () => {
|
|
2891
2935
|
var r;
|
|
2892
2936
|
const e = this.innerOverlay.getCenter();
|
|
2893
2937
|
this.prevCenter !== e && (this.isDoingSetCenter || (r = this.eventHubDelegate) == null || r.notify({ type: "center-changed", target: this }), this.prevCenter = e);
|
|
2894
2938
|
});
|
|
2895
|
-
|
|
2939
|
+
c(this, "resetEditableTimeoutId");
|
|
2896
2940
|
}
|
|
2897
2941
|
static create(e) {
|
|
2898
2942
|
const r = this.coordType, s = new BMap.Circle(e.center.toBaidu(r), e.radius, {
|
|
@@ -2901,11 +2945,11 @@ class ft extends k {
|
|
|
2901
2945
|
enableEditing: !1,
|
|
2902
2946
|
// options.editable,
|
|
2903
2947
|
strokeColor: e.strokeColor,
|
|
2904
|
-
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity +
|
|
2948
|
+
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity + B.OPACITY_DELTA : void 0,
|
|
2905
2949
|
strokeWeight: e.strokeWeight,
|
|
2906
2950
|
fillColor: e.fillColor,
|
|
2907
|
-
fillOpacity: e.fillOpacity != null ? e.fillOpacity +
|
|
2908
|
-
}), n = new
|
|
2951
|
+
fillOpacity: e.fillOpacity != null ? e.fillOpacity + B.OPACITY_DELTA : void 0
|
|
2952
|
+
}), n = new vt(s, r, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
2909
2953
|
return n.state.editable && setTimeout(() => {
|
|
2910
2954
|
n.state.editable && s.enableEditing();
|
|
2911
2955
|
}, 0), n;
|
|
@@ -2936,7 +2980,7 @@ class ft extends k {
|
|
|
2936
2980
|
return this.innerOverlay.getRadius();
|
|
2937
2981
|
}
|
|
2938
2982
|
}
|
|
2939
|
-
class
|
|
2983
|
+
class _t extends Ve {
|
|
2940
2984
|
static create(t) {
|
|
2941
2985
|
const e = this.coordType, r = new google.maps.Circle({
|
|
2942
2986
|
center: t.center.toGoogle(e),
|
|
@@ -2950,7 +2994,7 @@ class yt extends Ve {
|
|
|
2950
2994
|
fillOpacity: t.fillOpacity,
|
|
2951
2995
|
visible: t.visible
|
|
2952
2996
|
});
|
|
2953
|
-
return new
|
|
2997
|
+
return new _t(r, e, this);
|
|
2954
2998
|
}
|
|
2955
2999
|
setCenter(t) {
|
|
2956
3000
|
this.coordType = this.map.coordType, this.innerOverlay.setCenter(t.toGoogle(this.coordType));
|
|
@@ -2965,10 +3009,10 @@ class yt extends Ve {
|
|
|
2965
3009
|
return this.innerOverlay.getRadius();
|
|
2966
3010
|
}
|
|
2967
3011
|
}
|
|
2968
|
-
function
|
|
3012
|
+
function wr() {
|
|
2969
3013
|
BMap.OverlayV3 || (BMap.OverlayV3 = BMap.Overlay);
|
|
2970
3014
|
}
|
|
2971
|
-
const
|
|
3015
|
+
const Vt = {
|
|
2972
3016
|
/** {@link BMap.Point.equals} 无效, 故需要自己写一个 */
|
|
2973
3017
|
equals(i, t) {
|
|
2974
3018
|
return i.lat === t.lat && i.lng === t.lng;
|
|
@@ -2979,28 +3023,28 @@ var X;
|
|
|
2979
3023
|
i.ZERO = { x: 0, y: 0 };
|
|
2980
3024
|
})(X || (X = {}));
|
|
2981
3025
|
let Ke;
|
|
2982
|
-
function
|
|
2983
|
-
return Ke || (Ke =
|
|
3026
|
+
function Bi(i, t, e, r, s, n) {
|
|
3027
|
+
return Ke || (Ke = Ii()), new Ke(i, t, e, r, s, n);
|
|
2984
3028
|
}
|
|
2985
|
-
function
|
|
2986
|
-
|
|
3029
|
+
function Ii() {
|
|
3030
|
+
wr();
|
|
2987
3031
|
const i = new BMap.Point(0, 0);
|
|
2988
3032
|
return class extends BMap.OverlayV3 {
|
|
2989
|
-
constructor(r, s = i, n = X.ZERO, a,
|
|
3033
|
+
constructor(r, s = i, n = X.ZERO, a, h = 654, o = "") {
|
|
2990
3034
|
super();
|
|
2991
3035
|
// 类表达式不能有私有成员, 故改成public
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
3036
|
+
c(this, "container");
|
|
3037
|
+
c(this, "border");
|
|
3038
|
+
c(this, "inner");
|
|
3039
|
+
c(this, "map");
|
|
3040
|
+
c(this, "marker");
|
|
2997
3041
|
this.content = r, this.position = s, this.offset = n;
|
|
2998
3042
|
const l = "baidu-info-box-container";
|
|
2999
3043
|
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";
|
|
3000
|
-
const
|
|
3001
|
-
|
|
3044
|
+
const d = document.createElement("img");
|
|
3045
|
+
d.className = l + "__close", d.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", d.addEventListener("click", () => {
|
|
3002
3046
|
this.close(), this.dispatchEvent({ type: "onclickclose" });
|
|
3003
|
-
}), this.inner.appendChild(r), this.border.appendChild(this.inner), this.border.appendChild(
|
|
3047
|
+
}), this.inner.appendChild(r), this.border.appendChild(this.inner), this.border.appendChild(d), this.container.appendChild(this.border), a && this.setZIndex(a), this.setMaxWidth(h), this.onMarkerPositionChanged = this.onMarkerPositionChanged.bind(this);
|
|
3004
3048
|
}
|
|
3005
3049
|
initialize(r) {
|
|
3006
3050
|
return this.map = r, r.getPanes().floatPane.appendChild(this.container), this.container;
|
|
@@ -3049,7 +3093,7 @@ function ki() {
|
|
|
3049
3093
|
}
|
|
3050
3094
|
};
|
|
3051
3095
|
}
|
|
3052
|
-
class
|
|
3096
|
+
class bt {
|
|
3053
3097
|
constructor(t) {
|
|
3054
3098
|
this.delegate = t, this.delegate.setTarget(this);
|
|
3055
3099
|
}
|
|
@@ -3060,7 +3104,7 @@ class vt {
|
|
|
3060
3104
|
this.delegate.removeEventListener(t, e);
|
|
3061
3105
|
}
|
|
3062
3106
|
}
|
|
3063
|
-
class
|
|
3107
|
+
class Tt extends bt {
|
|
3064
3108
|
constructor(t, e, r) {
|
|
3065
3109
|
super(new ae(t, e)), this.inner = t, this.map = e, this.state = r;
|
|
3066
3110
|
}
|
|
@@ -3070,7 +3114,7 @@ class _t extends vt {
|
|
|
3070
3114
|
offset: t.offset && new BMap.Size(t.offset.x, t.offset.y),
|
|
3071
3115
|
enableAutoPan: !t.disableAutoPan
|
|
3072
3116
|
});
|
|
3073
|
-
return new
|
|
3117
|
+
return new Tt(r, this, { position: e });
|
|
3074
3118
|
}
|
|
3075
3119
|
isOpen() {
|
|
3076
3120
|
return this.inner.isOpen();
|
|
@@ -3089,11 +3133,11 @@ class _t extends vt {
|
|
|
3089
3133
|
this.state.position = t, this.inner.isOpen() && this.open();
|
|
3090
3134
|
}
|
|
3091
3135
|
}
|
|
3092
|
-
class
|
|
3136
|
+
class Mt extends bt {
|
|
3093
3137
|
constructor(e, r) {
|
|
3094
3138
|
super(new re(e, r));
|
|
3095
|
-
|
|
3096
|
-
|
|
3139
|
+
c(this, "eventHub", new or());
|
|
3140
|
+
c(this, "isOpened", !1);
|
|
3097
3141
|
this.inner = e, this.map = r, e.addListener("closeclick", () => {
|
|
3098
3142
|
this.isOpened = !1, this.eventHub.hasListener("close") && this.eventHub.notify({ type: "close", target: this });
|
|
3099
3143
|
}), e.addListener("map_changed", () => {
|
|
@@ -3109,7 +3153,7 @@ class bt extends vt {
|
|
|
3109
3153
|
position: r.toGoogle(this.coordType),
|
|
3110
3154
|
disableAutoPan: e.disableAutoPan
|
|
3111
3155
|
});
|
|
3112
|
-
return new
|
|
3156
|
+
return new Mt(s, this);
|
|
3113
3157
|
}
|
|
3114
3158
|
isOpen() {
|
|
3115
3159
|
return this.isOpened;
|
|
@@ -3147,13 +3191,13 @@ class bt extends vt {
|
|
|
3147
3191
|
this.inner.setPosition(e.toGoogle(this.map.coordType));
|
|
3148
3192
|
}
|
|
3149
3193
|
}
|
|
3150
|
-
class
|
|
3194
|
+
class Ot extends je {
|
|
3151
3195
|
constructor(t, e, r) {
|
|
3152
3196
|
super(t, e, r), this.baiduMap = r;
|
|
3153
3197
|
}
|
|
3154
3198
|
static create(t) {
|
|
3155
3199
|
var s;
|
|
3156
|
-
const e = this.coordType, r =
|
|
3200
|
+
const e = this.coordType, r = Bi(
|
|
3157
3201
|
t.content,
|
|
3158
3202
|
(s = t.position) == null ? void 0 : s.toBaidu(e),
|
|
3159
3203
|
t.offset,
|
|
@@ -3161,7 +3205,7 @@ class Tt extends je {
|
|
|
3161
3205
|
t.maxWidth,
|
|
3162
3206
|
t.borderClass
|
|
3163
3207
|
);
|
|
3164
|
-
return new
|
|
3208
|
+
return new Ot(r, e, this);
|
|
3165
3209
|
}
|
|
3166
3210
|
open(t) {
|
|
3167
3211
|
this.innerOverlay.open(this.baiduMap.innerMap, t == null ? void 0 : t.innerOverlay);
|
|
@@ -3182,7 +3226,7 @@ class Tt extends je {
|
|
|
3182
3226
|
this.innerOverlay.setZIndex(t);
|
|
3183
3227
|
}
|
|
3184
3228
|
}
|
|
3185
|
-
class
|
|
3229
|
+
class Ct extends bt {
|
|
3186
3230
|
constructor(t, e, r) {
|
|
3187
3231
|
super(new re(t, r)), this.inner = t, this.coordType = e, this.map = r;
|
|
3188
3232
|
}
|
|
@@ -3196,10 +3240,10 @@ class Mt extends vt {
|
|
|
3196
3240
|
maxWidth: t.maxWidth
|
|
3197
3241
|
}), s = t.borderClass;
|
|
3198
3242
|
return s && r.addListener("domready", () => {
|
|
3199
|
-
var
|
|
3200
|
-
const a = (
|
|
3243
|
+
var h;
|
|
3244
|
+
const a = (h = t.content.parentElement) == null ? void 0 : h.parentElement;
|
|
3201
3245
|
a && a.className.includes("gm-style-iw-c") && !a.className.includes(s) && (a.className += ` ${s}`);
|
|
3202
|
-
}), new
|
|
3246
|
+
}), new Ct(r, e, this);
|
|
3203
3247
|
}
|
|
3204
3248
|
open(t) {
|
|
3205
3249
|
this.inner.open(this.map.innerMap, t == null ? void 0 : t.innerOverlay);
|
|
@@ -3241,11 +3285,11 @@ var Te;
|
|
|
3241
3285
|
}
|
|
3242
3286
|
i.trimIndent = e;
|
|
3243
3287
|
function r(s) {
|
|
3244
|
-
return s.replace(/([^A-Z]?)([A-Z])/g, (n, a,
|
|
3288
|
+
return s.replace(/([^A-Z]?)([A-Z])/g, (n, a, h) => a ? `${a}-${h.toLowerCase()}` : h.toLowerCase());
|
|
3245
3289
|
}
|
|
3246
3290
|
i.pascal2kebab = r;
|
|
3247
3291
|
})(Te || (Te = {}));
|
|
3248
|
-
const
|
|
3292
|
+
const Si = {
|
|
3249
3293
|
/** @see https://nodejs.org/docs/v10.3.0/api/path.html#path_path_basename_path_ext */
|
|
3250
3294
|
basename(i, t) {
|
|
3251
3295
|
const e = i.endsWith("/") ? i.slice(0, -1) : i, r = e.lastIndexOf("/"), s = r >= 0 ? e.substring(r + 1) : e;
|
|
@@ -3285,13 +3329,13 @@ var Me = /* @__PURE__ */ ((i) => (i.map = "map", i.overlay = "overlay", i.overla
|
|
|
3285
3329
|
}
|
|
3286
3330
|
i.toBaidu = e;
|
|
3287
3331
|
})(Oe || (Oe = {}));
|
|
3288
|
-
class
|
|
3332
|
+
class Ai {
|
|
3289
3333
|
constructor(t, e) {
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3334
|
+
c(this, "baidu");
|
|
3335
|
+
c(this, "google");
|
|
3336
|
+
c(this, "projection");
|
|
3337
|
+
c(this, "element", void 0);
|
|
3338
|
+
c(this, "mapPane");
|
|
3295
3339
|
this.map = t, this.mapPane = e.mapPane;
|
|
3296
3340
|
}
|
|
3297
3341
|
create() {
|
|
@@ -3306,12 +3350,12 @@ class Bi {
|
|
|
3306
3350
|
asBaidu() {
|
|
3307
3351
|
if (!this.baidu) {
|
|
3308
3352
|
const t = this;
|
|
3309
|
-
|
|
3353
|
+
wr();
|
|
3310
3354
|
class e extends BMap.OverlayV3 {
|
|
3311
3355
|
initialize(n) {
|
|
3312
3356
|
var o;
|
|
3313
|
-
const a = t.create(),
|
|
3314
|
-
return (o = Oe.toBaidu(t.mapPane,
|
|
3357
|
+
const a = t.create(), h = n.getPanes();
|
|
3358
|
+
return (o = Oe.toBaidu(t.mapPane, h)) == null || o.appendChild(a), a;
|
|
3315
3359
|
}
|
|
3316
3360
|
draw() {
|
|
3317
3361
|
t.draw();
|
|
@@ -3359,14 +3403,14 @@ class Bi {
|
|
|
3359
3403
|
}
|
|
3360
3404
|
}
|
|
3361
3405
|
let Xe;
|
|
3362
|
-
function
|
|
3363
|
-
return Xe || (Xe =
|
|
3406
|
+
function Ri(i, t, e, r, s) {
|
|
3407
|
+
return Xe || (Xe = $i()), new Xe(i, t, e, r, s);
|
|
3364
3408
|
}
|
|
3365
|
-
function
|
|
3409
|
+
function $i() {
|
|
3366
3410
|
return class extends google.maps.OverlayView {
|
|
3367
3411
|
constructor(e, r, s, n = Me.overlayMouseTarget, a) {
|
|
3368
3412
|
super();
|
|
3369
|
-
|
|
3413
|
+
c(this, "container");
|
|
3370
3414
|
this.position = r, this.offset = s, this._mapPane = n, this.container = document.createElement("div"), this.container.className = "label-container", this.container.style.position = "absolute", a && this.setZIndex(a), this.container.addEventListener("click", () => {
|
|
3371
3415
|
google.maps.event.trigger(this, "click");
|
|
3372
3416
|
}), this.setElement(e);
|
|
@@ -3431,13 +3475,13 @@ var de;
|
|
|
3431
3475
|
}
|
|
3432
3476
|
i.toElement = e;
|
|
3433
3477
|
})(de || (de = {}));
|
|
3434
|
-
class
|
|
3478
|
+
class wt extends je {
|
|
3435
3479
|
constructor(e, r, s, n) {
|
|
3436
3480
|
super(e, r, s);
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3481
|
+
c(this, "icon");
|
|
3482
|
+
c(this, "iconAnchor");
|
|
3483
|
+
c(this, "content", void 0);
|
|
3484
|
+
c(this, "contentObserver");
|
|
3441
3485
|
this.setContentInternal(n, !0);
|
|
3442
3486
|
}
|
|
3443
3487
|
static create(e) {
|
|
@@ -3451,7 +3495,7 @@ class Ot extends je {
|
|
|
3451
3495
|
padding: "0px",
|
|
3452
3496
|
backgroundColor: "unset"
|
|
3453
3497
|
});
|
|
3454
|
-
const n = new
|
|
3498
|
+
const n = new wt(s, r, this, e.content);
|
|
3455
3499
|
return s.__label__ = n, n;
|
|
3456
3500
|
}
|
|
3457
3501
|
setContentInternal(e, r = !1) {
|
|
@@ -3490,7 +3534,7 @@ class Ot extends je {
|
|
|
3490
3534
|
* @description baidu中Label默认左上角对齐Icon的左上, 我们要将其转换为对齐marker的position
|
|
3491
3535
|
* */
|
|
3492
3536
|
attachIcon(e) {
|
|
3493
|
-
var
|
|
3537
|
+
var h;
|
|
3494
3538
|
let r;
|
|
3495
3539
|
if (e instanceof BMap.Icon)
|
|
3496
3540
|
r = e.anchor;
|
|
@@ -3498,7 +3542,7 @@ class Ot extends je {
|
|
|
3498
3542
|
if (e.anchor)
|
|
3499
3543
|
r = e.anchor;
|
|
3500
3544
|
else {
|
|
3501
|
-
const o = ((
|
|
3545
|
+
const o = ((h = e.__icon__) == null ? void 0 : h.baiduLabelOffset) ?? { x: 0, y: 0 };
|
|
3502
3546
|
r = {
|
|
3503
3547
|
width: e.style.anchor.width + o.x,
|
|
3504
3548
|
height: e.style.anchor.height + o.y
|
|
@@ -3508,8 +3552,8 @@ class Ot extends je {
|
|
|
3508
3552
|
console.log("BaiduLabelOverlay.attachIcon", "Bmap.Symbol.anchor尚未计算完成");
|
|
3509
3553
|
return;
|
|
3510
3554
|
}
|
|
3511
|
-
const l = e.anchor.width - e.style.anchor.width,
|
|
3512
|
-
if (o.x !== l || o.y !==
|
|
3555
|
+
const l = e.anchor.width - e.style.anchor.width, d = e.anchor.height - e.style.anchor.height;
|
|
3556
|
+
if (o.x !== l || o.y !== d) {
|
|
3513
3557
|
const b = [
|
|
3514
3558
|
(u = e.__icon__.anchor) == null ? void 0 : u.x,
|
|
3515
3559
|
(p = e.__icon__.anchor) == null ? void 0 : p.y,
|
|
@@ -3520,7 +3564,7 @@ class Ot extends je {
|
|
|
3520
3564
|
console.warn("BaiduLabelOverlay.attachIcon", e.__icon__, Te.trimIndent(
|
|
3521
3565
|
`
|
|
3522
3566
|
为了保证Label的位置正确, 请将SymbolIcon(${b})中baiduLabelOffset的值改写成:
|
|
3523
|
-
${JSON.stringify({ x: l, y:
|
|
3567
|
+
${JSON.stringify({ x: l, y: d })}
|
|
3524
3568
|
`
|
|
3525
3569
|
));
|
|
3526
3570
|
}
|
|
@@ -3531,17 +3575,17 @@ class Ot extends je {
|
|
|
3531
3575
|
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;
|
|
3532
3576
|
}
|
|
3533
3577
|
}
|
|
3534
|
-
class
|
|
3578
|
+
class Et extends yt {
|
|
3535
3579
|
static create(t) {
|
|
3536
3580
|
var s;
|
|
3537
|
-
const e = this.coordType, r =
|
|
3581
|
+
const e = this.coordType, r = Ri(
|
|
3538
3582
|
de.toElement(t.content),
|
|
3539
3583
|
(s = t.position) == null ? void 0 : s.toGoogle(e),
|
|
3540
3584
|
t.offset,
|
|
3541
3585
|
t.mapPane,
|
|
3542
3586
|
t.zIndex
|
|
3543
3587
|
);
|
|
3544
|
-
return new
|
|
3588
|
+
return new Et(r, e, this);
|
|
3545
3589
|
}
|
|
3546
3590
|
setZIndex(t) {
|
|
3547
3591
|
this.innerOverlay.setZIndex(t);
|
|
@@ -3564,10 +3608,10 @@ class Ct extends mt {
|
|
|
3564
3608
|
}
|
|
3565
3609
|
}
|
|
3566
3610
|
const $e = {
|
|
3567
|
-
toGoogle: (i) => "url" in i ?
|
|
3568
|
-
toBaidu: (i) => "url" in i ?
|
|
3611
|
+
toGoogle: (i) => "url" in i ? ze.toGoogle(i) : De.toGoogle(i),
|
|
3612
|
+
toBaidu: (i) => "url" in i ? ze.toBaidu(i) : De.toBaidu(i)
|
|
3569
3613
|
};
|
|
3570
|
-
var
|
|
3614
|
+
var ze;
|
|
3571
3615
|
((i) => {
|
|
3572
3616
|
function t(r) {
|
|
3573
3617
|
return {
|
|
@@ -3591,8 +3635,8 @@ var De;
|
|
|
3591
3635
|
});
|
|
3592
3636
|
}
|
|
3593
3637
|
i.toBaidu = e;
|
|
3594
|
-
})(
|
|
3595
|
-
var
|
|
3638
|
+
})(ze || (ze = {}));
|
|
3639
|
+
var De;
|
|
3596
3640
|
((i) => {
|
|
3597
3641
|
function t(r) {
|
|
3598
3642
|
return {
|
|
@@ -3623,8 +3667,8 @@ var ze;
|
|
|
3623
3667
|
return s.__icon__ = r, s;
|
|
3624
3668
|
}
|
|
3625
3669
|
i.toBaidu = e;
|
|
3626
|
-
})(
|
|
3627
|
-
const
|
|
3670
|
+
})(De || (De = {}));
|
|
3671
|
+
const Vs = {
|
|
3628
3672
|
CIRCLE: { baidu: () => BMap_Symbol_SHAPE_CIRCLE, google: () => google.maps.SymbolPath.CIRCLE },
|
|
3629
3673
|
BACKWARD_CLOSED_ARROW: { baidu: () => BMap_Symbol_SHAPE_BACKWARD_CLOSED_ARROW, google: () => google.maps.SymbolPath.BACKWARD_CLOSED_ARROW },
|
|
3630
3674
|
BACKWARD_OPEN_ARROW: { baidu: () => BMap_Symbol_SHAPE_BACKWARD_OPEN_ARROW, google: () => google.maps.SymbolPath.BACKWARD_OPEN_ARROW },
|
|
@@ -3644,17 +3688,17 @@ class Ce extends je {
|
|
|
3644
3688
|
// baidu的raiseOnDrag属性, 默认为false, 而我们的options.crossOnDrag默认为true, 故这里需要转换下
|
|
3645
3689
|
raiseOnDrag: t.crossOnDrag === void 0 ? !0 : t.crossOnDrag,
|
|
3646
3690
|
draggingCursor: t.cursor
|
|
3647
|
-
}, n = new BMap.Marker(t.position.toBaidu(e), s);
|
|
3691
|
+
}, n = new BMap.Marker(t.position.toBaidu(e, t.normalizePositionForBaidu), s);
|
|
3648
3692
|
t.zIndex !== void 0 && n.setZIndex(t.zIndex);
|
|
3649
|
-
const a = t.clickable === void 0 ? !0 : t.clickable,
|
|
3650
|
-
return new Ce(n, e, this, { clickable: a, draggable:
|
|
3693
|
+
const a = t.clickable === void 0 ? !0 : t.clickable, h = !!t.draggable;
|
|
3694
|
+
return new Ce(n, e, this, { clickable: a, draggable: h, zIndex: t.zIndex, normalize: t.normalizePositionForBaidu }).visibleOptionInternal(t.visible);
|
|
3651
3695
|
}
|
|
3652
3696
|
getPosition() {
|
|
3653
3697
|
return y.fromBaidu(this.innerOverlay.getPosition(), this.coordType);
|
|
3654
3698
|
}
|
|
3655
3699
|
setPosition(t) {
|
|
3656
3700
|
var e;
|
|
3657
|
-
this.coordType = this.map.coordType, this.innerOverlay.setPosition(t.toBaidu(this.coordType)), (e = this.innerOverlay.__info_box__) == null || e.onMarkerPositionChanged();
|
|
3701
|
+
this.coordType = this.map.coordType, this.innerOverlay.setPosition(t.toBaidu(this.coordType, this.state.normalize)), (e = this.innerOverlay.__info_box__) == null || e.onMarkerPositionChanged();
|
|
3658
3702
|
}
|
|
3659
3703
|
setTitle(t) {
|
|
3660
3704
|
this.innerOverlay.setTitle(t);
|
|
@@ -3698,13 +3742,13 @@ class Ce extends je {
|
|
|
3698
3742
|
return (t = this.innerOverlay.getLabel()) == null ? void 0 : t.__label__;
|
|
3699
3743
|
}
|
|
3700
3744
|
}
|
|
3701
|
-
class
|
|
3745
|
+
class Lt extends yt {
|
|
3702
3746
|
constructor() {
|
|
3703
3747
|
super(...arguments);
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3748
|
+
c(this, "label");
|
|
3749
|
+
c(this, "labelPositionListener");
|
|
3750
|
+
c(this, "labelVisibleListener");
|
|
3751
|
+
c(this, "labelMapChangedListener");
|
|
3708
3752
|
}
|
|
3709
3753
|
static create(e) {
|
|
3710
3754
|
const r = this.coordType, s = e.icon, n = {
|
|
@@ -3721,7 +3765,7 @@ class wt extends mt {
|
|
|
3721
3765
|
// InfoWindow相对marker的position的偏移量, 若不指定, 则偏移到marker的icon的上部中央
|
|
3722
3766
|
anchorPoint: new google.maps.Point(0, 0)
|
|
3723
3767
|
};
|
|
3724
|
-
return new
|
|
3768
|
+
return new Lt(new google.maps.Marker(n), r, this);
|
|
3725
3769
|
}
|
|
3726
3770
|
getPosition() {
|
|
3727
3771
|
return y.fromGoogle(this.innerOverlay.getPosition(), this.coordType);
|
|
@@ -3774,13 +3818,13 @@ class wt extends mt {
|
|
|
3774
3818
|
this.label = void 0, this.labelPositionListener = void 0, this.labelVisibleListener = void 0, this.labelMapChangedListener = void 0;
|
|
3775
3819
|
}
|
|
3776
3820
|
}
|
|
3777
|
-
class
|
|
3821
|
+
class Pt extends B {
|
|
3778
3822
|
constructor() {
|
|
3779
3823
|
super(...arguments);
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3824
|
+
c(this, "eventHubDelegate");
|
|
3825
|
+
c(this, "prevPath");
|
|
3826
|
+
c(this, "isDoingSetPath", !1);
|
|
3827
|
+
c(this, "onLineUpdate", () => {
|
|
3784
3828
|
var r;
|
|
3785
3829
|
const e = this.innerOverlay.getPath();
|
|
3786
3830
|
e !== this.prevPath && (this.isDoingSetPath || (r = this.eventHubDelegate) == null || r.notify({
|
|
@@ -3810,20 +3854,20 @@ class Et extends k {
|
|
|
3810
3854
|
});
|
|
3811
3855
|
}
|
|
3812
3856
|
}
|
|
3813
|
-
class
|
|
3857
|
+
class xt extends Pt {
|
|
3814
3858
|
constructor() {
|
|
3815
3859
|
super(...arguments);
|
|
3816
|
-
|
|
3860
|
+
c(this, "pathEditedEventType", "path-edited");
|
|
3817
3861
|
}
|
|
3818
3862
|
static create(e) {
|
|
3819
3863
|
const r = this.coordType, s = new BMap.Polyline(e.path.map((n) => n.toBaidu(r)), {
|
|
3820
3864
|
enableClicking: e.clickable,
|
|
3821
3865
|
enableEditing: e.editable,
|
|
3822
3866
|
strokeColor: e.strokeColor,
|
|
3823
|
-
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity +
|
|
3867
|
+
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity + B.OPACITY_DELTA : void 0,
|
|
3824
3868
|
strokeWeight: e.strokeWeight
|
|
3825
3869
|
});
|
|
3826
|
-
return new
|
|
3870
|
+
return new xt(s, r, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
3827
3871
|
}
|
|
3828
3872
|
getPath() {
|
|
3829
3873
|
return this.innerOverlay.getPath().map((e) => y.fromBaidu(e, this.coordType));
|
|
@@ -3832,11 +3876,11 @@ class Lt extends Et {
|
|
|
3832
3876
|
this.coordType = this.map.coordType, this.setPathInternal(e.map((r) => r.toBaidu(this.coordType)));
|
|
3833
3877
|
}
|
|
3834
3878
|
}
|
|
3835
|
-
class
|
|
3879
|
+
class kt extends Ve {
|
|
3836
3880
|
constructor() {
|
|
3837
3881
|
super(...arguments);
|
|
3838
|
-
|
|
3839
|
-
|
|
3882
|
+
c(this, "pathChangedListeners");
|
|
3883
|
+
c(this, "eventHubDelegate");
|
|
3840
3884
|
}
|
|
3841
3885
|
static create(e) {
|
|
3842
3886
|
const r = this.coordType, s = new google.maps.Polyline({
|
|
@@ -3848,7 +3892,7 @@ class xt extends Ve {
|
|
|
3848
3892
|
strokeWeight: e.strokeWeight,
|
|
3849
3893
|
visible: e.visible
|
|
3850
3894
|
});
|
|
3851
|
-
return new
|
|
3895
|
+
return new kt(s, r, this);
|
|
3852
3896
|
}
|
|
3853
3897
|
setupPathChangedListeners() {
|
|
3854
3898
|
const e = () => {
|
|
@@ -3879,10 +3923,10 @@ class xt extends Ve {
|
|
|
3879
3923
|
this.coordType = this.map.coordType, this.innerOverlay.setPath(e.map((s) => s.toGoogle(this.coordType))), (r = this.eventHubDelegate) != null && r.hasListener("path-edited") && this.setupPathChangedListeners();
|
|
3880
3924
|
}
|
|
3881
3925
|
}
|
|
3882
|
-
class
|
|
3926
|
+
class Bt extends Pt {
|
|
3883
3927
|
constructor() {
|
|
3884
3928
|
super(...arguments);
|
|
3885
|
-
|
|
3929
|
+
c(this, "pathEditedEventType", "paths-edited");
|
|
3886
3930
|
}
|
|
3887
3931
|
static create(e) {
|
|
3888
3932
|
const r = this.coordType;
|
|
@@ -3891,12 +3935,12 @@ class Pt extends Et {
|
|
|
3891
3935
|
enableClicking: e.clickable,
|
|
3892
3936
|
enableEditing: e.editable,
|
|
3893
3937
|
strokeColor: e.strokeColor,
|
|
3894
|
-
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity +
|
|
3938
|
+
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity + B.OPACITY_DELTA : void 0,
|
|
3895
3939
|
strokeWeight: e.strokeWeight,
|
|
3896
3940
|
fillColor: e.fillColor,
|
|
3897
|
-
fillOpacity: e.fillOpacity != null ? e.fillOpacity +
|
|
3941
|
+
fillOpacity: e.fillOpacity != null ? e.fillOpacity + B.OPACITY_DELTA : void 0
|
|
3898
3942
|
});
|
|
3899
|
-
return new
|
|
3943
|
+
return new Bt(n, r, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
3900
3944
|
}
|
|
3901
3945
|
getPaths() {
|
|
3902
3946
|
return [this.innerOverlay.getPath().map((e) => y.fromBaidu(e, this.coordType))];
|
|
@@ -3905,11 +3949,11 @@ class Pt extends Et {
|
|
|
3905
3949
|
e.length > 1 && console.warn("baidu不支持多path, 只会显示paths[0]"), this.coordType = this.map.coordType, this.setPathInternal((e[0] || []).map((r) => r.toBaidu(this.coordType)));
|
|
3906
3950
|
}
|
|
3907
3951
|
}
|
|
3908
|
-
class
|
|
3952
|
+
class It extends Ve {
|
|
3909
3953
|
constructor() {
|
|
3910
3954
|
super(...arguments);
|
|
3911
|
-
|
|
3912
|
-
|
|
3955
|
+
c(this, "pathChangedListeners");
|
|
3956
|
+
c(this, "eventHubDelegate");
|
|
3913
3957
|
}
|
|
3914
3958
|
static create(e) {
|
|
3915
3959
|
const r = this.coordType, s = new google.maps.Polygon({
|
|
@@ -3923,7 +3967,7 @@ class kt extends Ve {
|
|
|
3923
3967
|
fillOpacity: e.fillOpacity,
|
|
3924
3968
|
visible: e.visible
|
|
3925
3969
|
});
|
|
3926
|
-
return new
|
|
3970
|
+
return new It(s, r, this);
|
|
3927
3971
|
}
|
|
3928
3972
|
setupPathChangedListeners() {
|
|
3929
3973
|
const e = () => {
|
|
@@ -3959,12 +4003,12 @@ class kt extends Ve {
|
|
|
3959
4003
|
this.coordType = this.map.coordType, this.innerOverlay.setPaths(e.map((s) => s.map((n) => n.toGoogle(this.coordType)))), (r = this.eventHubDelegate) != null && r.hasListener("paths-edited") && this.setupPathChangedListeners();
|
|
3960
4004
|
}
|
|
3961
4005
|
}
|
|
3962
|
-
class
|
|
4006
|
+
class St extends Pt {
|
|
3963
4007
|
constructor(e, r, s, n) {
|
|
3964
4008
|
super(e, r, s, n);
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
4009
|
+
c(this, "pathEditedEventType", "bounds-changed");
|
|
4010
|
+
c(this, "isDoingUpdateRectangle", !1);
|
|
4011
|
+
c(this, "onBoundsChanged", ({ originalEvent: e }) => {
|
|
3968
4012
|
if (this.isDoingUpdateRectangle)
|
|
3969
4013
|
return;
|
|
3970
4014
|
const r = e.prevPath ?? [], s = e.path;
|
|
@@ -3974,15 +4018,15 @@ class It extends Et {
|
|
|
3974
4018
|
if (r.length === 4)
|
|
3975
4019
|
if (a > r.length) {
|
|
3976
4020
|
for (let o = 0; o < a; o++)
|
|
3977
|
-
if (r[o] == null || !
|
|
3978
|
-
const l = s[(o - 2 + a) % a],
|
|
4021
|
+
if (r[o] == null || !Vt.equals(s[o], r[o])) {
|
|
4022
|
+
const l = s[(o - 2 + a) % a], d = s[(o - 1 + a) % a], u = s[o], p = s[(o + 1) % a], b = s[(o + 2) % a];
|
|
3979
4023
|
let _;
|
|
3980
|
-
|
|
4024
|
+
d.lat === p.lat ? _ = new BMap.Point(d.lng, u.lat) : d.lng === p.lng ? _ = new BMap.Point(u.lng, d.lat) : _ = u, n = [l, b, _];
|
|
3981
4025
|
break;
|
|
3982
4026
|
}
|
|
3983
4027
|
} else if (a === r.length) {
|
|
3984
4028
|
for (let o = 0; o < a; o++)
|
|
3985
|
-
if (!
|
|
4029
|
+
if (!Vt.equals(s[o], r[o])) {
|
|
3986
4030
|
n = [
|
|
3987
4031
|
s[o],
|
|
3988
4032
|
s[(o + 2) % 4]
|
|
@@ -3991,8 +4035,8 @@ class It extends Et {
|
|
|
3991
4035
|
}
|
|
3992
4036
|
} else
|
|
3993
4037
|
a < r.length;
|
|
3994
|
-
const
|
|
3995
|
-
|
|
4038
|
+
const h = R.fromArray(n.map((o) => y.fromBaidu(o, this.coordType)));
|
|
4039
|
+
h && (this.isDoingUpdateRectangle = !0, this.innerOverlay.setPath(h.toRectArray().map((o) => o.toBaidu(this.coordType))), this.isDoingUpdateRectangle = !1);
|
|
3996
4040
|
}, 0);
|
|
3997
4041
|
});
|
|
3998
4042
|
this.addEventListener("bounds-changed", this.onBoundsChanged);
|
|
@@ -4002,15 +4046,15 @@ class It extends Et {
|
|
|
4002
4046
|
enableClicking: e.clickable,
|
|
4003
4047
|
enableEditing: e.editable,
|
|
4004
4048
|
strokeColor: e.strokeColor,
|
|
4005
|
-
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity +
|
|
4049
|
+
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity + B.OPACITY_DELTA : void 0,
|
|
4006
4050
|
strokeWeight: e.strokeWeight,
|
|
4007
4051
|
fillColor: e.fillColor,
|
|
4008
|
-
fillOpacity: e.fillOpacity != null ? e.fillOpacity +
|
|
4052
|
+
fillOpacity: e.fillOpacity != null ? e.fillOpacity + B.OPACITY_DELTA : void 0
|
|
4009
4053
|
});
|
|
4010
|
-
return new
|
|
4054
|
+
return new St(s, r, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
4011
4055
|
}
|
|
4012
4056
|
getBounds() {
|
|
4013
|
-
return
|
|
4057
|
+
return R.fromBaidu(this.innerOverlay.getBounds(), this.coordType);
|
|
4014
4058
|
}
|
|
4015
4059
|
setBounds(e) {
|
|
4016
4060
|
const r = e.toRectArray();
|
|
@@ -4019,7 +4063,7 @@ class It extends Et {
|
|
|
4019
4063
|
}) : this.setPathInternal(r.map((s) => s.toBaidu(this.coordType)));
|
|
4020
4064
|
}
|
|
4021
4065
|
}
|
|
4022
|
-
class
|
|
4066
|
+
class At extends Ve {
|
|
4023
4067
|
static create(t) {
|
|
4024
4068
|
const e = this.coordType, r = new google.maps.Rectangle({
|
|
4025
4069
|
bounds: t.bounds.toGoogle(e),
|
|
@@ -4032,10 +4076,10 @@ class Bt extends Ve {
|
|
|
4032
4076
|
fillOpacity: t.fillOpacity,
|
|
4033
4077
|
visible: t.visible
|
|
4034
4078
|
});
|
|
4035
|
-
return new
|
|
4079
|
+
return new At(r, e, this);
|
|
4036
4080
|
}
|
|
4037
4081
|
getBounds() {
|
|
4038
|
-
return
|
|
4082
|
+
return R.fromGoogle(this.innerOverlay.getBounds() ?? J.BOUNDS_ZERO, this.coordType);
|
|
4039
4083
|
}
|
|
4040
4084
|
setBounds(t) {
|
|
4041
4085
|
const e = t.toGoogle(this.coordType);
|
|
@@ -4043,25 +4087,25 @@ class Bt extends Ve {
|
|
|
4043
4087
|
}
|
|
4044
4088
|
}
|
|
4045
4089
|
const ee = 1;
|
|
4046
|
-
class
|
|
4090
|
+
class zi extends ft {
|
|
4047
4091
|
constructor(e, r) {
|
|
4048
4092
|
var s;
|
|
4049
4093
|
super(e);
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
this.buildInMapTypeId2BIMT =
|
|
4094
|
+
c(this, "buildInMapTypeId2BIMT");
|
|
4095
|
+
c(this, "baiduMapType2BIMT");
|
|
4096
|
+
c(this, "map");
|
|
4097
|
+
c(this, "createLabel", wt.create);
|
|
4098
|
+
c(this, "createCircle", vt.create);
|
|
4099
|
+
c(this, "createPolygon", Bt.create);
|
|
4100
|
+
c(this, "createPolyline", xt.create);
|
|
4101
|
+
c(this, "createRectangle", St.create);
|
|
4102
|
+
c(this, "createInfoWindow", Tt.create);
|
|
4103
|
+
c(this, "createInfoBox", Ot.create);
|
|
4104
|
+
c(this, "createMarker", Ce.create);
|
|
4105
|
+
c(this, "createMapTypeControl", ct.create);
|
|
4106
|
+
c(this, "createZoomControl", pt.create);
|
|
4107
|
+
c(this, "createScaleControl", dt.create);
|
|
4108
|
+
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, {
|
|
4065
4109
|
minZoom: r.minZoom && r.minZoom + ee,
|
|
4066
4110
|
maxZoom: r.maxZoom && r.maxZoom + ee,
|
|
4067
4111
|
mapType: r.buildInMapTypeId && ((s = this.buildInMapTypeId2BIMT.get(r.buildInMapTypeId)) == null ? void 0 : s.asBaiduMapType()),
|
|
@@ -4076,7 +4120,7 @@ class Ri extends gt {
|
|
|
4076
4120
|
});
|
|
4077
4121
|
}
|
|
4078
4122
|
setGestureHandling(e = j.auto) {
|
|
4079
|
-
switch (e === j.auto && (e = this.element.parentElement &&
|
|
4123
|
+
switch (e === j.auto && (e = this.element.parentElement && rt.isScrollable(this.element.parentElement) ? j.cooperative : j.greedy), e) {
|
|
4080
4124
|
case j.cooperative:
|
|
4081
4125
|
this.map.disableScrollWheelZoom(), this.map.enableDragging(), this.map.enableDoubleClickZoom();
|
|
4082
4126
|
break;
|
|
@@ -4175,7 +4219,7 @@ class Ri extends gt {
|
|
|
4175
4219
|
});
|
|
4176
4220
|
}
|
|
4177
4221
|
getBounds() {
|
|
4178
|
-
return
|
|
4222
|
+
return R.fromBaidu(this.map.getBounds(), this.coordType);
|
|
4179
4223
|
}
|
|
4180
4224
|
addElementOverlay(e) {
|
|
4181
4225
|
this.map.addOverlay(e.asBaidu());
|
|
@@ -4194,8 +4238,8 @@ class Ri extends gt {
|
|
|
4194
4238
|
const r = class extends BMap.Control {
|
|
4195
4239
|
constructor() {
|
|
4196
4240
|
super(...arguments);
|
|
4197
|
-
|
|
4198
|
-
|
|
4241
|
+
c(this, "defaultAnchor", z.getBaidu().toValue(e.position));
|
|
4242
|
+
c(this, "defaultOffset", new BMap.Size(0, 0));
|
|
4199
4243
|
}
|
|
4200
4244
|
initialize(n) {
|
|
4201
4245
|
const a = e.onCreateElement();
|
|
@@ -4209,43 +4253,43 @@ class Ri extends gt {
|
|
|
4209
4253
|
e.inner && (oe(e.inner instanceof BMap.Control, `control.inner(${e.inner})需要是BMap.Control`), this.map.removeControl(e.inner));
|
|
4210
4254
|
}
|
|
4211
4255
|
createMarkerClusterer(e) {
|
|
4212
|
-
return new
|
|
4256
|
+
return new Mi(this, e);
|
|
4213
4257
|
}
|
|
4214
4258
|
createAutocomplete(e) {
|
|
4215
|
-
return new
|
|
4259
|
+
return new yi(this, e);
|
|
4216
4260
|
}
|
|
4217
4261
|
createSearchBox(e) {
|
|
4218
|
-
return new
|
|
4262
|
+
return new Li(this, e);
|
|
4219
4263
|
}
|
|
4220
4264
|
createPlacesService(e) {
|
|
4221
|
-
return new
|
|
4265
|
+
return new wi(this, e);
|
|
4222
4266
|
}
|
|
4223
4267
|
createMapUrls(e) {
|
|
4224
|
-
return new
|
|
4268
|
+
return new Ie(e);
|
|
4225
4269
|
}
|
|
4226
4270
|
}
|
|
4227
|
-
class
|
|
4271
|
+
class Di extends ft {
|
|
4228
4272
|
constructor(e, r) {
|
|
4229
4273
|
var n;
|
|
4230
4274
|
super(e);
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
this.mapOptions = r, this.buildInMapTypeId2BIMT =
|
|
4275
|
+
c(this, "buildInMapTypeId2BIMT");
|
|
4276
|
+
c(this, "googleMapTypeId2BIMT");
|
|
4277
|
+
c(this, "map");
|
|
4278
|
+
c(this, "createLabel", Et.create);
|
|
4279
|
+
c(this, "createCircle", _t.create);
|
|
4280
|
+
c(this, "createPolygon", It.create);
|
|
4281
|
+
c(this, "createPolyline", kt.create);
|
|
4282
|
+
c(this, "createRectangle", At.create);
|
|
4283
|
+
c(this, "createInfoWindow", Mt.create);
|
|
4284
|
+
c(this, "createInfoBox", Ct.create);
|
|
4285
|
+
c(this, "createMarker", Lt.create);
|
|
4286
|
+
c(this, "createMapTypeControl", ke.create);
|
|
4287
|
+
c(this, "createZoomControl", gt.create);
|
|
4288
|
+
c(this, "createScaleControl", ut.create);
|
|
4289
|
+
this.mapOptions = r, this.buildInMapTypeId2BIMT = $.BUILD_IN_MAP_TYPES.getValueMap(A.prototype.getId), this.googleMapTypeId2BIMT = $.BUILD_IN_MAP_TYPES.getValueMap(A.prototype.getGoogleMapTypeId);
|
|
4246
4290
|
const s = r.buildInMapTypeId && this.buildInMapTypeId2BIMT.get(r.buildInMapTypeId);
|
|
4247
4291
|
this.map = new google.maps.Map(e, {
|
|
4248
|
-
center: r.center.toGoogle((s ??
|
|
4292
|
+
center: r.center.toGoogle((s ?? $.NORMAL).getGoogleCoordType()),
|
|
4249
4293
|
zoom: r.zoom,
|
|
4250
4294
|
disableDefaultUI: !0,
|
|
4251
4295
|
streetViewControl: !0,
|
|
@@ -4271,20 +4315,20 @@ class $i extends gt {
|
|
|
4271
4315
|
const r = this.innerMap.getProjection(), s = this.innerMap.getBounds();
|
|
4272
4316
|
if (r == null || s == null)
|
|
4273
4317
|
return y.ZERO;
|
|
4274
|
-
const n = r.fromLatLngToPoint(s.getSouthWest()), a = r.fromLatLngToPoint(s.getNorthEast()),
|
|
4275
|
-
if (n == null || a == null ||
|
|
4318
|
+
const n = r.fromLatLngToPoint(s.getSouthWest()), a = r.fromLatLngToPoint(s.getNorthEast()), h = this.innerMap.getZoom();
|
|
4319
|
+
if (n == null || a == null || h == null)
|
|
4276
4320
|
return y.ZERO;
|
|
4277
|
-
const o = Math.pow(2,
|
|
4321
|
+
const o = Math.pow(2, h), l = new google.maps.Point(e.x / o + n.x, e.y / o + a.y);
|
|
4278
4322
|
return y.fromGoogle(r.fromPointToLatLng(l) ?? J.LATLNG_ZERO, this.coordType);
|
|
4279
4323
|
}
|
|
4280
4324
|
fromLatLngToContainerPoint(e) {
|
|
4281
4325
|
const r = this.innerMap.getProjection(), s = this.innerMap.getBounds();
|
|
4282
4326
|
if (r == null || s == null)
|
|
4283
4327
|
return X.ZERO;
|
|
4284
|
-
const n = r.fromLatLngToPoint(s.getSouthWest()), a = r.fromLatLngToPoint(s.getNorthEast()),
|
|
4285
|
-
if (n == null || a == null ||
|
|
4328
|
+
const n = r.fromLatLngToPoint(s.getSouthWest()), a = r.fromLatLngToPoint(s.getNorthEast()), h = this.innerMap.getZoom();
|
|
4329
|
+
if (n == null || a == null || h == null)
|
|
4286
4330
|
return X.ZERO;
|
|
4287
|
-
const o = Math.pow(2,
|
|
4331
|
+
const o = Math.pow(2, h), l = r.fromLatLngToPoint(e.toGoogle(this.coordType));
|
|
4288
4332
|
return l == null ? X.ZERO : { x: (l.x - n.x) * o, y: (l.y - a.y) * o };
|
|
4289
4333
|
}
|
|
4290
4334
|
setDefaultCursor(e) {
|
|
@@ -4317,7 +4361,7 @@ class $i extends gt {
|
|
|
4317
4361
|
this.map.setMapTypeId(r ?? C("理论上来说不可能为空"));
|
|
4318
4362
|
}
|
|
4319
4363
|
setMapType(e) {
|
|
4320
|
-
e instanceof
|
|
4364
|
+
e instanceof A ? this.map.setMapTypeId(e.getGoogleMapTypeId()) : (this.map.mapTypes.set(e.id, e.asGoogleMapType()), this.map.setMapTypeId(e.id));
|
|
4321
4365
|
}
|
|
4322
4366
|
getMapType() {
|
|
4323
4367
|
const e = this.map.getMapTypeId() ?? google.maps.MapTypeId.ROADMAP, r = this.googleMapTypeId2BIMT.get(e);
|
|
@@ -4346,7 +4390,7 @@ class $i extends gt {
|
|
|
4346
4390
|
}
|
|
4347
4391
|
getBounds() {
|
|
4348
4392
|
const e = this.map.getBounds();
|
|
4349
|
-
return e ?
|
|
4393
|
+
return e ? R.fromGoogle(e, this.coordType) : R.EMPTY;
|
|
4350
4394
|
}
|
|
4351
4395
|
addElementOverlay(e) {
|
|
4352
4396
|
e.asGoogle().setMap(this.map);
|
|
@@ -4361,38 +4405,38 @@ class $i extends gt {
|
|
|
4361
4405
|
e.innerOverlay.setMap(null);
|
|
4362
4406
|
}
|
|
4363
4407
|
addCustomControl(e) {
|
|
4364
|
-
e.inner || (e.inner = e.onCreateElement(), this.map.controls[
|
|
4408
|
+
e.inner || (e.inner = e.onCreateElement(), this.map.controls[z.getGoogle().toValue(e.position)].push(e.inner));
|
|
4365
4409
|
}
|
|
4366
4410
|
removeCustomControl(e) {
|
|
4367
4411
|
if (e.inner) {
|
|
4368
|
-
const r = this.map.controls[
|
|
4412
|
+
const r = this.map.controls[z.getGoogle().toValue(e.position)];
|
|
4369
4413
|
ce.remove(r, e.inner);
|
|
4370
4414
|
}
|
|
4371
4415
|
}
|
|
4372
4416
|
createMarkerClusterer(e) {
|
|
4373
|
-
return new
|
|
4417
|
+
return new Oi(this, e);
|
|
4374
4418
|
}
|
|
4375
4419
|
createAutocomplete(e) {
|
|
4376
|
-
return new
|
|
4420
|
+
return new fi(this, e);
|
|
4377
4421
|
}
|
|
4378
4422
|
createSearchBox(e) {
|
|
4379
|
-
return new
|
|
4423
|
+
return new Ei(this, e);
|
|
4380
4424
|
}
|
|
4381
4425
|
createPlacesService(e) {
|
|
4382
|
-
return new
|
|
4426
|
+
return new Ci(this, e);
|
|
4383
4427
|
}
|
|
4384
4428
|
createMapUrls(e) {
|
|
4385
|
-
return new
|
|
4429
|
+
return new Be(e);
|
|
4386
4430
|
}
|
|
4387
4431
|
}
|
|
4388
|
-
class
|
|
4432
|
+
class Ni extends ft {
|
|
4389
4433
|
constructor(e, r) {
|
|
4390
4434
|
var a;
|
|
4391
4435
|
super(e);
|
|
4392
|
-
|
|
4393
|
-
|
|
4436
|
+
c(this, "map");
|
|
4437
|
+
c(this, "defaultLayers");
|
|
4394
4438
|
this.mapOptions = r;
|
|
4395
|
-
const s =
|
|
4439
|
+
const s = ir().here;
|
|
4396
4440
|
Ae.includes(s.version) || C(`不支持${s.version}, HereMap当前只支持如下版本: ${Ae}`);
|
|
4397
4441
|
const n = new H.service.Platform({
|
|
4398
4442
|
app_id: s.key.split(",")[0],
|
|
@@ -4407,7 +4451,7 @@ class Di extends gt {
|
|
|
4407
4451
|
return this.map;
|
|
4408
4452
|
}
|
|
4409
4453
|
get coordType() {
|
|
4410
|
-
return
|
|
4454
|
+
return S.wgs84;
|
|
4411
4455
|
}
|
|
4412
4456
|
getCenter() {
|
|
4413
4457
|
return y.fromHere(this.map.getCenter(), this.coordType);
|
|
@@ -4537,34 +4581,34 @@ class Di extends gt {
|
|
|
4537
4581
|
throw new Error("Method not implemented.");
|
|
4538
4582
|
}
|
|
4539
4583
|
}
|
|
4540
|
-
var G = /* @__PURE__ */ ((i) => (i.google = "google", i.baidu = "baidu", i.here = "here", i))(G || {}),
|
|
4584
|
+
var G = /* @__PURE__ */ ((i) => (i.google = "google", i.baidu = "baidu", i.here = "here", i))(G || {}), st;
|
|
4541
4585
|
((i) => {
|
|
4542
4586
|
function t(e, r, s) {
|
|
4543
|
-
const n =
|
|
4587
|
+
const n = it.create(s);
|
|
4544
4588
|
switch (e) {
|
|
4545
4589
|
case "google":
|
|
4546
|
-
return new
|
|
4590
|
+
return new Di(r, n);
|
|
4547
4591
|
case "baidu":
|
|
4548
|
-
return new
|
|
4592
|
+
return new zi(r, n);
|
|
4549
4593
|
case "here":
|
|
4550
|
-
return new
|
|
4594
|
+
return new Ni(r, n);
|
|
4551
4595
|
}
|
|
4552
4596
|
}
|
|
4553
4597
|
i.createMap = t;
|
|
4554
|
-
})(
|
|
4555
|
-
function
|
|
4556
|
-
const e = window, r =
|
|
4598
|
+
})(st || (st = {}));
|
|
4599
|
+
function Gi({ type: i, config: t }) {
|
|
4600
|
+
const e = window, r = Zi(i);
|
|
4557
4601
|
if (e[r])
|
|
4558
4602
|
return Promise.resolve();
|
|
4559
4603
|
switch (i !== G.here && !t.key && C(`请先配置${i}地图的key`), i) {
|
|
4560
4604
|
case G.google:
|
|
4561
|
-
return {}.VITE_FALSE ? (
|
|
4605
|
+
return {}.VITE_FALSE ? (pi({
|
|
4562
4606
|
key: t.key,
|
|
4563
4607
|
v: "3.52"
|
|
4564
4608
|
// v: config.version,
|
|
4565
|
-
}), google.maps.importLibrary("core")) :
|
|
4609
|
+
}), google.maps.importLibrary("core")) : Ft(`https://maps.googleapis.com/maps/api/js?key=${t.key}&language=${t.language}&v=${t.version}&libraries=${t.libraries.join(",")}`);
|
|
4566
4610
|
case G.baidu:
|
|
4567
|
-
return
|
|
4611
|
+
return Ft(`https://api.map.baidu.com/api?v=${t.version}&ak=${t.key}`);
|
|
4568
4612
|
case G.here:
|
|
4569
4613
|
return ge(pe("core", t.version)).then(() => Promise.all([
|
|
4570
4614
|
// 其他大多数模块都可以同时载入
|
|
@@ -4580,7 +4624,7 @@ function zi({ type: i, config: t }) {
|
|
|
4580
4624
|
function pe(i, t = Ae[0]) {
|
|
4581
4625
|
return `https://js.api.here.com/v3/${t}/mapsjs-${i}.js`;
|
|
4582
4626
|
}
|
|
4583
|
-
function
|
|
4627
|
+
function Zi(i) {
|
|
4584
4628
|
switch (i) {
|
|
4585
4629
|
case G.google:
|
|
4586
4630
|
return "google";
|
|
@@ -4590,10 +4634,10 @@ function Ni(i) {
|
|
|
4590
4634
|
return "H";
|
|
4591
4635
|
}
|
|
4592
4636
|
}
|
|
4593
|
-
let
|
|
4594
|
-
function
|
|
4637
|
+
let Wi = 0;
|
|
4638
|
+
function Ft(i, t = "callback") {
|
|
4595
4639
|
return new Promise((e, r) => {
|
|
4596
|
-
const s = `__callback${
|
|
4640
|
+
const s = `__callback${Wi++}`;
|
|
4597
4641
|
window[s] = e;
|
|
4598
4642
|
const n = document.createElement("script");
|
|
4599
4643
|
n.src = `${i}&${t}=${s}`, n.onerror = r, document.body.appendChild(n);
|
|
@@ -4612,7 +4656,7 @@ function Z(i, t) {
|
|
|
4612
4656
|
validator: (e) => Object.values(i).includes(e)
|
|
4613
4657
|
};
|
|
4614
4658
|
}
|
|
4615
|
-
function
|
|
4659
|
+
function Hi(i, t) {
|
|
4616
4660
|
return {
|
|
4617
4661
|
type: String,
|
|
4618
4662
|
default: t,
|
|
@@ -4631,7 +4675,7 @@ function m(i, t) {
|
|
|
4631
4675
|
default: t
|
|
4632
4676
|
};
|
|
4633
4677
|
}
|
|
4634
|
-
function
|
|
4678
|
+
function Fs(i) {
|
|
4635
4679
|
const t = {};
|
|
4636
4680
|
return Object.entries(i).forEach(([e, r]) => {
|
|
4637
4681
|
const s = `__${e}`;
|
|
@@ -4654,31 +4698,31 @@ const me = {
|
|
|
4654
4698
|
get: ve,
|
|
4655
4699
|
set: ve
|
|
4656
4700
|
};
|
|
4657
|
-
function
|
|
4701
|
+
function ji(i) {
|
|
4658
4702
|
return Object.keys(i).forEach((t) => {
|
|
4659
4703
|
const e = i[t];
|
|
4660
4704
|
let r = !1;
|
|
4661
4705
|
typeof e == "function" ? (me.get = e, me.set = ve, r = !0) : typeof e == "object" && typeof e.get == "function" && (me.get = e.get, me.set = e.set, r = !0), r && (i[t] = Object.defineProperty(i, t, me));
|
|
4662
4706
|
}), i;
|
|
4663
4707
|
}
|
|
4664
|
-
function
|
|
4665
|
-
return
|
|
4708
|
+
function Us(i) {
|
|
4709
|
+
return ji(i);
|
|
4666
4710
|
}
|
|
4667
|
-
function
|
|
4711
|
+
function Er() {
|
|
4668
4712
|
return Je();
|
|
4669
4713
|
}
|
|
4670
|
-
function
|
|
4714
|
+
function xe(i, t) {
|
|
4671
4715
|
const e = i.$options[t];
|
|
4672
4716
|
if (e)
|
|
4673
4717
|
for (const r of e)
|
|
4674
4718
|
r.call(i);
|
|
4675
4719
|
}
|
|
4676
|
-
function
|
|
4720
|
+
function Ys(i, t) {
|
|
4677
4721
|
for (const e of i)
|
|
4678
4722
|
if (e.$options.name === t.name)
|
|
4679
4723
|
return e;
|
|
4680
4724
|
}
|
|
4681
|
-
function
|
|
4725
|
+
function qs(i, t) {
|
|
4682
4726
|
if (!i.default)
|
|
4683
4727
|
return;
|
|
4684
4728
|
const e = i.default();
|
|
@@ -4686,7 +4730,7 @@ function Us(i, t) {
|
|
|
4686
4730
|
if ((r == null ? void 0 : r.type).name === t.name)
|
|
4687
4731
|
return r;
|
|
4688
4732
|
}
|
|
4689
|
-
function
|
|
4733
|
+
function Vi(i, t) {
|
|
4690
4734
|
const e = {}, r = {}, s = {};
|
|
4691
4735
|
return Object.keys(i).forEach((n) => {
|
|
4692
4736
|
n.startsWith("on") ? e[Te.pascal2kebab(n.substring(2))] = i[n] : r[n] = i[n];
|
|
@@ -4702,12 +4746,12 @@ function Hi(i, t) {
|
|
|
4702
4746
|
};
|
|
4703
4747
|
}
|
|
4704
4748
|
function Y(i, t) {
|
|
4705
|
-
return
|
|
4749
|
+
return Yt(() => Vi(i, t));
|
|
4706
4750
|
}
|
|
4707
4751
|
function L() {
|
|
4708
4752
|
return Function;
|
|
4709
4753
|
}
|
|
4710
|
-
const
|
|
4754
|
+
const Ks = () => {
|
|
4711
4755
|
let i, t;
|
|
4712
4756
|
function e(s) {
|
|
4713
4757
|
console.log(s), i = s && s.type, t = Date.now();
|
|
@@ -4716,27 +4760,27 @@ const Ys = () => {
|
|
|
4716
4760
|
((s && s.type) !== i || Date.now() - (t ?? 0) > 1e3) && e(s);
|
|
4717
4761
|
}
|
|
4718
4762
|
return { eventLog: e, eventLogLess: r };
|
|
4719
|
-
},
|
|
4720
|
-
inject: [
|
|
4763
|
+
}, Rt = "$map", we = "onCreate", Ee = "onDestroy", x = w({
|
|
4764
|
+
inject: [Rt],
|
|
4721
4765
|
mounted() {
|
|
4722
|
-
|
|
4766
|
+
xe(this, we);
|
|
4723
4767
|
},
|
|
4724
4768
|
beforeUnmount() {
|
|
4725
|
-
|
|
4769
|
+
xe(this, Ee);
|
|
4726
4770
|
},
|
|
4727
4771
|
methods: {
|
|
4728
4772
|
recreate() {
|
|
4729
|
-
|
|
4773
|
+
xe(this, Ee), xe(this, we);
|
|
4730
4774
|
}
|
|
4731
4775
|
},
|
|
4732
4776
|
render() {
|
|
4733
|
-
return
|
|
4777
|
+
return Er();
|
|
4734
4778
|
}
|
|
4735
|
-
}),
|
|
4779
|
+
}), Fi = w({
|
|
4736
4780
|
name: "tg-map",
|
|
4737
4781
|
provide() {
|
|
4738
4782
|
return {
|
|
4739
|
-
[
|
|
4783
|
+
[Rt]: Yt(() => this.map)
|
|
4740
4784
|
};
|
|
4741
4785
|
},
|
|
4742
4786
|
inheritAttrs: !1,
|
|
@@ -4773,12 +4817,12 @@ const Ys = () => {
|
|
|
4773
4817
|
* 该属性不会响应式更新, 要让它立即生效, 请参考{@link file://./../views/map/InfoDemo.vue#L3}
|
|
4774
4818
|
* @see MapOptions.infoWindowMode
|
|
4775
4819
|
*/
|
|
4776
|
-
infoWindowMode:
|
|
4820
|
+
infoWindowMode: Hi(ki),
|
|
4777
4821
|
gestureHandling: Z(j),
|
|
4778
4822
|
minZoom: m(Number),
|
|
4779
4823
|
maxZoom: m(Number),
|
|
4780
4824
|
mapStyle: m(Object),
|
|
4781
|
-
mapTypeId: Z(
|
|
4825
|
+
mapTypeId: Z(lr),
|
|
4782
4826
|
/** 地图类型对象, 优先级比mapTypeId高 */
|
|
4783
4827
|
mapType: m(Object),
|
|
4784
4828
|
hideLogo: m(Boolean),
|
|
@@ -4833,13 +4877,13 @@ const Ys = () => {
|
|
|
4833
4877
|
},
|
|
4834
4878
|
mapType(i) {
|
|
4835
4879
|
var t;
|
|
4836
|
-
(t = this.map) == null || t.setMapType(i ??
|
|
4880
|
+
(t = this.map) == null || t.setMapType(i ?? $.NORMAL);
|
|
4837
4881
|
}
|
|
4838
4882
|
},
|
|
4839
4883
|
async mounted() {
|
|
4840
4884
|
const i = this.type;
|
|
4841
4885
|
try {
|
|
4842
|
-
await
|
|
4886
|
+
await Gi({ type: i, config: ir()[i] });
|
|
4843
4887
|
} catch (s) {
|
|
4844
4888
|
this.$emit("error", s);
|
|
4845
4889
|
return;
|
|
@@ -4848,7 +4892,7 @@ const Ys = () => {
|
|
|
4848
4892
|
console.warn(`tg-map(type=${i})已销毁, 不需要继续执行`);
|
|
4849
4893
|
return;
|
|
4850
4894
|
}
|
|
4851
|
-
const t =
|
|
4895
|
+
const t = st.createMap(
|
|
4852
4896
|
i,
|
|
4853
4897
|
this.$refs.map,
|
|
4854
4898
|
/* options: */
|
|
@@ -4863,17 +4907,17 @@ const Ys = () => {
|
|
|
4863
4907
|
buildInMapTypeId: this.mapTypeId
|
|
4864
4908
|
}
|
|
4865
4909
|
);
|
|
4866
|
-
if (this.map =
|
|
4910
|
+
if (this.map = Ar(t), this.mapType && t.setMapType(this.mapType), "ready" in this.attrs.listeners && console.error("地图载入完成的事件已经从ready改为了load, 请手动修改"), U(
|
|
4867
4911
|
this.attrs.listeners,
|
|
4868
4912
|
t,
|
|
4869
4913
|
/* excludes: */
|
|
4870
4914
|
["load"]
|
|
4871
|
-
), this.$emit("load", t),
|
|
4915
|
+
), this.$emit("load", t), qt([
|
|
4872
4916
|
() => this.zoom,
|
|
4873
4917
|
() => this.center
|
|
4874
4918
|
//
|
|
4875
|
-
], ([s, n], [a,
|
|
4876
|
-
s !== a && t.setZoom(s), n !==
|
|
4919
|
+
], ([s, n], [a, h]) => {
|
|
4920
|
+
s !== a && t.setZoom(s), n !== h && (t.getCenter().equals(n) || t.setCenter(n));
|
|
4877
4921
|
}), "update:center" in this.attrs.listenerProps) {
|
|
4878
4922
|
const s = () => this.$emit("update:center", t.getCenter());
|
|
4879
4923
|
t.addEventListener("center-changed", () => {
|
|
@@ -4902,9 +4946,9 @@ const q = (i, t) => {
|
|
|
4902
4946
|
e[r] = s;
|
|
4903
4947
|
return e;
|
|
4904
4948
|
};
|
|
4905
|
-
function
|
|
4949
|
+
function Ui(i, t, e, r, s, n) {
|
|
4906
4950
|
return V(), F("div", ue({ class: "tg-map" }, i.attrs.binds), [
|
|
4907
|
-
|
|
4951
|
+
Rr("div", {
|
|
4908
4952
|
ref: "map",
|
|
4909
4953
|
class: Ze({
|
|
4910
4954
|
"tg-map__map": !0,
|
|
@@ -4916,8 +4960,8 @@ function Vi(i, t, e, r, s, n) {
|
|
|
4916
4960
|
W(i.$slots, "overlay")
|
|
4917
4961
|
], 16);
|
|
4918
4962
|
}
|
|
4919
|
-
const
|
|
4920
|
-
function
|
|
4963
|
+
const Le = /* @__PURE__ */ q(Fi, [["render", Ui]]);
|
|
4964
|
+
function Yi(i) {
|
|
4921
4965
|
if (i == null)
|
|
4922
4966
|
return;
|
|
4923
4967
|
let t;
|
|
@@ -4928,7 +4972,7 @@ function Fi(i) {
|
|
|
4928
4972
|
t = i;
|
|
4929
4973
|
return `${t}px`;
|
|
4930
4974
|
}
|
|
4931
|
-
const
|
|
4975
|
+
const qi = w({
|
|
4932
4976
|
name: "tg-map-widget",
|
|
4933
4977
|
props: {
|
|
4934
4978
|
left: {
|
|
@@ -4954,20 +4998,20 @@ const Ui = w({
|
|
|
4954
4998
|
}
|
|
4955
4999
|
},
|
|
4956
5000
|
methods: {
|
|
4957
|
-
dimen:
|
|
5001
|
+
dimen: Yi
|
|
4958
5002
|
}
|
|
4959
5003
|
});
|
|
4960
|
-
function
|
|
5004
|
+
function Ki(i, t, e, r, s, n) {
|
|
4961
5005
|
return V(), F("div", {
|
|
4962
5006
|
class: Ze(i.$options.name),
|
|
4963
|
-
style:
|
|
5007
|
+
style: $r({ left: i.dimen(i.left), top: i.dimen(i.topValue), right: i.dimen(i.right), bottom: i.dimen(i.bottom) })
|
|
4964
5008
|
}, [
|
|
4965
5009
|
W(i.$slots, "default")
|
|
4966
5010
|
], 6);
|
|
4967
5011
|
}
|
|
4968
|
-
const
|
|
5012
|
+
const Xi = /* @__PURE__ */ q(qi, [["render", Ki]]), Ji = w({
|
|
4969
5013
|
name: "tg-custom-control",
|
|
4970
|
-
mixins: [
|
|
5014
|
+
mixins: [x],
|
|
4971
5015
|
props: {
|
|
4972
5016
|
position: Z(I, I.RIGHT_BOTTOM)
|
|
4973
5017
|
},
|
|
@@ -4982,8 +5026,8 @@ const qi = /* @__PURE__ */ q(Ui, [["render", Yi]]), Ki = w({
|
|
|
4982
5026
|
}
|
|
4983
5027
|
},
|
|
4984
5028
|
onCreate() {
|
|
4985
|
-
|
|
4986
|
-
const { $el: i } = this, t = class extends
|
|
5029
|
+
Jt(this.$parent, Le) || console.warn("请将tg-custom-control放到tg-map中");
|
|
5030
|
+
const { $el: i } = this, t = class extends di {
|
|
4987
5031
|
onCreateElement() {
|
|
4988
5032
|
return i;
|
|
4989
5033
|
}
|
|
@@ -4994,19 +5038,19 @@ const qi = /* @__PURE__ */ q(Ui, [["render", Yi]]), Ki = w({
|
|
|
4994
5038
|
this.$map.removeCustomControl(this.control);
|
|
4995
5039
|
}
|
|
4996
5040
|
});
|
|
4997
|
-
function
|
|
5041
|
+
function Qi(i, t, e, r, s, n) {
|
|
4998
5042
|
return V(), F("div", {
|
|
4999
5043
|
class: Ze(i.$options.name)
|
|
5000
5044
|
}, [
|
|
5001
5045
|
W(i.$slots, "default")
|
|
5002
5046
|
], 2);
|
|
5003
5047
|
}
|
|
5004
|
-
const
|
|
5048
|
+
const es = /* @__PURE__ */ q(Ji, [["render", Qi]]), ts = w({
|
|
5005
5049
|
name: "tg-map-type-control",
|
|
5006
|
-
mixins: [
|
|
5050
|
+
mixins: [x],
|
|
5007
5051
|
props: {
|
|
5008
5052
|
position: Z(I, I.TOP_LEFT),
|
|
5009
|
-
type: Z(
|
|
5053
|
+
type: Z(hr),
|
|
5010
5054
|
mapTypes: m(Array)
|
|
5011
5055
|
},
|
|
5012
5056
|
setup() {
|
|
@@ -5034,9 +5078,9 @@ const Ji = /* @__PURE__ */ q(Ki, [["render", Xi]]), Qi = w({
|
|
|
5034
5078
|
onDestroy() {
|
|
5035
5079
|
this.$map.removeControl(this.control);
|
|
5036
5080
|
}
|
|
5037
|
-
}),
|
|
5081
|
+
}), rs = w({
|
|
5038
5082
|
name: "tg-scale-control",
|
|
5039
|
-
mixins: [
|
|
5083
|
+
mixins: [x],
|
|
5040
5084
|
props: {
|
|
5041
5085
|
position: Z(I, I.BOTTOM_RIGHT)
|
|
5042
5086
|
},
|
|
@@ -5057,20 +5101,20 @@ const Ji = /* @__PURE__ */ q(Ki, [["render", Xi]]), Qi = w({
|
|
|
5057
5101
|
this.$map.removeControl(this.control);
|
|
5058
5102
|
}
|
|
5059
5103
|
});
|
|
5060
|
-
function
|
|
5104
|
+
function Lr() {
|
|
5061
5105
|
var e;
|
|
5062
|
-
const i = (e =
|
|
5106
|
+
const i = (e = zr()) == null ? void 0 : e.type;
|
|
5063
5107
|
let t = (i == null ? void 0 : i.name) ?? (i == null ? void 0 : i.__name);
|
|
5064
5108
|
if (!t) {
|
|
5065
5109
|
const r = i == null ? void 0 : i.__file;
|
|
5066
|
-
r && (t =
|
|
5110
|
+
r && (t = Si.basename(r, ".vue"));
|
|
5067
5111
|
}
|
|
5068
5112
|
return t;
|
|
5069
5113
|
}
|
|
5070
|
-
function
|
|
5071
|
-
const i =
|
|
5114
|
+
function is() {
|
|
5115
|
+
const i = Dr(Rt);
|
|
5072
5116
|
let t, e;
|
|
5073
|
-
return i == null && C(`<${
|
|
5117
|
+
return i == null && C(`<${Lr() || "unknown"}>必须作为<tg-map>的子代组件`), {
|
|
5074
5118
|
mapRef: i,
|
|
5075
5119
|
/** 读取map对象, 只要放在<tg-map>里面的组件(除#overlay插槽外)都能够立即读取到map对象 */
|
|
5076
5120
|
get map() {
|
|
@@ -5078,11 +5122,11 @@ function ts() {
|
|
|
5078
5122
|
},
|
|
5079
5123
|
/** 地图元素创建回调 */
|
|
5080
5124
|
[we](r) {
|
|
5081
|
-
|
|
5125
|
+
Nr(r), t && C(`${we}只能调用一次`), t = r;
|
|
5082
5126
|
},
|
|
5083
5127
|
/** 地图元素销毁回调 */
|
|
5084
5128
|
[Ee](r) {
|
|
5085
|
-
|
|
5129
|
+
Gr(r), e && C(`${Ee}只能调用一次`), e = r;
|
|
5086
5130
|
},
|
|
5087
5131
|
/** 重新创建地图元素 */
|
|
5088
5132
|
recreate() {
|
|
@@ -5090,25 +5134,25 @@ function ts() {
|
|
|
5090
5134
|
}
|
|
5091
5135
|
};
|
|
5092
5136
|
}
|
|
5093
|
-
const
|
|
5137
|
+
const ss = w({
|
|
5094
5138
|
name: "tg-zoom-control",
|
|
5095
5139
|
props: {
|
|
5096
5140
|
position: Z(I, I.RIGHT_BOTTOM)
|
|
5097
5141
|
},
|
|
5098
5142
|
setup(i) {
|
|
5099
5143
|
let t = void 0;
|
|
5100
|
-
const { map: e, onCreate: r, onDestroy: s } =
|
|
5144
|
+
const { map: e, onCreate: r, onDestroy: s } = is();
|
|
5101
5145
|
return r(() => {
|
|
5102
5146
|
t = e.createZoomControl(i), e.addControl(t);
|
|
5103
5147
|
}), s(() => {
|
|
5104
5148
|
e.removeControl(t);
|
|
5105
|
-
}),
|
|
5149
|
+
}), qt(() => i.position, (n) => {
|
|
5106
5150
|
t.setPosition(n);
|
|
5107
|
-
}),
|
|
5151
|
+
}), Er;
|
|
5108
5152
|
}
|
|
5109
|
-
}),
|
|
5153
|
+
}), ns = w({
|
|
5110
5154
|
name: "tg-marker-clusterer",
|
|
5111
|
-
mixins: [
|
|
5155
|
+
mixins: [x],
|
|
5112
5156
|
// markers从this.$children中读取, 故需要省略(Omit)
|
|
5113
5157
|
props: {
|
|
5114
5158
|
gridSize: m(Number),
|
|
@@ -5170,16 +5214,16 @@ const rs = w({
|
|
|
5170
5214
|
}
|
|
5171
5215
|
}
|
|
5172
5216
|
});
|
|
5173
|
-
function
|
|
5217
|
+
function os(i, t, e, r, s, n) {
|
|
5174
5218
|
return V(), F("div", {
|
|
5175
5219
|
class: Ze(i.$options.name)
|
|
5176
5220
|
}, [
|
|
5177
5221
|
W(i.$slots, "default")
|
|
5178
5222
|
], 2);
|
|
5179
5223
|
}
|
|
5180
|
-
const
|
|
5224
|
+
const Pr = /* @__PURE__ */ q(ns, [["render", os]]), as = w({
|
|
5181
5225
|
name: "tg-traffic-layer",
|
|
5182
|
-
mixins: [
|
|
5226
|
+
mixins: [x],
|
|
5183
5227
|
// 请直接使用v-if来控制它的显隐
|
|
5184
5228
|
// 没有属性时, 写`{}`类型推断会有问题, 故注释掉
|
|
5185
5229
|
// props: {} satisfies Props<{}>,
|
|
@@ -5190,14 +5234,14 @@ const Er = /* @__PURE__ */ q(is, [["render", ss]]), ns = w({
|
|
|
5190
5234
|
},
|
|
5191
5235
|
watch: {},
|
|
5192
5236
|
onCreate() {
|
|
5193
|
-
this.layer = new
|
|
5237
|
+
this.layer = new ui(), this.$map.addLayer(this.layer);
|
|
5194
5238
|
},
|
|
5195
5239
|
onDestroy() {
|
|
5196
5240
|
this.$map.removeLayer(this.layer);
|
|
5197
5241
|
}
|
|
5198
|
-
}),
|
|
5242
|
+
}), ls = w({
|
|
5199
5243
|
name: "tg-circle",
|
|
5200
|
-
mixins: [
|
|
5244
|
+
mixins: [x],
|
|
5201
5245
|
inheritAttrs: !1,
|
|
5202
5246
|
props: {
|
|
5203
5247
|
center: D(y),
|
|
@@ -5275,7 +5319,7 @@ const Er = /* @__PURE__ */ q(is, [["render", ss]]), ns = w({
|
|
|
5275
5319
|
this.$map.removeOverlay(this.overlay);
|
|
5276
5320
|
}
|
|
5277
5321
|
});
|
|
5278
|
-
class
|
|
5322
|
+
class hs extends Ai {
|
|
5279
5323
|
constructor(t, e, r, s) {
|
|
5280
5324
|
super(t, e), this.content = r, this.position = s;
|
|
5281
5325
|
}
|
|
@@ -5290,9 +5334,9 @@ class as extends Bi {
|
|
|
5290
5334
|
this.position = t, this.draw();
|
|
5291
5335
|
}
|
|
5292
5336
|
}
|
|
5293
|
-
const
|
|
5337
|
+
const cs = w({
|
|
5294
5338
|
name: "tg-element-overlay",
|
|
5295
|
-
mixins: [
|
|
5339
|
+
mixins: [x],
|
|
5296
5340
|
props: {
|
|
5297
5341
|
mapPane: Z(Me, Me.overlayMouseTarget),
|
|
5298
5342
|
position: D(y)
|
|
@@ -5316,22 +5360,22 @@ const ls = w({
|
|
|
5316
5360
|
}
|
|
5317
5361
|
},
|
|
5318
5362
|
onCreate() {
|
|
5319
|
-
this.overlay = new
|
|
5363
|
+
this.overlay = new hs(this.$map, this, this.content(), this.position), this.$map.addElementOverlay(this.overlay);
|
|
5320
5364
|
},
|
|
5321
5365
|
onDestroy() {
|
|
5322
5366
|
this.$map.removeElementOverlay(this.overlay);
|
|
5323
5367
|
}
|
|
5324
5368
|
});
|
|
5325
|
-
function
|
|
5369
|
+
function ds(i, t, e, r, s, n) {
|
|
5326
5370
|
return V(), F("div", ue({
|
|
5327
5371
|
class: i.$options.name
|
|
5328
5372
|
}, i.$attrs), [
|
|
5329
5373
|
W(i.$slots, "default")
|
|
5330
5374
|
], 16);
|
|
5331
5375
|
}
|
|
5332
|
-
const
|
|
5376
|
+
const us = /* @__PURE__ */ q(cs, [["render", ds]]), ps = w({
|
|
5333
5377
|
name: "tg-marker",
|
|
5334
|
-
mixins: [
|
|
5378
|
+
mixins: [x],
|
|
5335
5379
|
inheritAttrs: !1,
|
|
5336
5380
|
props: {
|
|
5337
5381
|
position: D(y),
|
|
@@ -5343,6 +5387,7 @@ const cs = /* @__PURE__ */ q(ls, [["render", hs]]), ds = w({
|
|
|
5343
5387
|
cursor: m(String),
|
|
5344
5388
|
zIndex: m(Number),
|
|
5345
5389
|
visible: m(Boolean),
|
|
5390
|
+
normalizePositionForBaidu: m(Boolean),
|
|
5346
5391
|
"onUpdate:position": L()
|
|
5347
5392
|
},
|
|
5348
5393
|
emits: void 0,
|
|
@@ -5399,7 +5444,7 @@ const cs = /* @__PURE__ */ q(ls, [["render", hs]]), ds = w({
|
|
|
5399
5444
|
},
|
|
5400
5445
|
methods: {
|
|
5401
5446
|
$clusterer() {
|
|
5402
|
-
return
|
|
5447
|
+
return Jt(this.$parent, Pr);
|
|
5403
5448
|
},
|
|
5404
5449
|
onAddLabel(i) {
|
|
5405
5450
|
this.label = i, this.marker && this.marker.setLabel(i.overlay);
|
|
@@ -5418,16 +5463,16 @@ const cs = /* @__PURE__ */ q(ls, [["render", hs]]), ds = w({
|
|
|
5418
5463
|
}
|
|
5419
5464
|
}
|
|
5420
5465
|
});
|
|
5421
|
-
function
|
|
5466
|
+
function gs(i, t, e, r, s, n) {
|
|
5422
5467
|
return V(), F("div", ue({
|
|
5423
5468
|
class: i.$options.name
|
|
5424
5469
|
}, i.attrs.binds), [
|
|
5425
5470
|
W(i.$slots, "default")
|
|
5426
5471
|
], 16);
|
|
5427
5472
|
}
|
|
5428
|
-
const Fe = /* @__PURE__ */ q(
|
|
5473
|
+
const Fe = /* @__PURE__ */ q(ps, [["render", gs]]), ms = w({
|
|
5429
5474
|
name: "tg-info-box",
|
|
5430
|
-
mixins: [
|
|
5475
|
+
mixins: [x],
|
|
5431
5476
|
inheritAttrs: !1,
|
|
5432
5477
|
props: {
|
|
5433
5478
|
show: D(Boolean),
|
|
@@ -5488,7 +5533,7 @@ const Fe = /* @__PURE__ */ q(ds, [["render", us]]), ps = w({
|
|
|
5488
5533
|
return this.$el;
|
|
5489
5534
|
},
|
|
5490
5535
|
$marker() {
|
|
5491
|
-
return
|
|
5536
|
+
return ot(Fe, this.$parent, Le);
|
|
5492
5537
|
},
|
|
5493
5538
|
open(i) {
|
|
5494
5539
|
this.overlay.open(i);
|
|
@@ -5498,16 +5543,16 @@ const Fe = /* @__PURE__ */ q(ds, [["render", us]]), ps = w({
|
|
|
5498
5543
|
}
|
|
5499
5544
|
}
|
|
5500
5545
|
});
|
|
5501
|
-
function
|
|
5546
|
+
function fs(i, t, e, r, s, n) {
|
|
5502
5547
|
return V(), F("div", ue({
|
|
5503
5548
|
class: i.$options.name
|
|
5504
5549
|
}, i.attrs.binds), [
|
|
5505
5550
|
W(i.$slots, "default")
|
|
5506
5551
|
], 16);
|
|
5507
5552
|
}
|
|
5508
|
-
const
|
|
5553
|
+
const ys = /* @__PURE__ */ q(ms, [["render", fs]]), vs = w({
|
|
5509
5554
|
name: "tg-info-window",
|
|
5510
|
-
mixins: [
|
|
5555
|
+
mixins: [x],
|
|
5511
5556
|
inheritAttrs: !1,
|
|
5512
5557
|
props: {
|
|
5513
5558
|
show: D(Boolean),
|
|
@@ -5546,7 +5591,7 @@ const ms = /* @__PURE__ */ q(ps, [["render", gs]]), fs = w({
|
|
|
5546
5591
|
return this.$el;
|
|
5547
5592
|
},
|
|
5548
5593
|
$marker() {
|
|
5549
|
-
return
|
|
5594
|
+
return ot(Fe, this.$parent, Le);
|
|
5550
5595
|
},
|
|
5551
5596
|
getOptions() {
|
|
5552
5597
|
return {
|
|
@@ -5569,18 +5614,18 @@ const ms = /* @__PURE__ */ q(ps, [["render", gs]]), fs = w({
|
|
|
5569
5614
|
this.$marker() ? this.$marker().onRemoveInfo(this) : this.overlay.close();
|
|
5570
5615
|
}
|
|
5571
5616
|
});
|
|
5572
|
-
function
|
|
5573
|
-
return
|
|
5617
|
+
function _s(i, t, e, r, s, n) {
|
|
5618
|
+
return Zr((V(), F("div", ue({
|
|
5574
5619
|
class: i.$options.name
|
|
5575
5620
|
}, i.attrs.binds), [
|
|
5576
5621
|
W(i.$slots, "default")
|
|
5577
5622
|
], 16)), [
|
|
5578
|
-
[
|
|
5623
|
+
[Wr, i.show]
|
|
5579
5624
|
]);
|
|
5580
5625
|
}
|
|
5581
|
-
const
|
|
5626
|
+
const bs = /* @__PURE__ */ q(vs, [["render", _s]]), Ts = w({
|
|
5582
5627
|
name: "tg-label",
|
|
5583
|
-
mixins: [
|
|
5628
|
+
mixins: [x],
|
|
5584
5629
|
inheritAttrs: !1,
|
|
5585
5630
|
props: {
|
|
5586
5631
|
position: m(y),
|
|
@@ -5621,7 +5666,7 @@ const vs = /* @__PURE__ */ q(fs, [["render", ys]]), _s = w({
|
|
|
5621
5666
|
return (i = this.$marker()) == null ? void 0 : i.marker;
|
|
5622
5667
|
},
|
|
5623
5668
|
$marker() {
|
|
5624
|
-
return
|
|
5669
|
+
return ot(Fe, this.$parent, Le);
|
|
5625
5670
|
},
|
|
5626
5671
|
getOptions() {
|
|
5627
5672
|
return {
|
|
@@ -5640,16 +5685,16 @@ const vs = /* @__PURE__ */ q(fs, [["render", ys]]), _s = w({
|
|
|
5640
5685
|
this.$marker() ? this.$marker().onRemoveLabel(this) : this.$map.removeOverlay(this.overlay);
|
|
5641
5686
|
}
|
|
5642
5687
|
});
|
|
5643
|
-
function
|
|
5688
|
+
function Ms(i, t, e, r, s, n) {
|
|
5644
5689
|
return V(), F("div", ue({
|
|
5645
5690
|
class: i.$options.name
|
|
5646
5691
|
}, i.attrs.binds), [
|
|
5647
5692
|
W(i.$slots, "default")
|
|
5648
5693
|
], 16);
|
|
5649
5694
|
}
|
|
5650
|
-
const
|
|
5695
|
+
const Os = /* @__PURE__ */ q(Ts, [["render", Ms]]), Cs = w({
|
|
5651
5696
|
name: "tg-polygon",
|
|
5652
|
-
mixins: [
|
|
5697
|
+
mixins: [x],
|
|
5653
5698
|
inheritAttrs: !1,
|
|
5654
5699
|
props: {
|
|
5655
5700
|
paths: D(Array),
|
|
@@ -5716,9 +5761,9 @@ const Ts = /* @__PURE__ */ q(_s, [["render", bs]]), Ms = w({
|
|
|
5716
5761
|
onDestroy() {
|
|
5717
5762
|
this.$map.removeOverlay(this.overlay);
|
|
5718
5763
|
}
|
|
5719
|
-
}),
|
|
5764
|
+
}), ws = w({
|
|
5720
5765
|
name: "tg-polyline",
|
|
5721
|
-
mixins: [
|
|
5766
|
+
mixins: [x],
|
|
5722
5767
|
inheritAttrs: !1,
|
|
5723
5768
|
props: {
|
|
5724
5769
|
path: D(Array),
|
|
@@ -5777,9 +5822,9 @@ const Ts = /* @__PURE__ */ q(_s, [["render", bs]]), Ms = w({
|
|
|
5777
5822
|
onDestroy() {
|
|
5778
5823
|
this.$map.removeOverlay(this.overlay);
|
|
5779
5824
|
}
|
|
5780
|
-
}),
|
|
5825
|
+
}), Es = w({
|
|
5781
5826
|
name: "tg-rectangle",
|
|
5782
|
-
mixins: [
|
|
5827
|
+
mixins: [x],
|
|
5783
5828
|
inheritAttrs: !1,
|
|
5784
5829
|
props: {
|
|
5785
5830
|
bounds: D(Object),
|
|
@@ -5843,13 +5888,13 @@ const Ts = /* @__PURE__ */ q(_s, [["render", bs]]), Ms = w({
|
|
|
5843
5888
|
onDestroy() {
|
|
5844
5889
|
this.$map.removeOverlay(this.overlay);
|
|
5845
5890
|
}
|
|
5846
|
-
}),
|
|
5891
|
+
}), Ls = ["beforeUpdate", "updated"], Xs = {
|
|
5847
5892
|
install(i, t = {}) {
|
|
5848
5893
|
if (t.enable !== !1) {
|
|
5849
5894
|
const e = w({
|
|
5850
5895
|
beforeCreate() {
|
|
5851
|
-
const r =
|
|
5852
|
-
t.hookNames ? t.hookNames.includes(a) && console.debug("[lifecycle]", r, a) :
|
|
5896
|
+
const r = Lr() ?? "", n = (t.nameRegex || /^[A-Z]/).test(r) ? (a) => {
|
|
5897
|
+
t.hookNames ? t.hookNames.includes(a) && console.debug("[lifecycle]", r, a) : Ls.includes(a) || console.debug("[lifecycle]", r, a);
|
|
5853
5898
|
} : ve;
|
|
5854
5899
|
n("beforeCreate"), this.__life_impl = n;
|
|
5855
5900
|
},
|
|
@@ -5889,44 +5934,44 @@ const Ts = /* @__PURE__ */ q(_s, [["render", bs]]), Ms = w({
|
|
|
5889
5934
|
i.mixin(e);
|
|
5890
5935
|
}
|
|
5891
5936
|
}
|
|
5892
|
-
},
|
|
5937
|
+
}, Ps = 6378137;
|
|
5893
5938
|
function ye(i) {
|
|
5894
5939
|
return i * Math.PI / 180;
|
|
5895
5940
|
}
|
|
5896
|
-
function
|
|
5941
|
+
function Ut(i) {
|
|
5897
5942
|
return i * 180 / Math.PI;
|
|
5898
5943
|
}
|
|
5899
|
-
function
|
|
5944
|
+
function xs(i, t) {
|
|
5900
5945
|
if (i.lat === t.lat && i.lng === t.lng)
|
|
5901
5946
|
return 0;
|
|
5902
5947
|
const e = ye((i.lat + t.lat) / 2), r = ye((i.lat - t.lat) / 2), s = ye((i.lng - t.lng) / 2);
|
|
5903
|
-
let n = Math.sin(r), a = Math.sin(s),
|
|
5904
|
-
const o =
|
|
5905
|
-
n = n * n, a = a * a,
|
|
5906
|
-
const
|
|
5907
|
-
return _ * (1 + l * (T *
|
|
5908
|
-
}
|
|
5909
|
-
function
|
|
5910
|
-
const s = 63567523142e-4, n = 1 / 298.257223563, a = ye(t),
|
|
5911
|
-
let v = 0, O = 0,
|
|
5948
|
+
let n = Math.sin(r), a = Math.sin(s), h = Math.sin(e);
|
|
5949
|
+
const o = Ps, l = 1 / 298.257;
|
|
5950
|
+
n = n * n, a = a * a, h = h * h;
|
|
5951
|
+
const d = n * (1 - a) + (1 - h) * a, u = (1 - n) * (1 - a) + h * a, p = Math.atan(Math.sqrt(d / u)), b = Math.sqrt(d * u) / p, _ = 2 * p * o, T = (3 * b - 1) / 2 / u, g = (3 * b + 1) / 2 / d;
|
|
5952
|
+
return _ * (1 + l * (T * h * (1 - n) - g * (1 - h) * n));
|
|
5953
|
+
}
|
|
5954
|
+
function ks(i, t, e) {
|
|
5955
|
+
const s = 63567523142e-4, n = 1 / 298.257223563, a = ye(t), h = Math.sin(a), o = Math.cos(a), l = (1 - n) * Math.tan(ye(i.lat)), d = 1 / Math.sqrt(1 + l * l), u = l * d, p = Math.atan2(l, o), b = d * h, _ = 1 - b * b, T = _ * (6378137 * 6378137 - s * s) / (s * s), g = 1 + T / 16384 * (4096 + T * (-768 + T * (320 - 175 * T))), f = T / 1024 * (256 + T * (-128 + T * (74 - 47 * T)));
|
|
5956
|
+
let v = 0, O = 0, P = 0, E = e / (s * g), Q = 2 * Math.PI;
|
|
5912
5957
|
for (; Math.abs(E - Q) > 1e-12; ) {
|
|
5913
|
-
v = Math.cos(2 * p + E), O = Math.sin(E),
|
|
5914
|
-
const
|
|
5915
|
-
Q = E, E = e / (s * g) +
|
|
5958
|
+
v = Math.cos(2 * p + E), O = Math.sin(E), P = Math.cos(E);
|
|
5959
|
+
const Br = f * O * (v + f / 4 * (P * (-1 + 2 * v * v) - f / 6 * v * (-3 + 4 * O * O) * (-3 + 4 * v * v)));
|
|
5960
|
+
Q = E, E = e / (s * g) + Br;
|
|
5916
5961
|
}
|
|
5917
|
-
const ie = u * O -
|
|
5918
|
-
u *
|
|
5962
|
+
const ie = u * O - d * P * o, Ue = Math.atan2(
|
|
5963
|
+
u * P + d * O * o,
|
|
5919
5964
|
(1 - n) * Math.sqrt(b * b + ie * ie)
|
|
5920
|
-
),
|
|
5921
|
-
return { lng: i.lng +
|
|
5965
|
+
), xr = Math.atan2(O * h, d * P - u * O * o), Ye = n / 16 * _ * (4 + n * (4 - 3 * _)), kr = xr - (1 - Ye) * n * b * (E + Ye * O * (v + Ye * P * (-1 + 2 * v * v)));
|
|
5966
|
+
return { lng: i.lng + Ut(kr), lat: Ut(Ue) };
|
|
5922
5967
|
}
|
|
5923
|
-
const
|
|
5924
|
-
getDistance:
|
|
5925
|
-
getDestination:
|
|
5926
|
-
},
|
|
5968
|
+
const Js = {
|
|
5969
|
+
getDistance: xs,
|
|
5970
|
+
getDestination: ks
|
|
5971
|
+
}, Qs = {
|
|
5927
5972
|
install(i, t) {
|
|
5928
|
-
if (
|
|
5929
|
-
const r = /* @__PURE__ */ Object.assign({ "./TgMap.vue":
|
|
5973
|
+
if (ai(t), {}.VITE_FALSE) {
|
|
5974
|
+
const r = /* @__PURE__ */ Object.assign({ "./TgMap.vue": Le, "./TgMapWidget.vue": Xi, "./controls/TgCustomControl.vue": es, "./controls/TgMapTypeControl.vue": ts, "./controls/TgScaleControl.vue": rs, "./controls/TgZoomControl.vue": ss, "./extra/TgMarkerClusterer.vue": Pr, "./layers/TgTrafficLayer.vue": as, "./overlays/TgCircle.vue": ls, "./overlays/TgElementOverlay.vue": us, "./overlays/TgInfoBox.vue": ys, "./overlays/TgInfoWindow.vue": bs, "./overlays/TgLabel.vue": Os, "./overlays/TgMarker.vue": Fe, "./overlays/TgPolygon.vue": Cs, "./overlays/TgPolyline.vue": ws, "./overlays/TgRectangle.vue": Es });
|
|
5930
5975
|
Object.keys(r).forEach((s) => {
|
|
5931
5976
|
const n = r[s];
|
|
5932
5977
|
i.component(n.name ?? C(`Tg开头的组件必须设置name: ${s}`), n);
|
|
@@ -5937,136 +5982,138 @@ const Ks = {
|
|
|
5937
5982
|
}
|
|
5938
5983
|
};
|
|
5939
5984
|
export {
|
|
5940
|
-
|
|
5941
|
-
|
|
5985
|
+
ar as AbstractControl,
|
|
5986
|
+
ft as AbstractMap,
|
|
5942
5987
|
he as Arrays,
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
|
|
5946
|
-
|
|
5947
|
-
|
|
5948
|
-
|
|
5949
|
-
|
|
5950
|
-
|
|
5988
|
+
pr as Autocomplete,
|
|
5989
|
+
yi as BaiduAutocomplete,
|
|
5990
|
+
vt as BaiduCircle,
|
|
5991
|
+
lt as BaiduControl,
|
|
5992
|
+
Ot as BaiduInfoBoxOverlay,
|
|
5993
|
+
Tt as BaiduInfoWindow,
|
|
5994
|
+
ct as BaiduMapTypeControl,
|
|
5995
|
+
Ie as BaiduMapUrls,
|
|
5951
5996
|
Ce as BaiduMarker,
|
|
5952
|
-
|
|
5997
|
+
Mi as BaiduMarkerClusterer,
|
|
5953
5998
|
je as BaiduOverlay,
|
|
5954
|
-
|
|
5955
|
-
|
|
5956
|
-
|
|
5957
|
-
|
|
5958
|
-
|
|
5959
|
-
|
|
5960
|
-
|
|
5961
|
-
|
|
5962
|
-
|
|
5963
|
-
|
|
5999
|
+
wi as BaiduPlacesService,
|
|
6000
|
+
Pt as BaiduPolyShape,
|
|
6001
|
+
Bt as BaiduPolygon,
|
|
6002
|
+
xt as BaiduPolyline,
|
|
6003
|
+
St as BaiduRectangle,
|
|
6004
|
+
dt as BaiduScaleControl,
|
|
6005
|
+
Li as BaiduSearchBox,
|
|
6006
|
+
pt as BaiduZoomControl,
|
|
6007
|
+
A as BuildInMapType,
|
|
6008
|
+
lr as BuildInMapTypeId,
|
|
5964
6009
|
fe as CachedValue,
|
|
5965
6010
|
I as ControlPosition,
|
|
5966
|
-
|
|
5967
|
-
|
|
5968
|
-
|
|
5969
|
-
|
|
5970
|
-
|
|
5971
|
-
|
|
5972
|
-
|
|
5973
|
-
|
|
5974
|
-
|
|
6011
|
+
z as ControlPositionConverter,
|
|
6012
|
+
S as CoordType,
|
|
6013
|
+
di as CustomControl,
|
|
6014
|
+
ci as FastFindValues,
|
|
6015
|
+
fi as GoogleAutocomplete,
|
|
6016
|
+
_t as GoogleCircle,
|
|
6017
|
+
ht as GoogleControl,
|
|
6018
|
+
Ct as GoogleInfoBoxOverlay,
|
|
6019
|
+
Mt as GoogleInfoWindow,
|
|
5975
6020
|
ke as GoogleMapTypeControl,
|
|
5976
|
-
|
|
5977
|
-
|
|
5978
|
-
|
|
5979
|
-
|
|
5980
|
-
|
|
5981
|
-
|
|
5982
|
-
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
|
|
5986
|
-
|
|
5987
|
-
|
|
5988
|
-
|
|
5989
|
-
|
|
5990
|
-
|
|
6021
|
+
Be as GoogleMapUrls,
|
|
6022
|
+
Lt as GoogleMarker,
|
|
6023
|
+
Oi as GoogleMarkerClusterer,
|
|
6024
|
+
yt as GoogleOverlay,
|
|
6025
|
+
Ci as GooglePlacesService,
|
|
6026
|
+
It as GooglePolygon,
|
|
6027
|
+
kt as GooglePolyline,
|
|
6028
|
+
At as GoogleRectangle,
|
|
6029
|
+
ut as GoogleScaleControl,
|
|
6030
|
+
Ei as GoogleSearchBox,
|
|
6031
|
+
gt as GoogleZoomControl,
|
|
6032
|
+
ze as Icon,
|
|
6033
|
+
Zs as ImageMapType,
|
|
6034
|
+
bt as InfoWindow,
|
|
6035
|
+
Zt as KeyValue,
|
|
5991
6036
|
y as LatLng,
|
|
5992
|
-
|
|
5993
|
-
|
|
6037
|
+
R as LatLngBounds,
|
|
6038
|
+
Xs as LifecycleLogPlugin,
|
|
5994
6039
|
K as Location,
|
|
5995
6040
|
we as MIXIN_HOOK_CREATE,
|
|
5996
6041
|
Ee as MIXIN_HOOK_DESTROY,
|
|
5997
|
-
|
|
6042
|
+
Rt as MIXIN_MAP_NAME,
|
|
5998
6043
|
ce as MVCArrays,
|
|
5999
|
-
|
|
6000
|
-
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
|
|
6044
|
+
x as MapMixin,
|
|
6045
|
+
$ as MapType,
|
|
6046
|
+
hr as MapTypeControlType,
|
|
6047
|
+
gr as MapUrls,
|
|
6048
|
+
Pi as MapZoom,
|
|
6049
|
+
br as MarkerClusterer,
|
|
6005
6050
|
be as Objects,
|
|
6006
|
-
|
|
6007
|
-
|
|
6051
|
+
Cr as Overlay,
|
|
6052
|
+
Tr as PlacesService,
|
|
6008
6053
|
X as Point,
|
|
6009
|
-
|
|
6010
|
-
|
|
6054
|
+
Mr as SearchBox,
|
|
6055
|
+
Js as SphericalUtils,
|
|
6011
6056
|
Te as Strings,
|
|
6012
|
-
|
|
6013
|
-
|
|
6014
|
-
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
|
|
6057
|
+
De as SymbolIcon,
|
|
6058
|
+
Vs as SymbolPath,
|
|
6059
|
+
ls as TgCircle,
|
|
6060
|
+
es as TgCustomControl,
|
|
6061
|
+
us as TgElementOverlay,
|
|
6062
|
+
ys as TgInfoBox,
|
|
6063
|
+
bs as TgInfoWindow,
|
|
6064
|
+
Os as TgLabel,
|
|
6065
|
+
Le as TgMap,
|
|
6066
|
+
st as TgMapFactory,
|
|
6022
6067
|
G as TgMapType,
|
|
6023
|
-
|
|
6024
|
-
|
|
6068
|
+
ts as TgMapTypeControl,
|
|
6069
|
+
Xi as TgMapWidget,
|
|
6025
6070
|
Fe as TgMarker,
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
|
|
6071
|
+
Pr as TgMarkerClusterer,
|
|
6072
|
+
Cs as TgPolygon,
|
|
6073
|
+
ws as TgPolyline,
|
|
6074
|
+
Es as TgRectangle,
|
|
6075
|
+
rs as TgScaleControl,
|
|
6076
|
+
as as TgTrafficLayer,
|
|
6077
|
+
ss as TgZoomControl,
|
|
6078
|
+
ui as TrafficLayer,
|
|
6034
6079
|
$e as UnionIcon,
|
|
6035
6080
|
oe as assert,
|
|
6036
6081
|
Qe as assertNever,
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
|
|
6040
|
-
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
|
|
6082
|
+
xe as callHook,
|
|
6083
|
+
Fs as computedSaveOnThis,
|
|
6084
|
+
Er as createEmptyVNode,
|
|
6085
|
+
ji as createPropertyObject,
|
|
6086
|
+
Us as createPropertyObjectTyped,
|
|
6087
|
+
Ns as debug,
|
|
6088
|
+
Qs as default,
|
|
6044
6089
|
L as eventProp,
|
|
6045
|
-
|
|
6046
|
-
|
|
6047
|
-
|
|
6048
|
-
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6090
|
+
qs as extractVNodeFromSlotsByComponent,
|
|
6091
|
+
ot as findAncestorComponentByType,
|
|
6092
|
+
Ys as findByComponentType,
|
|
6093
|
+
ks as getDestination,
|
|
6094
|
+
ir as getTgMapConfig,
|
|
6095
|
+
tt as isComponentByType,
|
|
6096
|
+
Gs as isDef,
|
|
6097
|
+
Qt as isEntryValueDef,
|
|
6098
|
+
Rs as isInstanceOf,
|
|
6099
|
+
As as lateinit,
|
|
6053
6100
|
ve as noop,
|
|
6054
6101
|
m as optionalProp,
|
|
6055
|
-
|
|
6102
|
+
Si as path,
|
|
6056
6103
|
D as requiredProp,
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6104
|
+
$s as safeAs,
|
|
6105
|
+
Jt as safeAsComponent,
|
|
6106
|
+
ai as setTgMapConfig,
|
|
6107
|
+
Vi as splitAttrs,
|
|
6061
6108
|
Z as stringEnumProp,
|
|
6062
|
-
|
|
6109
|
+
Hi as stringUnionPropFromValues,
|
|
6063
6110
|
C as throwError,
|
|
6064
|
-
|
|
6065
|
-
|
|
6111
|
+
at as throwUnsupported,
|
|
6112
|
+
Ds as todo,
|
|
6066
6113
|
et as typed,
|
|
6067
|
-
|
|
6068
|
-
|
|
6114
|
+
zs as unwrapStringEnumValue,
|
|
6115
|
+
Ks as useEventLogMethods,
|
|
6069
6116
|
Y as useSplittedAttrs,
|
|
6070
|
-
|
|
6117
|
+
is as useTgMapInner
|
|
6071
6118
|
};
|
|
6072
6119
|
//# sourceMappingURL=tg-map.js.map
|