tg-map-vue3 3.6.1 → 3.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/dist/src/map/map/overlay/shape.d.ts +7 -0
- package/dist/src/utils/arrays.d.ts +2 -0
- package/dist/tg-map.js +1099 -1087
- 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 +1 -1
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
|
|
6
|
-
function
|
|
2
|
+
var kr = Object.defineProperty;
|
|
3
|
+
var Ir = (i, t, e) => t in i ? kr(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
4
|
+
var h = (i, t, e) => (Ir(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
5
|
+
import { createCommentVNode as Je, computed as Ft, defineComponent as w, markRaw as Br, watch as Ut, openBlock as V, createElementBlock as F, mergeProps as ue, createElementVNode as Sr, normalizeClass as Ze, renderSlot as W, normalizeStyle as Ar, getCurrentInstance as Rr, inject as $r, onMounted as Dr, onBeforeUnmount as zr, toRaw as We, withDirectives as Nr, vShow as Gr } from "vue";
|
|
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 Zr = 1;
|
|
12
|
+
function Wr() {
|
|
13
|
+
return Zr++;
|
|
14
14
|
}
|
|
15
15
|
function Se(i, t) {
|
|
16
|
-
return t.__id__ || (t.__id__ =
|
|
16
|
+
return t.__id__ || (t.__id__ = Wr()), `${i}::${t.__id__}`;
|
|
17
17
|
}
|
|
18
|
-
var
|
|
19
|
-
function
|
|
18
|
+
var Yt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
19
|
+
function st(i) {
|
|
20
20
|
return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
|
|
21
21
|
}
|
|
22
|
-
var
|
|
22
|
+
var qt = { exports: {} };
|
|
23
23
|
(function(i) {
|
|
24
24
|
(function(t, e) {
|
|
25
25
|
i.exports ? i.exports = e() : t.coordtransform = e();
|
|
26
|
-
})(
|
|
26
|
+
})(Yt, 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 Ut = { exports: {} };
|
|
|
38
38
|
new n(82.9684, 29.5297, 97.0352, 26.7186),
|
|
39
39
|
new n(97.0253, 29.5297, 124.367395, 20.414096),
|
|
40
40
|
new n(107.975793, 20.414096, 111.744104, 17.871542)
|
|
41
|
-
],
|
|
41
|
+
], d = [
|
|
42
42
|
new n(119.921265, 25.398623, 122.497559, 21.785006),
|
|
43
43
|
new n(101.8652, 22.284, 106.665, 20.0988),
|
|
44
44
|
new n(106.4525, 21.5422, 108.051, 20.4878),
|
|
@@ -50,18 +50,18 @@ var Ut = { 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 < d.length; O++)
|
|
54
|
+
if (d[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, x = Math.sqrt(v * v + O * O) - 2e-5 * Math.sin(O * t), E = Math.atan2(O, v) - 3e-6 * Math.cos(v * t),
|
|
62
|
-
return [
|
|
61
|
+
var v = g - 65e-4, O = f - 6e-3, x = Math.sqrt(v * v + O * O) - 2e-5 * Math.sin(O * t), E = Math.atan2(O, v) - 3e-6 * Math.cos(v * t), Q = x * Math.cos(E), ie = x * Math.sin(E);
|
|
62
|
+
return [Q, ie];
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function c(g, f) {
|
|
65
65
|
var v = Math.sqrt(g * g + f * f) + 2e-5 * Math.sin(f * t), O = Math.atan2(f, g) + 3e-6 * Math.cos(g * t), x = v * Math.cos(O) + 65e-4, E = v * Math.sin(O) + 6e-3;
|
|
66
66
|
return [x, E];
|
|
67
67
|
}
|
|
@@ -75,30 +75,30 @@ var Ut = { 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 =
|
|
78
|
+
var v = _(g - 105, f - 35), O = T(g - 105, f - 35), x = f / 180 * e, E = Math.sin(x);
|
|
79
79
|
E = 1 - s * E * E;
|
|
80
|
-
var
|
|
81
|
-
v = v * 180 / (r * (1 - s) / (E *
|
|
82
|
-
var
|
|
83
|
-
return [
|
|
80
|
+
var Q = Math.sqrt(E);
|
|
81
|
+
v = v * 180 / (r * (1 - s) / (E * Q) * e), O = O * 180 / (r / Q * Math.cos(x) * e);
|
|
82
|
+
var ie = f + v, Ue = g + O;
|
|
83
|
+
return [Ue, ie];
|
|
84
84
|
}
|
|
85
85
|
function _(g, f) {
|
|
86
86
|
var v = -100 + 2 * g + 3 * f + 0.2 * f * f + 0.1 * g * f + 0.2 * Math.sqrt(Math.abs(g));
|
|
87
87
|
return v += (20 * Math.sin(6 * g * e) + 20 * Math.sin(2 * g * e)) * 2 / 3, v += (20 * Math.sin(f * e) + 40 * Math.sin(f / 3 * e)) * 2 / 3, v += (160 * Math.sin(f / 12 * e) + 320 * Math.sin(f * e / 30)) * 2 / 3, v;
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function T(g, f) {
|
|
90
90
|
var v = 300 + g + 2 * f + 0.1 * g * g + 0.1 * g * f + 0.1 * Math.sqrt(Math.abs(g));
|
|
91
91
|
return v += (20 * Math.sin(6 * g * e) + 20 * Math.sin(2 * g * e)) * 2 / 3, v += (20 * Math.sin(g * e) + 40 * Math.sin(g / 3 * e)) * 2 / 3, v += (150 * Math.sin(g / 12 * e) + 300 * Math.sin(g / 30 * e)) * 2 / 3, v;
|
|
92
92
|
}
|
|
93
93
|
return {
|
|
94
94
|
// 向前兼容
|
|
95
95
|
bd09togcj02: l,
|
|
96
|
-
gcj02tobd09:
|
|
96
|
+
gcj02tobd09: c,
|
|
97
97
|
wgs84togcj02: u,
|
|
98
98
|
gcj02towgs84: p,
|
|
99
99
|
// 小驼峰命名风格
|
|
100
100
|
bd09ToGcj02: l,
|
|
101
|
-
gcj02ToBd09:
|
|
101
|
+
gcj02ToBd09: c,
|
|
102
102
|
wgs84ToGcj02: u,
|
|
103
103
|
gcj02ToWgs84: p,
|
|
104
104
|
bd09ToWgs84: function(g, f) {
|
|
@@ -111,83 +111,83 @@ var Ut = { exports: {} };
|
|
|
111
111
|
if (!o(g, f))
|
|
112
112
|
return [g, f];
|
|
113
113
|
var v = u(g, f);
|
|
114
|
-
return
|
|
114
|
+
return c(v[0], v[1]);
|
|
115
115
|
}
|
|
116
116
|
};
|
|
117
117
|
});
|
|
118
|
-
})(
|
|
119
|
-
var
|
|
120
|
-
const
|
|
121
|
-
function
|
|
118
|
+
})(qt);
|
|
119
|
+
var Hr = qt.exports;
|
|
120
|
+
const se = /* @__PURE__ */ st(Hr);
|
|
121
|
+
function oe(i, t) {
|
|
122
122
|
if (!i)
|
|
123
123
|
throw new Error(`AssertionError: ${t}`);
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function Qe(i) {
|
|
126
126
|
throw new Error(`Unexpected object: ${i}`);
|
|
127
127
|
}
|
|
128
128
|
function Bs() {
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function et(i) {
|
|
131
131
|
return i;
|
|
132
132
|
}
|
|
133
133
|
function Ss(i, t) {
|
|
134
134
|
return i instanceof t;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function As(i, t) {
|
|
137
137
|
if (i instanceof t)
|
|
138
138
|
return i;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function Le(i, t) {
|
|
141
141
|
if ((i == null ? void 0 : i.$options.name) === t.name)
|
|
142
142
|
return i;
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function Rs(i) {
|
|
145
145
|
return i;
|
|
146
146
|
}
|
|
147
147
|
function C(i) {
|
|
148
148
|
throw new Error(i);
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function nt(i) {
|
|
151
151
|
throw new Error(`Unsupported: ${i}`);
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function $s(i) {
|
|
154
154
|
throw new Error(`todo: ${i}`);
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function Ds(i) {
|
|
157
157
|
return i;
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function ve(...i) {
|
|
160
160
|
}
|
|
161
|
-
function
|
|
161
|
+
function zs(i) {
|
|
162
162
|
return i != null;
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function Kt(i) {
|
|
165
165
|
return i[1] != null;
|
|
166
166
|
}
|
|
167
167
|
var B = /* @__PURE__ */ ((i) => (i.wgs84 = "wgs84", i.gcj02 = "gcj02", i.bd09 = "bd09", i))(B || {});
|
|
168
|
-
const
|
|
168
|
+
const qe = "wgs84", N = class {
|
|
169
169
|
constructor(t, e, r) {
|
|
170
170
|
this.lat = t, this.lng = e, this.coord = r;
|
|
171
171
|
}
|
|
172
172
|
/** @param coord Baidu Map的坐标一般都是bd09 */
|
|
173
173
|
static fromBaidu(t, e) {
|
|
174
|
-
return new
|
|
174
|
+
return new N(t.lat, t.lng, e);
|
|
175
175
|
}
|
|
176
176
|
/** @param coord Google Map的坐标依据地图类型不同是不一样的 */
|
|
177
177
|
static fromGoogle(t, e) {
|
|
178
|
-
return new
|
|
178
|
+
return new N(t.lat(), t.lng(), e);
|
|
179
179
|
}
|
|
180
180
|
static fromHere(t, e) {
|
|
181
|
-
return new
|
|
181
|
+
return new N(t.lat, t.lng, e);
|
|
182
182
|
}
|
|
183
183
|
static fromLiteral(t) {
|
|
184
|
-
return new
|
|
184
|
+
return new N(t.lat, t.lng, t.coord || qe);
|
|
185
185
|
}
|
|
186
|
-
static fromLngLat(t, e, r =
|
|
187
|
-
return new
|
|
186
|
+
static fromLngLat(t, e, r = qe) {
|
|
187
|
+
return new N(e, t, r);
|
|
188
188
|
}
|
|
189
|
-
static create(t, e, r =
|
|
190
|
-
return new
|
|
189
|
+
static create(t, e, r = qe) {
|
|
190
|
+
return new N(t, e, r);
|
|
191
191
|
}
|
|
192
192
|
/** 转换坐标到指定坐标系 */
|
|
193
193
|
to(t) {
|
|
@@ -195,7 +195,7 @@ const Ue = "wgs84", z = class {
|
|
|
195
195
|
if (this.coord === e)
|
|
196
196
|
return this;
|
|
197
197
|
const [r, s] = this._convert(e);
|
|
198
|
-
return new
|
|
198
|
+
return new N(s, r, e);
|
|
199
199
|
}
|
|
200
200
|
toBaidu(t) {
|
|
201
201
|
let e = this.lat, r = this.lng;
|
|
@@ -221,11 +221,11 @@ const Ue = "wgs84", z = class {
|
|
|
221
221
|
_convert(t) {
|
|
222
222
|
switch (this.coord) {
|
|
223
223
|
case "bd09":
|
|
224
|
-
return t === "gcj02" ?
|
|
224
|
+
return t === "gcj02" ? se.bd09ToGcj02(this.lng, this.lat) : se.bd09ToWgs84(this.lng, this.lat);
|
|
225
225
|
case "gcj02":
|
|
226
|
-
return t === "wgs84" ?
|
|
226
|
+
return t === "wgs84" ? se.gcj02ToWgs84(this.lng, this.lat) : se.gcj02ToBd09(this.lng, this.lat);
|
|
227
227
|
case "wgs84":
|
|
228
|
-
return t === "bd09" ?
|
|
228
|
+
return t === "bd09" ? se.wgs84ToBd09(this.lng, this.lat) : se.wgs84ToGcj02(this.lng, this.lat);
|
|
229
229
|
}
|
|
230
230
|
throw new Error(`不支持的坐标转换: ${this.coord}=>${t}`);
|
|
231
231
|
}
|
|
@@ -236,17 +236,17 @@ const Ue = "wgs84", z = class {
|
|
|
236
236
|
return JSON.stringify(this);
|
|
237
237
|
}
|
|
238
238
|
};
|
|
239
|
-
let y =
|
|
240
|
-
|
|
241
|
-
const
|
|
239
|
+
let y = N;
|
|
240
|
+
h(y, "ZERO", N.create(0, 0));
|
|
241
|
+
const te = class {
|
|
242
242
|
/**
|
|
243
243
|
* 不推荐直接创建LatLngBounds, sw和ne的大小关系可能没法保证, 推荐用LatLngBounds.Builder或者LatLngBounds.from等静态方法来创建
|
|
244
244
|
* @param sw 西南, lat/lng更小
|
|
245
245
|
* @param ne 东北, lat/lng更大
|
|
246
246
|
*/
|
|
247
247
|
constructor(t, e) {
|
|
248
|
-
|
|
249
|
-
this.sw = t, this.ne = e,
|
|
248
|
+
h(this, "coord");
|
|
249
|
+
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
250
|
}
|
|
251
251
|
static isBetweenLng(t, e, r) {
|
|
252
252
|
return t <= e ? t <= r && r <= e : t <= r || r <= e;
|
|
@@ -254,7 +254,7 @@ const ee = class {
|
|
|
254
254
|
static fromArray(t) {
|
|
255
255
|
if (t.length === 0)
|
|
256
256
|
return;
|
|
257
|
-
const e = new
|
|
257
|
+
const e = new te.Builder(t[0]);
|
|
258
258
|
for (let r = 1; r < t.length; r++)
|
|
259
259
|
e.include(t[r]);
|
|
260
260
|
return e.build();
|
|
@@ -263,13 +263,13 @@ const ee = class {
|
|
|
263
263
|
return this.fromArray(t) ?? C("positions中没有点");
|
|
264
264
|
}
|
|
265
265
|
static fromGoogle(t, e) {
|
|
266
|
-
return new
|
|
266
|
+
return new te(
|
|
267
267
|
y.fromGoogle(t.getSouthWest(), e),
|
|
268
268
|
y.fromGoogle(t.getNorthEast(), e)
|
|
269
269
|
);
|
|
270
270
|
}
|
|
271
271
|
static fromBaidu(t, e) {
|
|
272
|
-
return new
|
|
272
|
+
return new te(
|
|
273
273
|
y.fromBaidu(t.getSouthWest(), e),
|
|
274
274
|
y.fromBaidu(t.getNorthEast(), e)
|
|
275
275
|
);
|
|
@@ -282,7 +282,7 @@ const ee = class {
|
|
|
282
282
|
}
|
|
283
283
|
contains(t) {
|
|
284
284
|
const { lat: e, lng: r } = t.to(this.coord);
|
|
285
|
-
return this.sw.lat <= e && e <= this.ne.lat &&
|
|
285
|
+
return this.sw.lat <= e && e <= this.ne.lat && te.isBetweenLng(this.sw.lng, this.ne.lng, r);
|
|
286
286
|
}
|
|
287
287
|
getCenter() {
|
|
288
288
|
if (this.sw.equals(this.ne))
|
|
@@ -319,16 +319,16 @@ const ee = class {
|
|
|
319
319
|
return [this.sw.toBaidu(t), this.ne.toBaidu(t)];
|
|
320
320
|
}
|
|
321
321
|
};
|
|
322
|
-
let
|
|
323
|
-
|
|
322
|
+
let A = te;
|
|
323
|
+
h(A, "EMPTY", new te(y.ZERO, y.ZERO));
|
|
324
324
|
((i) => {
|
|
325
325
|
class t {
|
|
326
326
|
constructor(r) {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
327
|
+
h(this, "coord");
|
|
328
|
+
h(this, "minLat");
|
|
329
|
+
h(this, "minLng");
|
|
330
|
+
h(this, "maxLat");
|
|
331
|
+
h(this, "maxLng");
|
|
332
332
|
this.coord = r.coord, this.minLat = this.maxLat = r.lat, this.minLng = this.maxLng = r.lng;
|
|
333
333
|
}
|
|
334
334
|
build() {
|
|
@@ -348,8 +348,8 @@ c(I, "EMPTY", new ee(y.ZERO, y.ZERO));
|
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
350
|
i.Builder = t;
|
|
351
|
-
})(
|
|
352
|
-
var
|
|
351
|
+
})(A || (A = {}));
|
|
352
|
+
var K;
|
|
353
353
|
((i) => {
|
|
354
354
|
function t(r, s) {
|
|
355
355
|
if (r == null)
|
|
@@ -364,78 +364,78 @@ var Y;
|
|
|
364
364
|
return typeof r == "string" || r == null ? void 0 : r.coord;
|
|
365
365
|
}
|
|
366
366
|
i.getCoordType = e;
|
|
367
|
-
})(
|
|
368
|
-
var
|
|
369
|
-
return
|
|
367
|
+
})(K || (K = {}));
|
|
368
|
+
var jr = function(t) {
|
|
369
|
+
return Vr(t) && !Fr(t);
|
|
370
370
|
};
|
|
371
|
-
function
|
|
371
|
+
function Vr(i) {
|
|
372
372
|
return !!i && typeof i == "object";
|
|
373
373
|
}
|
|
374
|
-
function
|
|
374
|
+
function Fr(i) {
|
|
375
375
|
var t = Object.prototype.toString.call(i);
|
|
376
376
|
return t === "[object RegExp]" || t === "[object Date]" || qr(i);
|
|
377
377
|
}
|
|
378
|
-
var
|
|
378
|
+
var Ur = typeof Symbol == "function" && Symbol.for, Yr = Ur ? Symbol.for("react.element") : 60103;
|
|
379
379
|
function qr(i) {
|
|
380
|
-
return i.$$typeof ===
|
|
380
|
+
return i.$$typeof === Yr;
|
|
381
381
|
}
|
|
382
|
-
function
|
|
382
|
+
function Kr(i) {
|
|
383
383
|
return Array.isArray(i) ? [] : {};
|
|
384
384
|
}
|
|
385
|
-
function
|
|
386
|
-
return t.clone !== !1 && t.isMergeableObject(i) ?
|
|
385
|
+
function _e(i, t) {
|
|
386
|
+
return t.clone !== !1 && t.isMergeableObject(i) ? le(Kr(i), i, t) : i;
|
|
387
387
|
}
|
|
388
|
-
function
|
|
388
|
+
function Xr(i, t, e) {
|
|
389
389
|
return i.concat(t).map(function(r) {
|
|
390
|
-
return
|
|
390
|
+
return _e(r, e);
|
|
391
391
|
});
|
|
392
392
|
}
|
|
393
|
-
function
|
|
393
|
+
function Jr(i, t) {
|
|
394
394
|
if (!t.customMerge)
|
|
395
|
-
return
|
|
395
|
+
return le;
|
|
396
396
|
var e = t.customMerge(i);
|
|
397
|
-
return typeof e == "function" ? e :
|
|
397
|
+
return typeof e == "function" ? e : le;
|
|
398
398
|
}
|
|
399
|
-
function
|
|
399
|
+
function Qr(i) {
|
|
400
400
|
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(i).filter(function(t) {
|
|
401
401
|
return Object.propertyIsEnumerable.call(i, t);
|
|
402
402
|
}) : [];
|
|
403
403
|
}
|
|
404
|
-
function
|
|
405
|
-
return Object.keys(i).concat(
|
|
404
|
+
function Dt(i) {
|
|
405
|
+
return Object.keys(i).concat(Qr(i));
|
|
406
406
|
}
|
|
407
|
-
function
|
|
407
|
+
function Xt(i, t) {
|
|
408
408
|
try {
|
|
409
409
|
return t in i;
|
|
410
410
|
} catch {
|
|
411
411
|
return !1;
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
|
-
function
|
|
415
|
-
return
|
|
414
|
+
function ei(i, t) {
|
|
415
|
+
return Xt(i, t) && !(Object.hasOwnProperty.call(i, t) && Object.propertyIsEnumerable.call(i, t));
|
|
416
416
|
}
|
|
417
|
-
function
|
|
417
|
+
function ti(i, t, e) {
|
|
418
418
|
var r = {};
|
|
419
|
-
return e.isMergeableObject(i) &&
|
|
420
|
-
r[s] =
|
|
421
|
-
}),
|
|
422
|
-
|
|
419
|
+
return e.isMergeableObject(i) && Dt(i).forEach(function(s) {
|
|
420
|
+
r[s] = _e(i[s], e);
|
|
421
|
+
}), Dt(t).forEach(function(s) {
|
|
422
|
+
ei(i, s) || (Xt(i, s) && e.isMergeableObject(t[s]) ? r[s] = Jr(s, e)(i[s], t[s], e) : r[s] = _e(t[s], e));
|
|
423
423
|
}), r;
|
|
424
424
|
}
|
|
425
|
-
function
|
|
426
|
-
e = e || {}, e.arrayMerge = e.arrayMerge ||
|
|
425
|
+
function le(i, t, e) {
|
|
426
|
+
e = e || {}, e.arrayMerge = e.arrayMerge || Xr, e.isMergeableObject = e.isMergeableObject || jr, e.cloneUnlessOtherwiseSpecified = _e;
|
|
427
427
|
var r = Array.isArray(t), s = Array.isArray(i), n = r === s;
|
|
428
|
-
return n ? r ? e.arrayMerge(i, t, e) :
|
|
428
|
+
return n ? r ? e.arrayMerge(i, t, e) : ti(i, t, e) : _e(t, e);
|
|
429
429
|
}
|
|
430
|
-
|
|
430
|
+
le.all = function(t, e) {
|
|
431
431
|
if (!Array.isArray(t))
|
|
432
432
|
throw new Error("first argument should be an array");
|
|
433
433
|
return t.reduce(function(r, s) {
|
|
434
|
-
return
|
|
434
|
+
return le(r, s, e);
|
|
435
435
|
}, {});
|
|
436
436
|
};
|
|
437
|
-
var
|
|
438
|
-
const
|
|
437
|
+
var ri = le, ii = ri;
|
|
438
|
+
const Jt = /* @__PURE__ */ st(ii), Ae = ["3.0"], si = {
|
|
439
439
|
baidu: {
|
|
440
440
|
version: "3.0",
|
|
441
441
|
// 在build时会被静态替换, 导致使用者不能无法设置它
|
|
@@ -450,65 +450,69 @@ const Kt = /* @__PURE__ */ rt(ri), Ie = ["3.0"], ii = {
|
|
|
450
450
|
libraries: ["places"]
|
|
451
451
|
},
|
|
452
452
|
here: {
|
|
453
|
-
version:
|
|
453
|
+
version: Ae[0],
|
|
454
454
|
key: ""
|
|
455
455
|
}
|
|
456
456
|
};
|
|
457
|
-
let
|
|
458
|
-
function
|
|
459
|
-
return
|
|
457
|
+
let Qt;
|
|
458
|
+
function er() {
|
|
459
|
+
return Qt || C("请先安装: Vue<PartialTgMapConfig>.use(TgMap, {})");
|
|
460
460
|
}
|
|
461
|
-
function
|
|
462
|
-
i != null && (
|
|
461
|
+
function ni(i) {
|
|
462
|
+
i != null && (Qt = Jt(si, i));
|
|
463
463
|
}
|
|
464
|
-
var
|
|
464
|
+
var tt;
|
|
465
465
|
((i) => {
|
|
466
466
|
function t(e) {
|
|
467
467
|
return e.scrollWidth > e.clientWidth || e.scrollHeight > e.clientHeight;
|
|
468
468
|
}
|
|
469
469
|
i.isScrollable = t;
|
|
470
|
-
})(
|
|
471
|
-
var
|
|
470
|
+
})(tt || (tt = {}));
|
|
471
|
+
var he;
|
|
472
472
|
((i) => {
|
|
473
|
-
function t(
|
|
474
|
-
return
|
|
473
|
+
function t(o, l) {
|
|
474
|
+
return o.length === l.length && o.every((c, u) => c === l[u]);
|
|
475
475
|
}
|
|
476
476
|
i.equals = t;
|
|
477
|
-
function e(
|
|
478
|
-
const
|
|
479
|
-
if (
|
|
480
|
-
return
|
|
477
|
+
function e(o, l) {
|
|
478
|
+
const c = o.indexOf(l);
|
|
479
|
+
if (c !== -1)
|
|
480
|
+
return o.splice(c, 1)[0];
|
|
481
481
|
}
|
|
482
482
|
i.remove = e;
|
|
483
|
-
function r(
|
|
484
|
-
for (const
|
|
485
|
-
if (
|
|
486
|
-
return
|
|
483
|
+
function r(o, l) {
|
|
484
|
+
for (const c of o)
|
|
485
|
+
if (c instanceof l)
|
|
486
|
+
return c;
|
|
487
487
|
}
|
|
488
488
|
i.findByType = r;
|
|
489
|
-
function s(
|
|
490
|
-
return
|
|
489
|
+
function s(o, l) {
|
|
490
|
+
return o.includes(l);
|
|
491
491
|
}
|
|
492
492
|
i.includesTyped = s;
|
|
493
|
-
function n(
|
|
494
|
-
const
|
|
495
|
-
if (
|
|
496
|
-
return
|
|
497
|
-
|
|
493
|
+
function n(o, l, c) {
|
|
494
|
+
const u = l >= 0 ? l : o.length + l;
|
|
495
|
+
if (c === void 0)
|
|
496
|
+
return o[u];
|
|
497
|
+
o[u] = c;
|
|
498
498
|
}
|
|
499
499
|
i.at = n;
|
|
500
|
-
function a(
|
|
501
|
-
return
|
|
500
|
+
function a(o) {
|
|
501
|
+
return o.length > 0;
|
|
502
502
|
}
|
|
503
503
|
i.isNotEmpty = a;
|
|
504
|
-
|
|
505
|
-
|
|
504
|
+
function d(o) {
|
|
505
|
+
return !(o != null && o.length);
|
|
506
|
+
}
|
|
507
|
+
i.isNullOrEmpty = d;
|
|
508
|
+
})(he || (he = {}));
|
|
509
|
+
var ce;
|
|
506
510
|
((i) => {
|
|
507
511
|
function t(s, n) {
|
|
508
512
|
const a = s.getLength();
|
|
509
|
-
for (let
|
|
510
|
-
if (s.getAt(
|
|
511
|
-
return
|
|
513
|
+
for (let d = 0; d < a; d++)
|
|
514
|
+
if (s.getAt(d) === n)
|
|
515
|
+
return d;
|
|
512
516
|
return -1;
|
|
513
517
|
}
|
|
514
518
|
i.indexOf = t;
|
|
@@ -526,32 +530,32 @@ var he;
|
|
|
526
530
|
];
|
|
527
531
|
}
|
|
528
532
|
i.listenChanged = r;
|
|
529
|
-
})(
|
|
530
|
-
function
|
|
533
|
+
})(ce || (ce = {}));
|
|
534
|
+
function tr(i, t, e) {
|
|
531
535
|
return i.addListener(t, e).remove;
|
|
532
536
|
}
|
|
533
|
-
function
|
|
537
|
+
function oi(i, t, e) {
|
|
534
538
|
return i.addEventListener(t, e), () => i.removeEventListener(t, e);
|
|
535
539
|
}
|
|
536
|
-
function
|
|
540
|
+
function ai(i, t, e, r) {
|
|
537
541
|
return i.addEventListener(t, e, r), () => i.removeEventListener(t, e, r);
|
|
538
542
|
}
|
|
539
|
-
function
|
|
543
|
+
function zt(i, t, e) {
|
|
540
544
|
return i.addEventListener(t, e), () => i.removeEventListener(t, e);
|
|
541
545
|
}
|
|
542
|
-
class
|
|
546
|
+
class rr {
|
|
543
547
|
constructor(t, e) {
|
|
544
|
-
|
|
545
|
-
|
|
548
|
+
h(this, "eventMap", /* @__PURE__ */ new Map());
|
|
549
|
+
h(this, "target", void 0);
|
|
546
550
|
this.inner = t, this.coordTypeSupplier = e, this.addEventListener = this.addEventListener.bind(this), this.removeEventListener = this.removeEventListener.bind(this);
|
|
547
551
|
}
|
|
548
552
|
setTarget(t) {
|
|
549
553
|
return this.target = t, this;
|
|
550
554
|
}
|
|
551
555
|
}
|
|
552
|
-
class
|
|
556
|
+
class He {
|
|
553
557
|
constructor(t, e) {
|
|
554
|
-
|
|
558
|
+
h(this, "eventHub", new ir());
|
|
555
559
|
this.delegate = t, this.options = e;
|
|
556
560
|
}
|
|
557
561
|
notify(t) {
|
|
@@ -564,28 +568,28 @@ class Ze {
|
|
|
564
568
|
return this.delegate.setTarget(t), this;
|
|
565
569
|
}
|
|
566
570
|
addEventListener(t, e) {
|
|
567
|
-
if (
|
|
571
|
+
if (he.includesTyped(this.options.types, t)) {
|
|
568
572
|
this.eventHub.hasListener(t) || this.options.onListen(t), this.eventHub.addEventListener(t, e);
|
|
569
573
|
return;
|
|
570
574
|
}
|
|
571
575
|
this.delegate.addEventListener(t, e);
|
|
572
576
|
}
|
|
573
577
|
removeEventListener(t, e) {
|
|
574
|
-
if (
|
|
578
|
+
if (he.includesTyped(this.options.types, t)) {
|
|
575
579
|
this.eventHub.removeEventListener(t, e), this.eventHub.hasListener(t) || this.options.onCancel(t);
|
|
576
580
|
return;
|
|
577
581
|
}
|
|
578
582
|
this.delegate.removeEventListener(t, e);
|
|
579
583
|
}
|
|
580
584
|
}
|
|
581
|
-
const
|
|
585
|
+
const At = class extends rr {
|
|
582
586
|
addEventListener(t, e) {
|
|
583
587
|
const r = Se(t, e);
|
|
584
588
|
if (this.eventMap.get(r)) {
|
|
585
589
|
console.warn("listener已经添加过了", r, e);
|
|
586
590
|
return;
|
|
587
591
|
}
|
|
588
|
-
const s = this.inner.addListener(
|
|
592
|
+
const s = this.inner.addListener(At.EVENT_TYPE_MAP[t] || t, (n) => {
|
|
589
593
|
const a = {
|
|
590
594
|
type: t,
|
|
591
595
|
target: this.target,
|
|
@@ -600,9 +604,9 @@ const St = class extends er {
|
|
|
600
604
|
s ? (s.remove(), this.eventMap.delete(r)) : console.warn("移除失败, 不存在该listener", r, e);
|
|
601
605
|
}
|
|
602
606
|
};
|
|
603
|
-
let
|
|
607
|
+
let re = At;
|
|
604
608
|
// 事件类型映射: tg => google
|
|
605
|
-
|
|
609
|
+
h(re, "EVENT_TYPE_MAP", {
|
|
606
610
|
"center-changed": "center_changed",
|
|
607
611
|
"zoom-changed": "zoom_changed",
|
|
608
612
|
"radius-changed": "radius_changed",
|
|
@@ -618,7 +622,7 @@ c(te, "EVENT_TYPE_MAP", {
|
|
|
618
622
|
"map-mouseup": "mouseup",
|
|
619
623
|
"map-dblclick": "dblclick"
|
|
620
624
|
});
|
|
621
|
-
const
|
|
625
|
+
const Ne = class extends rr {
|
|
622
626
|
addEventListener(t, e) {
|
|
623
627
|
const r = Se(t, e);
|
|
624
628
|
if (this.eventMap.get(r)) {
|
|
@@ -633,17 +637,17 @@ const ze = class extends er {
|
|
|
633
637
|
};
|
|
634
638
|
n.point && (a.position = y.fromBaidu(n.point, this.coordTypeSupplier.coordType)), e.call(this.target, a);
|
|
635
639
|
};
|
|
636
|
-
this.inner.addEventListener(
|
|
640
|
+
this.inner.addEventListener(Ne.EVENT_TYPE_MAP[t] || t, s), this.eventMap.set(r, s);
|
|
637
641
|
}
|
|
638
642
|
removeEventListener(t, e) {
|
|
639
643
|
const r = Se(t, e), s = this.eventMap.get(r);
|
|
640
|
-
s ? (this.inner.removeEventListener(
|
|
644
|
+
s ? (this.inner.removeEventListener(Ne.EVENT_TYPE_MAP[t] || t, s), this.eventMap.delete(r)) : console.warn("移除失败, 不存在该listener", r, e);
|
|
641
645
|
}
|
|
642
646
|
};
|
|
643
|
-
let
|
|
647
|
+
let ae = Ne;
|
|
644
648
|
// cSpell:words clickclose
|
|
645
649
|
// 事件类型映射, tg => baidu
|
|
646
|
-
|
|
650
|
+
h(ae, "EVENT_TYPE_MAP", {
|
|
647
651
|
drag: "dragging",
|
|
648
652
|
closeclick: "clickclose",
|
|
649
653
|
// baidu不支持contextmenu事件, 将其映射为rightclick
|
|
@@ -651,9 +655,9 @@ c(oe, "EVENT_TYPE_MAP", {
|
|
|
651
655
|
"zoom-changed": "zoomend",
|
|
652
656
|
"map-type-changed": "maptypechange"
|
|
653
657
|
});
|
|
654
|
-
class
|
|
658
|
+
class ir {
|
|
655
659
|
constructor() {
|
|
656
|
-
|
|
660
|
+
h(this, "typeMap", /* @__PURE__ */ new Map());
|
|
657
661
|
}
|
|
658
662
|
addEventListener(t, e) {
|
|
659
663
|
let r = this.typeMap.get(t);
|
|
@@ -661,7 +665,7 @@ class tr {
|
|
|
661
665
|
}
|
|
662
666
|
removeEventListener(t, e) {
|
|
663
667
|
const r = this.typeMap.get(t);
|
|
664
|
-
r &&
|
|
668
|
+
r && he.remove(r, e);
|
|
665
669
|
}
|
|
666
670
|
hasListener(t) {
|
|
667
671
|
const e = this.typeMap.get(t);
|
|
@@ -672,14 +676,14 @@ class tr {
|
|
|
672
676
|
e && e.forEach((r) => r.call(t.target, t));
|
|
673
677
|
}
|
|
674
678
|
}
|
|
675
|
-
class
|
|
679
|
+
class Nt {
|
|
676
680
|
/**
|
|
677
681
|
* `keys`和`values`数组中可以有相同的值, 若存在相同值, 则index越小的优先级越高
|
|
678
682
|
*/
|
|
679
683
|
constructor(t, e) {
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
684
|
+
h(this, "keyToValue", /* @__PURE__ */ new Map());
|
|
685
|
+
h(this, "valueToKey", /* @__PURE__ */ new Map());
|
|
686
|
+
oe(t.length === e.length);
|
|
683
687
|
for (let r = t.length - 1; r >= 0; r--)
|
|
684
688
|
this.keyToValue.set(t[r], e[r]), this.valueToKey.set(e[r], t[r]);
|
|
685
689
|
}
|
|
@@ -690,9 +694,9 @@ class Dt {
|
|
|
690
694
|
return this.keyToValue.get(t) ?? C();
|
|
691
695
|
}
|
|
692
696
|
}
|
|
693
|
-
class
|
|
697
|
+
class li {
|
|
694
698
|
constructor(t, e = 10) {
|
|
695
|
-
|
|
699
|
+
h(this, "map", /* @__PURE__ */ new Map());
|
|
696
700
|
this.values = t, this.maxSize4Debug = e;
|
|
697
701
|
}
|
|
698
702
|
/** 获取保存key-value映射的Map */
|
|
@@ -719,16 +723,16 @@ class ai {
|
|
|
719
723
|
return this.getOrNull(t, e) ?? C(`key(${e})不存在与valueMap(${this.getValueMap(t)})中`);
|
|
720
724
|
}
|
|
721
725
|
}
|
|
722
|
-
class
|
|
726
|
+
class fe {
|
|
723
727
|
constructor(t) {
|
|
724
|
-
|
|
728
|
+
h(this, "value");
|
|
725
729
|
this.creator = t;
|
|
726
730
|
}
|
|
727
731
|
get() {
|
|
728
732
|
return this.value === void 0 && (this.value = this.creator()), this.value;
|
|
729
733
|
}
|
|
730
734
|
}
|
|
731
|
-
var
|
|
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 || {}), $;
|
|
732
736
|
((i) => {
|
|
733
737
|
let t, e;
|
|
734
738
|
const r = [
|
|
@@ -747,7 +751,7 @@ var k = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
|
|
|
747
751
|
/* RIGHT_BOTTOM */
|
|
748
752
|
];
|
|
749
753
|
function s() {
|
|
750
|
-
return t || (t = new
|
|
754
|
+
return t || (t = new Nt(r, [
|
|
751
755
|
/* | @tg/map |名字相同| baidu | */
|
|
752
756
|
/* TOP_LEFT = */
|
|
753
757
|
BMAP_ANCHOR_TOP_LEFT,
|
|
@@ -777,7 +781,7 @@ var k = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
|
|
|
777
781
|
}
|
|
778
782
|
i.getBaidu = s;
|
|
779
783
|
function n() {
|
|
780
|
-
return e || (e = new
|
|
784
|
+
return e || (e = new Nt(r, [
|
|
781
785
|
google.maps.ControlPosition.TOP_LEFT,
|
|
782
786
|
google.maps.ControlPosition.TOP_CENTER,
|
|
783
787
|
google.maps.ControlPosition.TOP_RIGHT,
|
|
@@ -793,17 +797,17 @@ var k = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
|
|
|
793
797
|
])), e;
|
|
794
798
|
}
|
|
795
799
|
i.getGoogle = n;
|
|
796
|
-
})(
|
|
797
|
-
class
|
|
800
|
+
})($ || ($ = {}));
|
|
801
|
+
class hi {
|
|
798
802
|
constructor(t) {
|
|
799
803
|
/** 实际添加到地图中的control对象 */
|
|
800
|
-
|
|
804
|
+
h(this, "inner");
|
|
801
805
|
this.position = t;
|
|
802
806
|
}
|
|
803
807
|
}
|
|
804
|
-
class
|
|
808
|
+
class sr {
|
|
805
809
|
}
|
|
806
|
-
class
|
|
810
|
+
class ot extends sr {
|
|
807
811
|
constructor(t, e) {
|
|
808
812
|
super(), this.inner = t, this.position = e;
|
|
809
813
|
}
|
|
@@ -814,10 +818,10 @@ class st extends rr {
|
|
|
814
818
|
t ? this.inner.show() : this.inner.hide();
|
|
815
819
|
}
|
|
816
820
|
getPosition() {
|
|
817
|
-
return this.position ??
|
|
821
|
+
return this.position ?? $.getBaidu().toKey(this.inner.getAnchor());
|
|
818
822
|
}
|
|
819
823
|
setPosition(t) {
|
|
820
|
-
this.position = t, this.inner.setAnchor(
|
|
824
|
+
this.position = t, this.inner.setAnchor($.getBaidu().toValue(t));
|
|
821
825
|
}
|
|
822
826
|
addTo(t) {
|
|
823
827
|
t.innerMap.addControl(this.inner);
|
|
@@ -826,11 +830,11 @@ class st extends rr {
|
|
|
826
830
|
t.innerMap.removeControl(this.inner);
|
|
827
831
|
}
|
|
828
832
|
}
|
|
829
|
-
class
|
|
833
|
+
class at extends sr {
|
|
830
834
|
constructor(e, r) {
|
|
831
835
|
super();
|
|
832
|
-
|
|
833
|
-
|
|
836
|
+
h(this, "visible", !1);
|
|
837
|
+
h(this, "map");
|
|
834
838
|
this._type = e, this.position = r;
|
|
835
839
|
}
|
|
836
840
|
isVisible() {
|
|
@@ -853,7 +857,7 @@ class nt extends rr {
|
|
|
853
857
|
}
|
|
854
858
|
onCreateOptions() {
|
|
855
859
|
return {
|
|
856
|
-
position:
|
|
860
|
+
position: $.getGoogle().toValue(this.position)
|
|
857
861
|
};
|
|
858
862
|
}
|
|
859
863
|
tryUpdateOptions() {
|
|
@@ -863,7 +867,7 @@ class nt extends rr {
|
|
|
863
867
|
});
|
|
864
868
|
}
|
|
865
869
|
}
|
|
866
|
-
var
|
|
870
|
+
var nr = /* @__PURE__ */ ((i) => (i.normal = "normal", i.satellite = "satellite", i.hybrid = "hybrid", i))(nr || {});
|
|
867
871
|
class S {
|
|
868
872
|
constructor(t, e, r, s) {
|
|
869
873
|
this.id = t, this.baidu = e, this.google = r, this.googleCoordType = s;
|
|
@@ -885,19 +889,19 @@ class S {
|
|
|
885
889
|
return this.google();
|
|
886
890
|
}
|
|
887
891
|
asGoogleMapType() {
|
|
888
|
-
|
|
892
|
+
nt("google的内置地图没有对应的实例");
|
|
889
893
|
}
|
|
890
894
|
}
|
|
891
|
-
class
|
|
895
|
+
class Ns {
|
|
892
896
|
constructor(t, e) {
|
|
893
|
-
|
|
897
|
+
h(this, "baiduLayerCached", new fe(() => {
|
|
894
898
|
const t = new BMap.TileLayer({});
|
|
895
899
|
return t.getTilesUrl = (e, r) => {
|
|
896
900
|
const s = Math.pow(2, r - 1), n = e.x + s, a = s - 1 - e.y;
|
|
897
901
|
return this.options.getTileUrl({ x: n, y: a }, r);
|
|
898
902
|
}, t;
|
|
899
903
|
}));
|
|
900
|
-
|
|
904
|
+
h(this, "baiduMapTypeCached", new fe(() => {
|
|
901
905
|
const t = new BMap.MapType(this.options.name, this.baiduLayerCached.get(), {
|
|
902
906
|
maxZoom: this.options.maxZoom,
|
|
903
907
|
minZoom: this.options.minZoom,
|
|
@@ -905,7 +909,7 @@ class zs {
|
|
|
905
909
|
});
|
|
906
910
|
return t.__baidu_map_type__ = this, t;
|
|
907
911
|
}));
|
|
908
|
-
|
|
912
|
+
h(this, "googleCached", new fe(() => {
|
|
909
913
|
const t = new google.maps.ImageMapType({
|
|
910
914
|
getTileUrl: (e, r) => this.options.getTileUrl(e, r),
|
|
911
915
|
tileSize: new google.maps.Size(256, 256),
|
|
@@ -937,13 +941,13 @@ class zs {
|
|
|
937
941
|
return this.googleCached.get();
|
|
938
942
|
}
|
|
939
943
|
asGoogleLayer() {
|
|
940
|
-
|
|
944
|
+
nt("这个方法不会被调用");
|
|
941
945
|
}
|
|
942
946
|
}
|
|
943
|
-
class
|
|
947
|
+
class ci {
|
|
944
948
|
constructor() {
|
|
945
|
-
|
|
946
|
-
|
|
949
|
+
h(this, "baiduCache", new fe(() => new BMap.TrafficLayer()));
|
|
950
|
+
h(this, "googleCache", new fe(() => new google.maps.TrafficLayer()));
|
|
947
951
|
}
|
|
948
952
|
asBaiduLayer() {
|
|
949
953
|
return this.baiduCache.get();
|
|
@@ -952,7 +956,7 @@ class hi {
|
|
|
952
956
|
return this.googleCache.get();
|
|
953
957
|
}
|
|
954
958
|
}
|
|
955
|
-
var
|
|
959
|
+
var R;
|
|
956
960
|
((i) => {
|
|
957
961
|
i.NORMAL = new S("normal", () => BMAP_NORMAL_MAP, () => google.maps.MapTypeId.ROADMAP, B.gcj02), i.SATELLITE = new S("satellite", () => BMAP_SATELLITE_MAP, () => google.maps.MapTypeId.SATELLITE, B.wgs84), i.HYBRID = new S("hybrid", () => BMAP_HYBRID_MAP, () => google.maps.MapTypeId.HYBRID, B.gcj02), i.TERRAIN = new S("terrain", () => (
|
|
958
962
|
/* 三维 */
|
|
@@ -960,13 +964,13 @@ var A;
|
|
|
960
964
|
), () => (
|
|
961
965
|
/* 地形 */
|
|
962
966
|
google.maps.MapTypeId.TERRAIN
|
|
963
|
-
), B.wgs84), i.BUILD_IN_MAP_TYPES = new
|
|
964
|
-
})(
|
|
965
|
-
var
|
|
966
|
-
const
|
|
967
|
-
class
|
|
967
|
+
), B.wgs84), i.BUILD_IN_MAP_TYPES = new li([i.NORMAL, i.SATELLITE, i.HYBRID, i.TERRAIN]);
|
|
968
|
+
})(R || (R = {}));
|
|
969
|
+
var or = /* @__PURE__ */ ((i) => (i.DEFAULT = "default", i.HORIZONTAL = "horizontal", i.DROPDOWN = "dropdown", i))(or || {});
|
|
970
|
+
const ar = [R.NORMAL, R.SATELLITE, R.HYBRID];
|
|
971
|
+
class lt extends ot {
|
|
968
972
|
static create(t) {
|
|
969
|
-
const e = t.mapTypes ??
|
|
973
|
+
const e = t.mapTypes ?? ar, r = {
|
|
970
974
|
default: BMAP_MAPTYPE_CONTROL_HORIZONTAL,
|
|
971
975
|
horizontal: BMAP_MAPTYPE_CONTROL_HORIZONTAL,
|
|
972
976
|
dropdown: BMAP_MAPTYPE_CONTROL_DROPDOWN
|
|
@@ -974,23 +978,23 @@ class ot extends st {
|
|
|
974
978
|
type: t.type && r[t.type],
|
|
975
979
|
mapTypes: e.map((n) => n.asBaiduMapType())
|
|
976
980
|
});
|
|
977
|
-
return t.position && s.setAnchor(
|
|
981
|
+
return t.position && s.setAnchor($.getBaidu().toValue(t.position)), new lt(s, t.position);
|
|
978
982
|
}
|
|
979
983
|
}
|
|
980
|
-
const
|
|
981
|
-
constructor(t = "default", e =
|
|
982
|
-
super("mapType", e), this.type = t, this.mapTypes = r,
|
|
984
|
+
const ne = class extends at {
|
|
985
|
+
constructor(t = "default", e = I.TOP_LEFT, r = ar) {
|
|
986
|
+
super("mapType", e), this.type = t, this.mapTypes = r, ne.type2google || (ne.type2google = {
|
|
983
987
|
default: google.maps.MapTypeControlStyle.DEFAULT,
|
|
984
988
|
horizontal: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
|
|
985
989
|
dropdown: google.maps.MapTypeControlStyle.DROPDOWN_MENU
|
|
986
990
|
});
|
|
987
991
|
}
|
|
988
992
|
static create(t) {
|
|
989
|
-
return new
|
|
993
|
+
return new ne(t.type, t.position, t.mapTypes);
|
|
990
994
|
}
|
|
991
995
|
onCreateOptions() {
|
|
992
996
|
const t = super.onCreateOptions();
|
|
993
|
-
return t.style =
|
|
997
|
+
return t.style = ne.type2google[this.type], t.mapTypeIds = this.mapTypes.map((e) => e instanceof S ? e.getGoogleMapTypeId() : e.id), t;
|
|
994
998
|
}
|
|
995
999
|
addTo(t) {
|
|
996
1000
|
super.addTo(t), this.mapTypes.forEach((e) => {
|
|
@@ -998,64 +1002,64 @@ const se = class extends nt {
|
|
|
998
1002
|
});
|
|
999
1003
|
}
|
|
1000
1004
|
};
|
|
1001
|
-
let
|
|
1002
|
-
|
|
1003
|
-
class
|
|
1005
|
+
let ke = ne;
|
|
1006
|
+
h(ke, "type2google");
|
|
1007
|
+
class ht extends ot {
|
|
1004
1008
|
static create(t) {
|
|
1005
1009
|
const e = new BMap.ScaleControl({
|
|
1006
|
-
anchor: t.position &&
|
|
1010
|
+
anchor: t.position && $.getBaidu().toValue(t.position)
|
|
1007
1011
|
});
|
|
1008
|
-
return new
|
|
1012
|
+
return new ht(e, t.position);
|
|
1009
1013
|
}
|
|
1010
1014
|
}
|
|
1011
|
-
class
|
|
1015
|
+
class ct extends at {
|
|
1012
1016
|
static create(t) {
|
|
1013
|
-
return new
|
|
1017
|
+
return new ct(t.position);
|
|
1014
1018
|
}
|
|
1015
|
-
constructor(t =
|
|
1019
|
+
constructor(t = I.BOTTOM_RIGHT) {
|
|
1016
1020
|
super("scale", t);
|
|
1017
1021
|
}
|
|
1018
1022
|
}
|
|
1019
|
-
class
|
|
1023
|
+
class dt extends ot {
|
|
1020
1024
|
static create(t) {
|
|
1021
1025
|
const e = new BMap.NavigationControl({
|
|
1022
1026
|
type: BMAP_NAVIGATION_CONTROL_ZOOM,
|
|
1023
1027
|
// enableGeolocation: true,
|
|
1024
|
-
anchor: t.position &&
|
|
1028
|
+
anchor: t.position && $.getBaidu().toValue(t.position)
|
|
1025
1029
|
});
|
|
1026
|
-
return new
|
|
1030
|
+
return new dt(e, t.position);
|
|
1027
1031
|
}
|
|
1028
1032
|
}
|
|
1029
|
-
class
|
|
1033
|
+
class ut extends at {
|
|
1030
1034
|
static create(t) {
|
|
1031
|
-
return new
|
|
1035
|
+
return new ut(t.position);
|
|
1032
1036
|
}
|
|
1033
|
-
constructor(t =
|
|
1037
|
+
constructor(t = I.RIGHT_BOTTOM) {
|
|
1034
1038
|
super("zoom", t);
|
|
1035
1039
|
}
|
|
1036
1040
|
}
|
|
1037
|
-
function
|
|
1041
|
+
function di(i) {
|
|
1038
1042
|
let t, e, r;
|
|
1039
|
-
const s = "The Google Maps JavaScript API", n = "google", a = "importLibrary",
|
|
1043
|
+
const s = "The Google Maps JavaScript API", n = "google", a = "importLibrary", d = "__ib__", o = document, l = window, c = l[n] || (l[n] = {}), u = c.maps || (c.maps = {}), p = /* @__PURE__ */ new Set(), b = new URLSearchParams(), _ = () => t || (t = new Promise(async (T, g) => {
|
|
1040
1044
|
var f;
|
|
1041
1045
|
await (e = o.createElement("script")), b.set("libraries", [...p] + "");
|
|
1042
1046
|
for (r in i)
|
|
1043
1047
|
b.set(r.replace(/[A-Z]/g, (v) => "_" + v[0].toLowerCase()), i[r]);
|
|
1044
|
-
b.set("callback", n + ".maps." +
|
|
1048
|
+
b.set("callback", n + ".maps." + d), e.src = `https://maps.${n}apis.com/maps/api/js?` + b, u[d] = 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);
|
|
1045
1049
|
}));
|
|
1046
|
-
u[a] ? console.warn(s + " only loads once. Ignoring:", i) : u[a] = (
|
|
1050
|
+
u[a] ? console.warn(s + " only loads once. Ignoring:", i) : u[a] = (T, ...g) => p.add(T) && _().then(() => u[a](T, ...g));
|
|
1047
1051
|
}
|
|
1048
|
-
let
|
|
1049
|
-
const
|
|
1052
|
+
let ui, pi;
|
|
1053
|
+
const J = {
|
|
1050
1054
|
/** Google的坐标0点 */
|
|
1051
1055
|
get LATLNG_ZERO() {
|
|
1052
|
-
return
|
|
1056
|
+
return ui ?? (ui = new google.maps.LatLng({ lat: 0, lng: 0 }));
|
|
1053
1057
|
},
|
|
1054
1058
|
get BOUNDS_ZERO() {
|
|
1055
|
-
return
|
|
1059
|
+
return pi ?? (pi = new google.maps.LatLngBounds(this.LATLNG_ZERO, this.LATLNG_ZERO));
|
|
1056
1060
|
}
|
|
1057
1061
|
};
|
|
1058
|
-
function
|
|
1062
|
+
function lr(i, t = { country: "", province: "", city: "", district: "", street: "", streetNumber: "" }) {
|
|
1059
1063
|
for (const e of i)
|
|
1060
1064
|
for (const r of e.types)
|
|
1061
1065
|
switch (r) {
|
|
@@ -1080,25 +1084,25 @@ function or(i, t = { country: "", province: "", city: "", district: "", street:
|
|
|
1080
1084
|
}
|
|
1081
1085
|
return t;
|
|
1082
1086
|
}
|
|
1083
|
-
function
|
|
1087
|
+
function hr(i, t) {
|
|
1084
1088
|
var r;
|
|
1085
|
-
const e = i.address_components &&
|
|
1089
|
+
const e = i.address_components && lr(i.address_components);
|
|
1086
1090
|
return {
|
|
1087
1091
|
country: (e == null ? void 0 : e.country) ?? "",
|
|
1088
1092
|
province: (e == null ? void 0 : e.province) ?? "",
|
|
1089
1093
|
city: (e == null ? void 0 : e.city) ?? "",
|
|
1090
1094
|
id: i.place_id ?? "",
|
|
1091
1095
|
address: i.formatted_address ?? "",
|
|
1092
|
-
position: y.fromGoogle(((r = i.geometry) == null ? void 0 : r.location) ??
|
|
1096
|
+
position: y.fromGoogle(((r = i.geometry) == null ? void 0 : r.location) ?? J.LATLNG_ZERO, t.coordType),
|
|
1093
1097
|
title: i.name ?? ""
|
|
1094
1098
|
};
|
|
1095
1099
|
}
|
|
1096
|
-
class
|
|
1100
|
+
class cr {
|
|
1097
1101
|
}
|
|
1098
|
-
class
|
|
1102
|
+
class gi extends cr {
|
|
1099
1103
|
constructor(e, r) {
|
|
1100
1104
|
super();
|
|
1101
|
-
|
|
1105
|
+
h(this, "inner");
|
|
1102
1106
|
this.map = e, this.inner = new google.maps.places.Autocomplete(r.input, {
|
|
1103
1107
|
fields: [
|
|
1104
1108
|
"address_components",
|
|
@@ -1111,7 +1115,7 @@ class pi extends lr {
|
|
|
1111
1115
|
this.inner.setBounds(e.toGoogle(this.map.coordType));
|
|
1112
1116
|
}
|
|
1113
1117
|
addResultListener(e) {
|
|
1114
|
-
return
|
|
1118
|
+
return tr(this.inner, "place_changed", () => {
|
|
1115
1119
|
const r = this.inner.getPlace(), s = {
|
|
1116
1120
|
title: r.name ?? "",
|
|
1117
1121
|
province: "",
|
|
@@ -1121,17 +1125,17 @@ class pi extends lr {
|
|
|
1121
1125
|
streetNumber: "",
|
|
1122
1126
|
country: ""
|
|
1123
1127
|
};
|
|
1124
|
-
r.address_components &&
|
|
1128
|
+
r.address_components && lr(r.address_components, s), e(s);
|
|
1125
1129
|
});
|
|
1126
1130
|
}
|
|
1127
1131
|
}
|
|
1128
|
-
class
|
|
1132
|
+
class mi extends cr {
|
|
1129
1133
|
constructor(e, r) {
|
|
1130
1134
|
super();
|
|
1131
|
-
|
|
1132
|
-
|
|
1135
|
+
h(this, "inner");
|
|
1136
|
+
h(this, "input");
|
|
1133
1137
|
// TODO: 要不要添加个移除监听的方法?
|
|
1134
|
-
|
|
1138
|
+
h(this, "removeableArray", []);
|
|
1135
1139
|
if (this.map = e, this.input = r.input, this.inner = new BMap.Autocomplete({
|
|
1136
1140
|
input: r.input,
|
|
1137
1141
|
location: r.bindToMap ? e.innerMap : void 0
|
|
@@ -1139,7 +1143,7 @@ class gi extends lr {
|
|
|
1139
1143
|
const s = () => {
|
|
1140
1144
|
this.inner.setLocation(this.map.innerMap);
|
|
1141
1145
|
};
|
|
1142
|
-
this.removeableArray.push(
|
|
1146
|
+
this.removeableArray.push(zt(this.map, "center-changed", s)), this.removeableArray.push(zt(this.map, "zoom-changed", s));
|
|
1143
1147
|
}
|
|
1144
1148
|
}
|
|
1145
1149
|
setBounds(e) {
|
|
@@ -1147,14 +1151,14 @@ class gi extends lr {
|
|
|
1147
1151
|
}
|
|
1148
1152
|
addResultListener(e) {
|
|
1149
1153
|
let r = 0;
|
|
1150
|
-
const s =
|
|
1151
|
-
const
|
|
1154
|
+
const s = oi(this.inner, "confirm", (a) => {
|
|
1155
|
+
const d = a.item.value;
|
|
1152
1156
|
r = Date.now(), e(Object.assign({
|
|
1153
|
-
title:
|
|
1157
|
+
title: d.business,
|
|
1154
1158
|
country: ""
|
|
1155
1159
|
// Baidu的自动完成只支持中国
|
|
1156
|
-
},
|
|
1157
|
-
}), n =
|
|
1160
|
+
}, d));
|
|
1161
|
+
}), n = ai(this.input, "keyup", (a) => {
|
|
1158
1162
|
a.key === "Enter" && Date.now() - r > 100 && e({
|
|
1159
1163
|
title: this.input.value,
|
|
1160
1164
|
country: "",
|
|
@@ -1170,31 +1174,31 @@ class gi extends lr {
|
|
|
1170
1174
|
};
|
|
1171
1175
|
}
|
|
1172
1176
|
}
|
|
1173
|
-
class
|
|
1177
|
+
class dr {
|
|
1174
1178
|
constructor(t) {
|
|
1175
1179
|
this.options = t;
|
|
1176
1180
|
}
|
|
1177
1181
|
}
|
|
1178
|
-
const
|
|
1182
|
+
const Rt = class extends dr {
|
|
1179
1183
|
/** @see https://developers.google.com/maps/documentation/urls/get-started#directions-action */
|
|
1180
1184
|
directions(t, e, r) {
|
|
1181
|
-
const s = new URL("dir/",
|
|
1185
|
+
const s = new URL("dir/", Rt.BASE_URL), n = new URLSearchParams(Object.entries({
|
|
1182
1186
|
api: "1",
|
|
1183
|
-
origin:
|
|
1184
|
-
destination:
|
|
1187
|
+
origin: K.toString(t, B.wgs84),
|
|
1188
|
+
destination: K.toString(e, B.wgs84),
|
|
1185
1189
|
travelmode: r
|
|
1186
|
-
}).filter(
|
|
1190
|
+
}).filter(Kt));
|
|
1187
1191
|
return s.search = "?" + n.toString(), s;
|
|
1188
1192
|
}
|
|
1189
1193
|
};
|
|
1190
|
-
let
|
|
1191
|
-
|
|
1192
|
-
const
|
|
1194
|
+
let Ie = Rt;
|
|
1195
|
+
h(Ie, "BASE_URL", "https://www.google.com/maps/");
|
|
1196
|
+
const $t = class extends dr {
|
|
1193
1197
|
/** @see https://lbsyun.baidu.com/faq/api?title=webapi/uri/web#:~:text=%E6%9C%8D%E5%8A%A1%E5%9C%B0%E5%9D%80-,http%3A//api.map.baidu.com/direction,-//PC%26Webapp%E6%9C%8D%E5%8A%A1 */
|
|
1194
1198
|
directions(t, e, r = "driving") {
|
|
1195
|
-
const s = new URL("direction",
|
|
1199
|
+
const s = new URL("direction", $t.BASE_URL), n = K.getCoordType(e) ?? K.getCoordType(t) ?? B.bd09, a = K.toString(e, n), d = new URLSearchParams(Object.entries({
|
|
1196
1200
|
// baidu地图, 一定要有起点, 故这里用终点当起点, 防止导航失败
|
|
1197
|
-
origin:
|
|
1201
|
+
origin: K.toString(t, n) ?? (typeof e != "string" ? `name:请选择起点|latlng:${a}` : a),
|
|
1198
1202
|
destination: a,
|
|
1199
1203
|
// 默认就是bd09
|
|
1200
1204
|
coord_type: n === B.bd09 ? void 0 : n,
|
|
@@ -1202,24 +1206,24 @@ const At = class extends hr {
|
|
|
1202
1206
|
output: "html",
|
|
1203
1207
|
region: "中国",
|
|
1204
1208
|
src: window.location.hostname
|
|
1205
|
-
}).filter(
|
|
1206
|
-
return s.search = "?" +
|
|
1209
|
+
}).filter(Kt));
|
|
1210
|
+
return s.search = "?" + d.toString(), s;
|
|
1207
1211
|
}
|
|
1208
1212
|
};
|
|
1209
|
-
let Be =
|
|
1210
|
-
|
|
1211
|
-
let
|
|
1213
|
+
let Be = $t;
|
|
1214
|
+
h(Be, "BASE_URL", "https://api.map.baidu.com/");
|
|
1215
|
+
let fi = class ur {
|
|
1212
1216
|
constructor(t, e, r) {
|
|
1213
|
-
this.extend(
|
|
1217
|
+
this.extend(ur, 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;
|
|
1214
1218
|
var s = r || {};
|
|
1215
1219
|
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();
|
|
1216
1220
|
var n = this;
|
|
1217
1221
|
google.maps.event.addListener(this.map_, "zoom_changed", function() {
|
|
1218
|
-
var a = n.map_.getZoom(),
|
|
1222
|
+
var a = n.map_.getZoom(), d = n.map_.minZoom || 0, o = Math.min(
|
|
1219
1223
|
n.map_.maxZoom || 100,
|
|
1220
1224
|
n.map_.mapTypes[n.map_.getMapTypeId()].maxZoom
|
|
1221
1225
|
);
|
|
1222
|
-
a = Math.min(Math.max(a,
|
|
1226
|
+
a = Math.min(Math.max(a, d), o), n.prevZoom_ != a && (n.prevZoom_ = a, n.resetViewport());
|
|
1223
1227
|
}), google.maps.event.addListener(this.map_, "idle", function() {
|
|
1224
1228
|
n.redraw();
|
|
1225
1229
|
}), e && (e.length || Object.keys(e).length) && this.addMarkers(e, !1);
|
|
@@ -1462,8 +1466,8 @@ let mi = class cr {
|
|
|
1462
1466
|
*/
|
|
1463
1467
|
removeMarkers(t, e) {
|
|
1464
1468
|
for (var r = t === this.getMarkers() ? t.slice() : t, s = !1, n = 0, a; a = r[n]; n++) {
|
|
1465
|
-
var
|
|
1466
|
-
s = s ||
|
|
1469
|
+
var d = this.removeMarker_(a);
|
|
1470
|
+
s = s || d;
|
|
1467
1471
|
}
|
|
1468
1472
|
if (!e && s)
|
|
1469
1473
|
return this.resetViewport(), this.redraw(), !0;
|
|
@@ -1550,8 +1554,8 @@ let mi = class cr {
|
|
|
1550
1554
|
n.x += this.gridSize_, n.y -= this.gridSize_;
|
|
1551
1555
|
var a = e.fromLatLngToDivPixel(s);
|
|
1552
1556
|
a.x -= this.gridSize_, a.y += this.gridSize_;
|
|
1553
|
-
var
|
|
1554
|
-
return t.extend(
|
|
1557
|
+
var d = e.fromDivPixelToLatLng(n), o = e.fromDivPixelToLatLng(a);
|
|
1558
|
+
return t.extend(d), t.extend(o), t;
|
|
1555
1559
|
}
|
|
1556
1560
|
/**
|
|
1557
1561
|
* Determins if a marker is contained in a bounds.
|
|
@@ -1609,7 +1613,7 @@ let mi = class cr {
|
|
|
1609
1613
|
distanceBetweenPoints_(t, e) {
|
|
1610
1614
|
if (!t || !e)
|
|
1611
1615
|
return 0;
|
|
1612
|
-
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),
|
|
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), d = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)), o = r * d;
|
|
1613
1617
|
return o;
|
|
1614
1618
|
}
|
|
1615
1619
|
/**
|
|
@@ -1622,14 +1626,14 @@ let mi = class cr {
|
|
|
1622
1626
|
for (var e = 4e4, r = null, s = 0, n; n = this.clusters_[s]; s++) {
|
|
1623
1627
|
var a = n.getCenter();
|
|
1624
1628
|
if (a) {
|
|
1625
|
-
var
|
|
1626
|
-
|
|
1629
|
+
var d = this.distanceBetweenPoints_(a, t.getPosition());
|
|
1630
|
+
d < e && (e = d, r = n);
|
|
1627
1631
|
}
|
|
1628
1632
|
}
|
|
1629
1633
|
if (r && r.isMarkerInClusterBounds(t))
|
|
1630
1634
|
r.addMarker(t);
|
|
1631
1635
|
else {
|
|
1632
|
-
var o = new
|
|
1636
|
+
var o = new yi(this);
|
|
1633
1637
|
o.addMarker(t), this.clusters_.push(o);
|
|
1634
1638
|
}
|
|
1635
1639
|
}
|
|
@@ -1646,9 +1650,9 @@ let mi = class cr {
|
|
|
1646
1650
|
), e = this.getExtendedBounds(t), r = 0, s; s = this.markers_[r]; r++)
|
|
1647
1651
|
!s.isAdded && this.isMarkerInBounds_(s, e) && this.addToClosestCluster_(s);
|
|
1648
1652
|
}
|
|
1649
|
-
},
|
|
1653
|
+
}, yi = class {
|
|
1650
1654
|
constructor(t) {
|
|
1651
|
-
this.markerClusterer_ = t, this.map_ = t.getMap(), this.gridSize_ = t.getGridSize(), this.minClusterSize_ = t.getMinClusterSize(), this.averageCenter_ = t.isAverageCenter(), this.center_ = null, this.markers_ = [], this.bounds_ = null, this.clusterIcon_ = new
|
|
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 pt(
|
|
1652
1656
|
this,
|
|
1653
1657
|
t.getStyles(),
|
|
1654
1658
|
t.getGridSize()
|
|
@@ -1782,9 +1786,9 @@ let mi = class cr {
|
|
|
1782
1786
|
this.clusterIcon_.setCenter(this.center_), this.clusterIcon_.setSums(a), this.clusterIcon_.show();
|
|
1783
1787
|
}
|
|
1784
1788
|
};
|
|
1785
|
-
class
|
|
1789
|
+
class pt {
|
|
1786
1790
|
constructor(t, e, r) {
|
|
1787
|
-
t.getMarkerClusterer().extend(
|
|
1791
|
+
t.getMarkerClusterer().extend(pt, 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_);
|
|
1788
1792
|
}
|
|
1789
1793
|
/**
|
|
1790
1794
|
* Triggers the clusterclick event and zoom's if the option is set.
|
|
@@ -1915,11 +1919,11 @@ class dt {
|
|
|
1915
1919
|
), e.join("");
|
|
1916
1920
|
}
|
|
1917
1921
|
}
|
|
1918
|
-
var
|
|
1922
|
+
var pr = { exports: {} };
|
|
1919
1923
|
(function(i, t) {
|
|
1920
1924
|
(function(e, r) {
|
|
1921
1925
|
i.exports = r();
|
|
1922
|
-
})(
|
|
1926
|
+
})(Yt, function() {
|
|
1923
1927
|
var e, r = e = r || { version: "1.3.8" }, s = {};
|
|
1924
1928
|
r.guid = "$BAIDU$", s[r.guid] = s[r.guid] || {}, r.dom = r.dom || {}, r.dom.g = function(o) {
|
|
1925
1929
|
return typeof o == "string" || o instanceof String ? document.getElementById(o) : o && o.nodeName && (o.nodeType == 1 || o.nodeType == 9) ? o : null;
|
|
@@ -1931,55 +1935,55 @@ var dr = { exports: {} };
|
|
|
1931
1935
|
return r.lang.isString(o) ? document.getElementById(o) : o;
|
|
1932
1936
|
}, 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) {
|
|
1933
1937
|
o = r.dom._g(o);
|
|
1934
|
-
var
|
|
1935
|
-
return
|
|
1936
|
-
}, r.dom._styleFixer = r.dom._styleFixer || {}, r.dom._styleFilter = r.dom._styleFilter || [], r.dom._styleFilter.filter = function(o, l,
|
|
1938
|
+
var c = r.dom.getDocument(o), u;
|
|
1939
|
+
return c.defaultView && c.defaultView.getComputedStyle && (u = c.defaultView.getComputedStyle(o, null), u) ? u[l] || u.getPropertyValue(l) : "";
|
|
1940
|
+
}, r.dom._styleFixer = r.dom._styleFixer || {}, r.dom._styleFilter = r.dom._styleFilter || [], r.dom._styleFilter.filter = function(o, l, c) {
|
|
1937
1941
|
for (var u = 0, p = r.dom._styleFilter, b; b = p[u]; u++)
|
|
1938
|
-
(b = b[
|
|
1942
|
+
(b = b[c]) && (l = b(o, l));
|
|
1939
1943
|
return l;
|
|
1940
1944
|
}, r.string = r.string || {}, r.string.toCamelCase = function(o) {
|
|
1941
1945
|
return o.indexOf("-") < 0 && o.indexOf("_") < 0 ? o : o.replace(/[-_][^-_]/g, function(l) {
|
|
1942
1946
|
return l.charAt(1).toUpperCase();
|
|
1943
1947
|
});
|
|
1944
1948
|
}, r.dom.getStyle = function(o, l) {
|
|
1945
|
-
var
|
|
1946
|
-
o =
|
|
1947
|
-
var u = o.style[l] || (o.currentStyle ? o.currentStyle[l] : "") ||
|
|
1949
|
+
var c = r.dom;
|
|
1950
|
+
o = c.g(o), l = r.string.toCamelCase(l);
|
|
1951
|
+
var u = o.style[l] || (o.currentStyle ? o.currentStyle[l] : "") || c.getComputedStyle(o, l);
|
|
1948
1952
|
if (!u) {
|
|
1949
|
-
var p =
|
|
1953
|
+
var p = c._styleFixer[l];
|
|
1950
1954
|
p && (u = p.get ? p.get(o) : r.dom.getStyle(o, p));
|
|
1951
1955
|
}
|
|
1952
|
-
return (p =
|
|
1956
|
+
return (p = c._styleFilter) && (u = p.filter(l, u, "get")), u;
|
|
1953
1957
|
}, 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) {
|
|
1954
1958
|
o = r.dom.g(o);
|
|
1955
|
-
var l = r.dom.getDocument(o),
|
|
1956
|
-
|
|
1957
|
-
var p = { left: 0, top: 0 }, b =
|
|
1959
|
+
var l = r.dom.getDocument(o), c = r.browser, u = r.dom.getStyle;
|
|
1960
|
+
c.isGecko > 0 && l.getBoxObjectFor && u(o, "position") == "absolute" && (o.style.top === "" || o.style.left);
|
|
1961
|
+
var p = { left: 0, top: 0 }, b = c.ie && !c.isStrict ? l.body : l.documentElement, _, T;
|
|
1958
1962
|
if (o == b)
|
|
1959
1963
|
return p;
|
|
1960
1964
|
if (o.getBoundingClientRect) {
|
|
1961
|
-
|
|
1965
|
+
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;
|
|
1962
1966
|
var g = l.body, f = parseInt(u(g, "borderLeftWidth")), v = parseInt(u(g, "borderTopWidth"));
|
|
1963
|
-
|
|
1967
|
+
c.ie && !c.isStrict && (p.left -= isNaN(f) ? 2 : f, p.top -= isNaN(v) ? 2 : v);
|
|
1964
1968
|
} else {
|
|
1965
1969
|
_ = o;
|
|
1966
1970
|
do {
|
|
1967
|
-
if (p.left += _.offsetLeft, p.top += _.offsetTop,
|
|
1971
|
+
if (p.left += _.offsetLeft, p.top += _.offsetTop, c.isWebkit > 0 && u(_, "position") == "fixed") {
|
|
1968
1972
|
p.left += l.body.scrollLeft, p.top += l.body.scrollTop;
|
|
1969
1973
|
break;
|
|
1970
1974
|
}
|
|
1971
1975
|
_ = _.offsetParent;
|
|
1972
1976
|
} while (_ && _ != o);
|
|
1973
|
-
for ((
|
|
1974
|
-
p.left -= _.scrollLeft, (!
|
|
1977
|
+
for ((c.opera > 0 || c.isWebkit > 0 && u(o, "position") == "absolute") && (p.top -= l.body.offsetTop), _ = o.offsetParent; _ && _ != l.body; )
|
|
1978
|
+
p.left -= _.scrollLeft, (!c.opera || _.tagName != "TR") && (p.top -= _.scrollTop), _ = _.offsetParent;
|
|
1975
1979
|
}
|
|
1976
1980
|
return p;
|
|
1977
|
-
}, r.event = r.event || {}, r.event._listeners = r.event._listeners || [], r.event.on = function(o, l,
|
|
1981
|
+
}, r.event = r.event || {}, r.event._listeners = r.event._listeners || [], r.event.on = function(o, l, c) {
|
|
1978
1982
|
l = l.replace(/^on/i, ""), o = r.dom._g(o);
|
|
1979
1983
|
var u = function(g) {
|
|
1980
|
-
|
|
1981
|
-
}, p = r.event._listeners, b = r.event._eventFilter, _,
|
|
1982
|
-
return l = l.toLowerCase(), b && b[l] && (_ = b[l](o, l, u),
|
|
1984
|
+
c.call(o, g);
|
|
1985
|
+
}, 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, c, u, T], o;
|
|
1983
1987
|
}, r.on = r.event.on, function() {
|
|
1984
1988
|
var o = s[r.guid];
|
|
1985
1989
|
r.lang.guid = function() {
|
|
@@ -1998,135 +2002,135 @@ var dr = { exports: {} };
|
|
|
1998
2002
|
return "[object " + (this._className || "Object") + "]";
|
|
1999
2003
|
}, r.lang.Event = function(o, l) {
|
|
2000
2004
|
this.type = o, this.returnValue = !0, this.target = l || null, this.currentTarget = null;
|
|
2001
|
-
}, r.lang.Class.prototype.addEventListener = function(o, l,
|
|
2005
|
+
}, r.lang.Class.prototype.addEventListener = function(o, l, c) {
|
|
2002
2006
|
if (r.lang.isFunction(l)) {
|
|
2003
2007
|
!this.__listeners && (this.__listeners = {});
|
|
2004
2008
|
var u = this.__listeners, p;
|
|
2005
|
-
if (typeof
|
|
2006
|
-
if (/[^\w\-]/.test(
|
|
2007
|
-
throw "nonstandard key:" +
|
|
2008
|
-
l.hashCode =
|
|
2009
|
+
if (typeof c == "string" && c) {
|
|
2010
|
+
if (/[^\w\-]/.test(c))
|
|
2011
|
+
throw "nonstandard key:" + c;
|
|
2012
|
+
l.hashCode = c, p = c;
|
|
2009
2013
|
}
|
|
2010
2014
|
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;
|
|
2011
2015
|
}
|
|
2012
2016
|
}, r.lang.Class.prototype.removeEventListener = function(o, l) {
|
|
2013
2017
|
if (!(typeof l < "u" && (r.lang.isFunction(l) && !(l = l.hashCode) || !r.lang.isString(l)))) {
|
|
2014
2018
|
!this.__listeners && (this.__listeners = {}), o.indexOf("on") != 0 && (o = "on" + o);
|
|
2015
|
-
var
|
|
2016
|
-
if (
|
|
2019
|
+
var c = this.__listeners;
|
|
2020
|
+
if (c[o])
|
|
2017
2021
|
if (typeof l < "u")
|
|
2018
|
-
|
|
2022
|
+
c[o][l] && delete c[o][l];
|
|
2019
2023
|
else
|
|
2020
|
-
for (var u in
|
|
2021
|
-
delete
|
|
2024
|
+
for (var u in c[o])
|
|
2025
|
+
delete c[o][u];
|
|
2022
2026
|
}
|
|
2023
2027
|
}, r.lang.Class.prototype.dispatchEvent = function(o, l) {
|
|
2024
2028
|
r.lang.isString(o) && (o = new r.lang.Event(o)), !this.__listeners && (this.__listeners = {}), l = l || {};
|
|
2025
|
-
for (var
|
|
2026
|
-
o[
|
|
2027
|
-
var
|
|
2029
|
+
for (var c in l)
|
|
2030
|
+
o[c] = l[c];
|
|
2031
|
+
var c, u = this.__listeners, p = o.type;
|
|
2028
2032
|
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")
|
|
2029
|
-
for (
|
|
2030
|
-
u[p][
|
|
2033
|
+
for (c in u[p])
|
|
2034
|
+
u[p][c].apply(this, arguments);
|
|
2031
2035
|
return o.returnValue;
|
|
2032
|
-
}, r.lang.inherits = function(o, l,
|
|
2036
|
+
}, r.lang.inherits = function(o, l, c) {
|
|
2033
2037
|
var u, p, b = o.prototype, _ = new Function();
|
|
2034
2038
|
_.prototype = l.prototype, p = o.prototype = new _();
|
|
2035
2039
|
for (u in b)
|
|
2036
2040
|
p[u] = b[u];
|
|
2037
|
-
o.prototype.constructor = o, o.superClass = l.prototype, typeof
|
|
2041
|
+
o.prototype.constructor = o, o.superClass = l.prototype, typeof c == "string" && (p._className = c);
|
|
2038
2042
|
}, r.inherits = r.lang.inherits;
|
|
2039
|
-
var n = "http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m", a = "png",
|
|
2043
|
+
var n = "http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m", a = "png", d = function(o, l, c) {
|
|
2040
2044
|
try {
|
|
2041
2045
|
BMap;
|
|
2042
2046
|
} catch {
|
|
2043
2047
|
throw Error("Baidu Map JS API is not ready yet!");
|
|
2044
2048
|
}
|
|
2045
|
-
e.lang.inherits(
|
|
2049
|
+
e.lang.inherits(d, BMap.Overlay, "TextIconOverlay"), this._position = o, this._text = l, this._options = c || {}, this._styles = this._options.styles || [], this._zIndex = this._options.zIndex, !this._styles.length && this._setupDefaultStyles();
|
|
2046
2050
|
};
|
|
2047
|
-
return
|
|
2048
|
-
for (var o = [53, 56, 66, 78, 90], l = 0,
|
|
2051
|
+
return d.prototype._setupDefaultStyles = function() {
|
|
2052
|
+
for (var o = [53, 56, 66, 78, 90], l = 0, c; c = o[l]; l++)
|
|
2049
2053
|
this._styles.push({
|
|
2050
2054
|
url: n + l + "." + a,
|
|
2051
|
-
size: new BMap.Size(
|
|
2055
|
+
size: new BMap.Size(c, c)
|
|
2052
2056
|
});
|
|
2053
|
-
},
|
|
2057
|
+
}, d.prototype.initialize = function(o) {
|
|
2054
2058
|
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;
|
|
2055
|
-
},
|
|
2059
|
+
}, d.prototype.draw = function() {
|
|
2056
2060
|
this._map && this._updatePosition();
|
|
2057
|
-
},
|
|
2061
|
+
}, d.prototype.getText = function() {
|
|
2058
2062
|
return this._text;
|
|
2059
|
-
},
|
|
2063
|
+
}, d.prototype.setText = function(o) {
|
|
2060
2064
|
o && (!this._text || this._text.toString() != o.toString()) && (this._text = o, this._updateText(), this._updateCss(), this._updatePosition());
|
|
2061
|
-
},
|
|
2065
|
+
}, d.prototype.getPosition = function() {
|
|
2062
2066
|
return this._position;
|
|
2063
|
-
},
|
|
2067
|
+
}, d.prototype.setPosition = function(o) {
|
|
2064
2068
|
o && (!this._position || !this._position.equals(o)) && (this._position = o, this._updatePosition());
|
|
2065
|
-
},
|
|
2066
|
-
var
|
|
2069
|
+
}, d.prototype.getStyleByText = function(o, l) {
|
|
2070
|
+
var c = parseInt(o), u = parseInt(c / 10);
|
|
2067
2071
|
return u = Math.max(0, u), u = Math.min(u, l.length - 1), l[u];
|
|
2068
|
-
},
|
|
2072
|
+
}, d.prototype._updateCss = function() {
|
|
2069
2073
|
if (this._domElement) {
|
|
2070
2074
|
var o = this.getStyleByText(this._text, this._styles);
|
|
2071
2075
|
this._domElement.style.cssText = this._buildCssText(o);
|
|
2072
2076
|
}
|
|
2073
|
-
},
|
|
2077
|
+
}, d.prototype._updateText = function() {
|
|
2074
2078
|
this._domElement && (this._domElement.innerHTML = this._text);
|
|
2075
|
-
},
|
|
2079
|
+
}, d.prototype._updatePosition = function() {
|
|
2076
2080
|
if (this._domElement && this._position) {
|
|
2077
2081
|
var o = this._domElement.style, l = this._map.pointToOverlayPixel(this._position);
|
|
2078
2082
|
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";
|
|
2079
2083
|
}
|
|
2080
|
-
},
|
|
2081
|
-
var l = o.url,
|
|
2082
|
-
if (this._zIndex &&
|
|
2083
|
-
|
|
2084
|
+
}, d.prototype._buildCssText = function(o) {
|
|
2085
|
+
var l = o.url, c = o.size, u = o.anchor, p = o.offset, b = o.textColor || "black", _ = o.textSize || 10, T = [];
|
|
2086
|
+
if (this._zIndex && T.push("z-index:" + this._zIndex + ";"), e.browser.ie < 7)
|
|
2087
|
+
T.push('filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="' + l + '");');
|
|
2084
2088
|
else {
|
|
2085
|
-
|
|
2089
|
+
T.push("background-image:url(" + l + ");");
|
|
2086
2090
|
var g = "0 0";
|
|
2087
|
-
p instanceof BMap.Size && (g = p.width + "px " + p.height + "px"),
|
|
2091
|
+
p instanceof BMap.Size && (g = p.width + "px " + p.height + "px"), T.push("background-position:" + g + ";");
|
|
2088
2092
|
}
|
|
2089
|
-
return
|
|
2090
|
-
},
|
|
2093
|
+
return c instanceof BMap.Size && (u instanceof BMap.Size ? (u.height > 0 && u.height < c.height && T.push("height:" + (c.height - u.height) + "px; padding-top:" + u.height + "px;"), u.width > 0 && u.width < c.width && T.push("width:" + (c.width - u.width) + "px; padding-left:" + u.width + "px;")) : (T.push("height:" + c.height + "px; line-height:" + c.height + "px;"), T.push("width:" + c.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("");
|
|
2094
|
+
}, d.prototype._bind = function() {
|
|
2091
2095
|
if (!this._domElement)
|
|
2092
2096
|
return;
|
|
2093
|
-
var o = this, l = this._map,
|
|
2097
|
+
var o = this, l = this._map, c = e.lang.Event;
|
|
2094
2098
|
function u(p, b) {
|
|
2095
|
-
var _ = p.srcElement || p.target,
|
|
2096
|
-
if (p && b &&
|
|
2099
|
+
var _ = p.srcElement || p.target, T = p.clientX || p.pageX, g = p.clientY || p.pageY;
|
|
2100
|
+
if (p && b && T && g && _) {
|
|
2097
2101
|
var f = e.dom.getPosition(l.getContainer());
|
|
2098
|
-
b.pixel = new BMap.Pixel(
|
|
2102
|
+
b.pixel = new BMap.Pixel(T - f.left, g - f.top), b.point = l.pixelToPoint(b.pixel);
|
|
2099
2103
|
}
|
|
2100
2104
|
return b;
|
|
2101
2105
|
}
|
|
2102
2106
|
e.event.on(this._domElement, "mouseover", function(p) {
|
|
2103
|
-
o.dispatchEvent(u(p, new
|
|
2107
|
+
o.dispatchEvent(u(p, new c("onmouseover")));
|
|
2104
2108
|
}), e.event.on(this._domElement, "mouseout", function(p) {
|
|
2105
|
-
o.dispatchEvent(u(p, new
|
|
2109
|
+
o.dispatchEvent(u(p, new c("onmouseout")));
|
|
2106
2110
|
}), e.event.on(this._domElement, "click", function(p) {
|
|
2107
|
-
o.dispatchEvent(u(p, new
|
|
2111
|
+
o.dispatchEvent(u(p, new c("onclick")));
|
|
2108
2112
|
});
|
|
2109
|
-
},
|
|
2113
|
+
}, d;
|
|
2110
2114
|
});
|
|
2111
|
-
})(
|
|
2112
|
-
var
|
|
2113
|
-
const
|
|
2114
|
-
var
|
|
2115
|
-
t =
|
|
2115
|
+
})(pr);
|
|
2116
|
+
var vi = pr.exports;
|
|
2117
|
+
const Gt = /* @__PURE__ */ st(vi);
|
|
2118
|
+
var gr = function(i, t, e) {
|
|
2119
|
+
t = _i(t);
|
|
2116
2120
|
var r = i.pointToPixel(t.getNorthEast()), s = i.pointToPixel(t.getSouthWest());
|
|
2117
2121
|
r.x += e, r.y -= e, s.x -= e, s.y += e;
|
|
2118
2122
|
var n = i.pixelToPoint(r), a = i.pixelToPoint(s);
|
|
2119
2123
|
return new BMap.Bounds(a, n);
|
|
2120
|
-
},
|
|
2121
|
-
var t =
|
|
2124
|
+
}, _i = function(i) {
|
|
2125
|
+
var t = xe(i.getNorthEast().lng, -180, 180), e = xe(i.getSouthWest().lng, -180, 180), r = xe(i.getNorthEast().lat, -74, 74), s = xe(i.getSouthWest().lat, -74, 74);
|
|
2122
2126
|
return new BMap.Bounds(new BMap.Point(e, s), new BMap.Point(t, r));
|
|
2123
|
-
},
|
|
2127
|
+
}, xe = function(i, t, e) {
|
|
2124
2128
|
return t && (i = Math.max(i, t)), e && (i = Math.min(i, e)), i;
|
|
2125
|
-
},
|
|
2129
|
+
}, mr = function(i) {
|
|
2126
2130
|
return Object.prototype.toString.call(i) === "[object Array]";
|
|
2127
|
-
},
|
|
2131
|
+
}, fr = function(i, t) {
|
|
2128
2132
|
var e = -1;
|
|
2129
|
-
if (
|
|
2133
|
+
if (mr(t)) {
|
|
2130
2134
|
if (t.indexOf)
|
|
2131
2135
|
e = t.indexOf(i);
|
|
2132
2136
|
else
|
|
@@ -2137,7 +2141,7 @@ var ur = function(i, t, e) {
|
|
|
2137
2141
|
}
|
|
2138
2142
|
}
|
|
2139
2143
|
return e;
|
|
2140
|
-
},
|
|
2144
|
+
}, M = function(i, t) {
|
|
2141
2145
|
try {
|
|
2142
2146
|
BMap;
|
|
2143
2147
|
} catch {
|
|
@@ -2154,33 +2158,33 @@ var ur = function(i, t, e) {
|
|
|
2154
2158
|
r._redraw();
|
|
2155
2159
|
});
|
|
2156
2160
|
var s = e.markers;
|
|
2157
|
-
|
|
2161
|
+
mr(s) && this.addMarkers(s);
|
|
2158
2162
|
}
|
|
2159
2163
|
};
|
|
2160
|
-
|
|
2164
|
+
M.prototype.addMarkers = function(i) {
|
|
2161
2165
|
if (i.length) {
|
|
2162
2166
|
for (var t = 0, e = i.length; t < e; t++)
|
|
2163
2167
|
this._pushMarkerTo(i[t]);
|
|
2164
2168
|
this._createClusters();
|
|
2165
2169
|
}
|
|
2166
2170
|
};
|
|
2167
|
-
|
|
2168
|
-
var t =
|
|
2171
|
+
M.prototype._pushMarkerTo = function(i) {
|
|
2172
|
+
var t = fr(i, this._markers);
|
|
2169
2173
|
t === -1 && (i.isInCluster = !1, this._markers.push(i));
|
|
2170
2174
|
};
|
|
2171
|
-
|
|
2175
|
+
M.prototype.addMarker = function(i) {
|
|
2172
2176
|
this._pushMarkerTo(i), this._createClusters();
|
|
2173
2177
|
};
|
|
2174
|
-
|
|
2178
|
+
M.prototype._createClusters = function() {
|
|
2175
2179
|
var i = this._map.getBounds();
|
|
2176
2180
|
if (i.getCenter()) {
|
|
2177
|
-
for (var t =
|
|
2181
|
+
for (var t = gr(this._map, i, this._gridSize), e = 0, r; r = this._markers[e]; e++)
|
|
2178
2182
|
!r.isInCluster && t.containsPoint(r.getPosition()) && this._addToClosestCluster(r);
|
|
2179
2183
|
for (var s = this._markers.length, e = 0; e < s; e++)
|
|
2180
2184
|
this._clusters[e] && this._clusters[e].render();
|
|
2181
2185
|
}
|
|
2182
2186
|
};
|
|
2183
|
-
|
|
2187
|
+
M.prototype._addToClosestCluster = function(i) {
|
|
2184
2188
|
var t = 4e6, e = null;
|
|
2185
2189
|
i.getPosition();
|
|
2186
2190
|
for (var r = 0, s; s = this._clusters[r]; r++) {
|
|
@@ -2193,104 +2197,104 @@ T.prototype._addToClosestCluster = function(i) {
|
|
|
2193
2197
|
if (e && e.isMarkerInClusterBounds(i))
|
|
2194
2198
|
e.addMarker(i);
|
|
2195
2199
|
else {
|
|
2196
|
-
var s = new
|
|
2200
|
+
var s = new z(this);
|
|
2197
2201
|
s.addMarker(i), this._clusters.push(s);
|
|
2198
2202
|
}
|
|
2199
2203
|
};
|
|
2200
|
-
|
|
2204
|
+
M.prototype._clearLastClusters = function() {
|
|
2201
2205
|
for (var i = 0, t; t = this._clusters[i]; i++)
|
|
2202
2206
|
t.remove();
|
|
2203
2207
|
this._clusters = [], this._removeMarkersFromCluster();
|
|
2204
2208
|
};
|
|
2205
|
-
|
|
2209
|
+
M.prototype._removeMarkersFromCluster = function() {
|
|
2206
2210
|
for (var i = 0, t; t = this._markers[i]; i++)
|
|
2207
2211
|
t.isInCluster = !1;
|
|
2208
2212
|
};
|
|
2209
|
-
|
|
2213
|
+
M.prototype._removeMarkersFromMap = function() {
|
|
2210
2214
|
for (var i = 0, t; t = this._markers[i]; i++) {
|
|
2211
2215
|
t.isInCluster = !1;
|
|
2212
2216
|
var e = t.getLabel();
|
|
2213
2217
|
this._map.removeOverlay(t), t.setLabel(e);
|
|
2214
2218
|
}
|
|
2215
2219
|
};
|
|
2216
|
-
|
|
2217
|
-
var t =
|
|
2220
|
+
M.prototype._removeMarker = function(i) {
|
|
2221
|
+
var t = fr(i, this._markers);
|
|
2218
2222
|
return t === -1 ? !1 : (this._map.removeOverlay(i), this._markers.splice(t, 1), !0);
|
|
2219
2223
|
};
|
|
2220
|
-
|
|
2224
|
+
M.prototype.removeMarker = function(i) {
|
|
2221
2225
|
var t = this._removeMarker(i);
|
|
2222
2226
|
return t && (this._clearLastClusters(), this._createClusters()), t;
|
|
2223
2227
|
};
|
|
2224
|
-
|
|
2228
|
+
M.prototype.removeMarkers = function(i) {
|
|
2225
2229
|
for (var t = !1, e = 0; e < i.length; e++) {
|
|
2226
2230
|
var r = this._removeMarker(i[e]);
|
|
2227
2231
|
t = t || r;
|
|
2228
2232
|
}
|
|
2229
2233
|
return t && (this._clearLastClusters(), this._createClusters()), t;
|
|
2230
2234
|
};
|
|
2231
|
-
|
|
2235
|
+
M.prototype.clearMarkers = function() {
|
|
2232
2236
|
this._clearLastClusters(), this._removeMarkersFromMap(), this._markers = [];
|
|
2233
2237
|
};
|
|
2234
|
-
|
|
2238
|
+
M.prototype._redraw = function() {
|
|
2235
2239
|
this._clearLastClusters(), this._createClusters();
|
|
2236
2240
|
};
|
|
2237
|
-
|
|
2241
|
+
M.prototype.getGridSize = function() {
|
|
2238
2242
|
return this._gridSize;
|
|
2239
2243
|
};
|
|
2240
|
-
|
|
2244
|
+
M.prototype.setGridSize = function(i) {
|
|
2241
2245
|
this._gridSize = i, this._redraw();
|
|
2242
2246
|
};
|
|
2243
|
-
|
|
2247
|
+
M.prototype.getMaxZoom = function() {
|
|
2244
2248
|
return this._maxZoom;
|
|
2245
2249
|
};
|
|
2246
|
-
|
|
2250
|
+
M.prototype.setMaxZoom = function(i) {
|
|
2247
2251
|
this._maxZoom = i, this._redraw();
|
|
2248
2252
|
};
|
|
2249
|
-
|
|
2253
|
+
M.prototype.getZIndex = function() {
|
|
2250
2254
|
return this._zIndex;
|
|
2251
2255
|
};
|
|
2252
|
-
|
|
2256
|
+
M.prototype.setZIndex = function(i) {
|
|
2253
2257
|
this._zIndex != i && (this.zIndex = i, this._redraw());
|
|
2254
2258
|
};
|
|
2255
|
-
|
|
2259
|
+
M.prototype.getStyles = function() {
|
|
2256
2260
|
return this._styles;
|
|
2257
2261
|
};
|
|
2258
|
-
|
|
2262
|
+
M.prototype.setStyles = function(i) {
|
|
2259
2263
|
this._styles = i, this._redraw();
|
|
2260
2264
|
};
|
|
2261
|
-
|
|
2265
|
+
M.prototype.getMinClusterSize = function() {
|
|
2262
2266
|
return this._minClusterSize;
|
|
2263
2267
|
};
|
|
2264
|
-
|
|
2268
|
+
M.prototype.setMinClusterSize = function(i) {
|
|
2265
2269
|
this._minClusterSize = i, this._redraw();
|
|
2266
2270
|
};
|
|
2267
|
-
|
|
2271
|
+
M.prototype.isAverageCenter = function() {
|
|
2268
2272
|
return this._isAverageCenter;
|
|
2269
2273
|
};
|
|
2270
|
-
|
|
2274
|
+
M.prototype.getMap = function() {
|
|
2271
2275
|
return this._map;
|
|
2272
2276
|
};
|
|
2273
|
-
|
|
2277
|
+
M.prototype.getMarkers = function() {
|
|
2274
2278
|
return this._markers;
|
|
2275
2279
|
};
|
|
2276
|
-
|
|
2280
|
+
M.prototype.getClustersCount = function() {
|
|
2277
2281
|
for (var i = 0, t = 0, e; e = this._clusters[t]; t++)
|
|
2278
2282
|
e.isReal() && i++;
|
|
2279
2283
|
return i;
|
|
2280
2284
|
};
|
|
2281
|
-
|
|
2285
|
+
M.prototype._textCalculator = function(i) {
|
|
2282
2286
|
return i.length.toString();
|
|
2283
2287
|
};
|
|
2284
|
-
|
|
2285
|
-
|
|
2288
|
+
M.prototype._stylesIndexCalculator = null;
|
|
2289
|
+
M.prototype.setTextCalculator = function(i) {
|
|
2286
2290
|
this._textCalculator = i;
|
|
2287
2291
|
};
|
|
2288
|
-
|
|
2292
|
+
M.prototype.setStylesIndexCalculator = function(i) {
|
|
2289
2293
|
this._stylesIndexCalculator = i;
|
|
2290
2294
|
};
|
|
2291
|
-
function
|
|
2295
|
+
function z(i) {
|
|
2292
2296
|
var t = this;
|
|
2293
|
-
this._markerClusterer = i, this._map = i.getMap(), this._minClusterSize = i.getMinClusterSize(), this._isAverageCenter = i.isAverageCenter(), this._center = null, this._markers = [], this._gridBounds = null, this._isReal = !1, this._clusterMarker = new
|
|
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 Gt(this._center, this._markers.length, {
|
|
2294
2298
|
styles: this._markerClusterer.getStyles(),
|
|
2295
2299
|
zIndex: i._zIndex
|
|
2296
2300
|
}), this._clusterMarker.getStyleByText = function(e, r) {
|
|
@@ -2298,12 +2302,12 @@ function D(i) {
|
|
|
2298
2302
|
var s = t._markerClusterer._stylesIndexCalculator(t._markers, r.length);
|
|
2299
2303
|
return r[s];
|
|
2300
2304
|
}
|
|
2301
|
-
return
|
|
2305
|
+
return Gt.prototype.getStyleByText.call(this, e, r);
|
|
2302
2306
|
}, this._clusterMarker.addEventListener && this._clusterMarker.addEventListener("click", function(e) {
|
|
2303
2307
|
t._map.setViewport(t.getBounds());
|
|
2304
2308
|
});
|
|
2305
2309
|
}
|
|
2306
|
-
|
|
2310
|
+
z.prototype.addMarker = function(i) {
|
|
2307
2311
|
if (this.isMarkerInCluster(i))
|
|
2308
2312
|
return !1;
|
|
2309
2313
|
if (!this._center)
|
|
@@ -2314,7 +2318,7 @@ D.prototype.addMarker = function(i) {
|
|
|
2314
2318
|
}
|
|
2315
2319
|
return i.isInCluster = !0, this._markers.push(i), !0;
|
|
2316
2320
|
};
|
|
2317
|
-
|
|
2321
|
+
z.prototype.render = function() {
|
|
2318
2322
|
var i = this._markers.length;
|
|
2319
2323
|
if (i < this._minClusterSize)
|
|
2320
2324
|
for (var t = 0; t < i; t++)
|
|
@@ -2322,7 +2326,7 @@ D.prototype.render = function() {
|
|
|
2322
2326
|
else
|
|
2323
2327
|
this._map.addOverlay(this._clusterMarker), this._isReal = !0, this.updateClusterMarker();
|
|
2324
2328
|
};
|
|
2325
|
-
|
|
2329
|
+
z.prototype.isMarkerInCluster = function(i) {
|
|
2326
2330
|
if (this._markers.indexOf)
|
|
2327
2331
|
return this._markers.indexOf(i) != -1;
|
|
2328
2332
|
for (var t = 0, e; e = this._markers[t]; t++)
|
|
@@ -2330,17 +2334,17 @@ D.prototype.isMarkerInCluster = function(i) {
|
|
|
2330
2334
|
return !0;
|
|
2331
2335
|
return !1;
|
|
2332
2336
|
};
|
|
2333
|
-
|
|
2337
|
+
z.prototype.isMarkerInClusterBounds = function(i) {
|
|
2334
2338
|
return this._gridBounds.containsPoint(i.getPosition());
|
|
2335
2339
|
};
|
|
2336
|
-
|
|
2340
|
+
z.prototype.isReal = function(i) {
|
|
2337
2341
|
return this._isReal;
|
|
2338
2342
|
};
|
|
2339
|
-
|
|
2343
|
+
z.prototype.updateGridBounds = function() {
|
|
2340
2344
|
var i = new BMap.Bounds(this._center, this._center);
|
|
2341
|
-
this._gridBounds =
|
|
2345
|
+
this._gridBounds = gr(this._map, i, this._markerClusterer.getGridSize());
|
|
2342
2346
|
};
|
|
2343
|
-
|
|
2347
|
+
z.prototype.updateClusterMarker = function() {
|
|
2344
2348
|
if (this._map.getZoom() > this._markerClusterer.getMaxZoom()) {
|
|
2345
2349
|
this._clusterMarker && this._map.removeOverlay(this._clusterMarker);
|
|
2346
2350
|
for (var i = 0, t; t = this._markers[i]; i++)
|
|
@@ -2353,22 +2357,22 @@ D.prototype.updateClusterMarker = function() {
|
|
|
2353
2357
|
}
|
|
2354
2358
|
this._clusterMarker.setPosition(this._center), this._clusterMarker.setText(this._markerClusterer._textCalculator(this._markers));
|
|
2355
2359
|
};
|
|
2356
|
-
|
|
2360
|
+
z.prototype.remove = function() {
|
|
2357
2361
|
for (var i = 0, t; t = this._markers[i]; i++) {
|
|
2358
2362
|
var e = this._markers[i].getLabel();
|
|
2359
2363
|
this._markers[i].getMap() && this._map.removeOverlay(this._markers[i]), this._markers[i].setLabel(e);
|
|
2360
2364
|
}
|
|
2361
2365
|
this._map.removeOverlay(this._clusterMarker), this._markers.length = 0, delete this._markers;
|
|
2362
2366
|
};
|
|
2363
|
-
|
|
2367
|
+
z.prototype.getBounds = function() {
|
|
2364
2368
|
for (var i = new BMap.Bounds(this._center, this._center), t = 0, e; e = this._markers[t]; t++)
|
|
2365
2369
|
i.extend(e.getPosition());
|
|
2366
2370
|
return i;
|
|
2367
2371
|
};
|
|
2368
|
-
|
|
2372
|
+
z.prototype.getCenter = function() {
|
|
2369
2373
|
return this._center;
|
|
2370
2374
|
};
|
|
2371
|
-
var
|
|
2375
|
+
var Re;
|
|
2372
2376
|
((i) => {
|
|
2373
2377
|
function t(r) {
|
|
2374
2378
|
return {
|
|
@@ -2393,10 +2397,10 @@ var Ae;
|
|
|
2393
2397
|
};
|
|
2394
2398
|
}
|
|
2395
2399
|
i.toGoogle = e;
|
|
2396
|
-
})(
|
|
2397
|
-
class
|
|
2400
|
+
})(Re || (Re = {}));
|
|
2401
|
+
class yr {
|
|
2398
2402
|
constructor(t) {
|
|
2399
|
-
|
|
2403
|
+
h(this, "inner");
|
|
2400
2404
|
this.map = t;
|
|
2401
2405
|
}
|
|
2402
2406
|
/** baidu/google 拥有相同的函数名 */
|
|
@@ -2420,17 +2424,17 @@ class mr {
|
|
|
2420
2424
|
return this.inner.removeMarkers(t.map((e) => e.innerOverlay));
|
|
2421
2425
|
}
|
|
2422
2426
|
}
|
|
2423
|
-
class
|
|
2427
|
+
class bi extends yr {
|
|
2424
2428
|
constructor(t, e) {
|
|
2425
2429
|
var s;
|
|
2426
|
-
super(t), this.inner = new
|
|
2430
|
+
super(t), this.inner = new M(t.innerMap, {
|
|
2427
2431
|
// baidu的构造器中的markers, 会触发重绘, 会导致使用旧的calculator计算cluster
|
|
2428
2432
|
// markers: options.markers?.map(it => (it as BaiduMarker).innerOverlay),
|
|
2429
2433
|
gridSize: e.gridSize,
|
|
2430
2434
|
maxZoom: e.maxZoom,
|
|
2431
2435
|
minClusterSize: e.minClusterSize,
|
|
2432
2436
|
isAverageCenter: e.averageCenter,
|
|
2433
|
-
styles: (s = e.styles) == null ? void 0 : s.map((n) =>
|
|
2437
|
+
styles: (s = e.styles) == null ? void 0 : s.map((n) => Re.toBaidu(n)),
|
|
2434
2438
|
zIndex: e.zIndex
|
|
2435
2439
|
});
|
|
2436
2440
|
const r = e.stylesIndexCalculator;
|
|
@@ -2440,10 +2444,10 @@ class _i extends mr {
|
|
|
2440
2444
|
this.inner._redraw();
|
|
2441
2445
|
}
|
|
2442
2446
|
}
|
|
2443
|
-
class
|
|
2447
|
+
class Ti extends yr {
|
|
2444
2448
|
constructor(t, e) {
|
|
2445
2449
|
var s, n;
|
|
2446
|
-
super(t), this.inner = new
|
|
2450
|
+
super(t), this.inner = new fi(
|
|
2447
2451
|
t.innerMap,
|
|
2448
2452
|
// google的构造器中的markers,不会触发重绘, 第一次绘制通过监听地图的'idle'事件触发, 可以直接设置
|
|
2449
2453
|
(s = e.markers) == null ? void 0 : s.map((a) => a.innerOverlay),
|
|
@@ -2452,29 +2456,29 @@ class bi extends mr {
|
|
|
2452
2456
|
maxZoom: e.maxZoom,
|
|
2453
2457
|
minimumClusterSize: e.minClusterSize,
|
|
2454
2458
|
averageCenter: e.averageCenter,
|
|
2455
|
-
styles: (n = e.styles) == null ? void 0 : n.map((a) =>
|
|
2459
|
+
styles: (n = e.styles) == null ? void 0 : n.map((a) => Re.toGoogle(a)),
|
|
2456
2460
|
zIndex: e.zIndex
|
|
2457
2461
|
}
|
|
2458
2462
|
);
|
|
2459
2463
|
const r = e.stylesIndexCalculator;
|
|
2460
|
-
r && this.inner.setCalculator((a,
|
|
2464
|
+
r && this.inner.setCalculator((a, d) => ({
|
|
2461
2465
|
text: a.length,
|
|
2462
2466
|
// google内部, 取index时, 会`-1`...故我们这里`+1`, 抵消掉它
|
|
2463
|
-
index: r(a.length,
|
|
2467
|
+
index: r(a.length, d) + 1
|
|
2464
2468
|
}));
|
|
2465
2469
|
}
|
|
2466
2470
|
recreate() {
|
|
2467
2471
|
this.inner.repaint();
|
|
2468
2472
|
}
|
|
2469
2473
|
}
|
|
2470
|
-
class
|
|
2474
|
+
class vr {
|
|
2471
2475
|
constructor() {
|
|
2472
2476
|
}
|
|
2473
2477
|
}
|
|
2474
|
-
class Mi extends
|
|
2478
|
+
class Mi extends vr {
|
|
2475
2479
|
constructor(e, r) {
|
|
2476
2480
|
super();
|
|
2477
|
-
|
|
2481
|
+
h(this, "inner");
|
|
2478
2482
|
this.map = e, this.inner = new google.maps.places.PlacesService(e.innerMap);
|
|
2479
2483
|
}
|
|
2480
2484
|
search(e, r) {
|
|
@@ -2501,27 +2505,27 @@ class Mi extends fr {
|
|
|
2501
2505
|
// 'address_components', // TODO: 2023/04/28 ipcjs 查询请求不支持该字段...
|
|
2502
2506
|
],
|
|
2503
2507
|
locationBias: r
|
|
2504
|
-
}, (a,
|
|
2505
|
-
switch (
|
|
2508
|
+
}, (a, d) => {
|
|
2509
|
+
switch (d) {
|
|
2506
2510
|
case google.maps.places.PlacesServiceStatus.ZERO_RESULTS:
|
|
2507
2511
|
case google.maps.places.PlacesServiceStatus.OK: {
|
|
2508
|
-
const o = (a ?? []).map((l) =>
|
|
2512
|
+
const o = (a ?? []).map((l) => hr(l, this.map));
|
|
2509
2513
|
s(o);
|
|
2510
2514
|
break;
|
|
2511
2515
|
}
|
|
2512
2516
|
default:
|
|
2513
|
-
n(new Error(`status: ${
|
|
2517
|
+
n(new Error(`status: ${d}`));
|
|
2514
2518
|
break;
|
|
2515
2519
|
}
|
|
2516
2520
|
});
|
|
2517
2521
|
});
|
|
2518
2522
|
}
|
|
2519
2523
|
}
|
|
2520
|
-
class
|
|
2524
|
+
class Oi extends vr {
|
|
2521
2525
|
constructor(e, r) {
|
|
2522
2526
|
super();
|
|
2523
|
-
|
|
2524
|
-
|
|
2527
|
+
h(this, "searchRequestMap", /* @__PURE__ */ new Map());
|
|
2528
|
+
h(this, "currentSearch");
|
|
2525
2529
|
this.map = e;
|
|
2526
2530
|
}
|
|
2527
2531
|
get inner() {
|
|
@@ -2548,14 +2552,14 @@ class Ti extends fr {
|
|
|
2548
2552
|
newSearch(e, r) {
|
|
2549
2553
|
return new Promise((s, n) => {
|
|
2550
2554
|
const a = new BMap.LocalSearch(e ?? this.map.innerMap, {
|
|
2551
|
-
onSearchComplete: (
|
|
2552
|
-
Array.isArray(
|
|
2555
|
+
onSearchComplete: (d) => {
|
|
2556
|
+
Array.isArray(d) && nt("当前只支持一次搜索一条数据");
|
|
2553
2557
|
const o = a.getStatus();
|
|
2554
2558
|
switch (o) {
|
|
2555
2559
|
case BMAP_STATUS_SUCCESS: {
|
|
2556
2560
|
const l = [];
|
|
2557
|
-
for (let
|
|
2558
|
-
const u =
|
|
2561
|
+
for (let c = 0; c < d.getCurrentNumPois(); c++) {
|
|
2562
|
+
const u = d.getPoi(c);
|
|
2559
2563
|
l.push({
|
|
2560
2564
|
id: u.uid,
|
|
2561
2565
|
city: u.city,
|
|
@@ -2583,10 +2587,10 @@ class Ti extends fr {
|
|
|
2583
2587
|
});
|
|
2584
2588
|
}
|
|
2585
2589
|
}
|
|
2586
|
-
class
|
|
2590
|
+
class _r {
|
|
2587
2591
|
constructor(t, e) {
|
|
2588
|
-
|
|
2589
|
-
|
|
2592
|
+
h(this, "onData");
|
|
2593
|
+
h(this, "onError");
|
|
2590
2594
|
this.map = t, this.input = e;
|
|
2591
2595
|
}
|
|
2592
2596
|
/**
|
|
@@ -2595,30 +2599,30 @@ class yr {
|
|
|
2595
2599
|
* @mustCallSuper 子类必须调用一次`super.setSearchListener`, 用来保存{@link onData}和{@link onError}
|
|
2596
2600
|
* */
|
|
2597
2601
|
setSearchListener(t, e) {
|
|
2598
|
-
return this.onData && C("setSearchListener只能调用一次"), this.onData = t, this.onError = e,
|
|
2602
|
+
return this.onData && C("setSearchListener只能调用一次"), this.onData = t, this.onError = e, ve;
|
|
2599
2603
|
}
|
|
2600
2604
|
}
|
|
2601
|
-
class
|
|
2605
|
+
class Ci extends _r {
|
|
2602
2606
|
constructor(e, r) {
|
|
2603
2607
|
super(e, r.input);
|
|
2604
|
-
|
|
2608
|
+
h(this, "searchBox");
|
|
2605
2609
|
this.searchBox = new google.maps.places.SearchBox(r.input), this.searchBox.bindTo("bounds", e.innerMap);
|
|
2606
2610
|
}
|
|
2607
2611
|
setSearchListener(e, r) {
|
|
2608
|
-
return super.setSearchListener(e, r),
|
|
2612
|
+
return super.setSearchListener(e, r), tr(this.searchBox, "places_changed", () => {
|
|
2609
2613
|
const s = this.searchBox.getPlaces();
|
|
2610
|
-
e((s ?? []).map((n) =>
|
|
2614
|
+
e((s ?? []).map((n) => hr(n, this.map)));
|
|
2611
2615
|
});
|
|
2612
2616
|
}
|
|
2613
2617
|
search() {
|
|
2614
2618
|
this.input.value && (google.maps.event.trigger(this.input, "focus", {}), google.maps.event.trigger(this.input, "keydown", { keyCode: 13 }));
|
|
2615
2619
|
}
|
|
2616
2620
|
}
|
|
2617
|
-
class
|
|
2621
|
+
class wi extends _r {
|
|
2618
2622
|
constructor(e, r) {
|
|
2619
2623
|
super(e, r.input);
|
|
2620
|
-
|
|
2621
|
-
|
|
2624
|
+
h(this, "autocomplete");
|
|
2625
|
+
h(this, "placesService");
|
|
2622
2626
|
this.autocomplete = e.createAutocomplete({ input: r.input, bindToMap: !0 }), this.placesService = e.createPlacesService({});
|
|
2623
2627
|
}
|
|
2624
2628
|
setSearchListener(e, r) {
|
|
@@ -2633,12 +2637,12 @@ class Ci extends yr {
|
|
|
2633
2637
|
this.placesService.search(e).then(this.onData, this.onError);
|
|
2634
2638
|
}
|
|
2635
2639
|
}
|
|
2636
|
-
var
|
|
2637
|
-
class
|
|
2640
|
+
var Ei = /* @__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))(Ei || {});
|
|
2641
|
+
class gt {
|
|
2638
2642
|
constructor(t) {
|
|
2639
|
-
|
|
2643
|
+
h(this, "latestInfoWindow");
|
|
2640
2644
|
/** 使用{@link setEventTargetDelegate}初始化 */
|
|
2641
|
-
|
|
2645
|
+
h(this, "delegate", void 0);
|
|
2642
2646
|
this.element = t, process.env.NODE_ENV !== "production" && setTimeout(() => {
|
|
2643
2647
|
this.delegate || console.warn(`${this.constructor.name}继承了AbstractMap, 但未调用setEventTargetDelegate(delegate)`);
|
|
2644
2648
|
});
|
|
@@ -2687,7 +2691,7 @@ class ut {
|
|
|
2687
2691
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
2688
2692
|
* Released under the MIT License.
|
|
2689
2693
|
*/
|
|
2690
|
-
function
|
|
2694
|
+
function Li(i) {
|
|
2691
2695
|
return i != null && typeof i == "object" && Array.isArray(i) === !1;
|
|
2692
2696
|
}
|
|
2693
2697
|
/*!
|
|
@@ -2696,49 +2700,49 @@ function Ei(i) {
|
|
|
2696
2700
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
2697
2701
|
* Released under the MIT License.
|
|
2698
2702
|
*/
|
|
2699
|
-
function
|
|
2700
|
-
return
|
|
2703
|
+
function Zt(i) {
|
|
2704
|
+
return Li(i) === !0 && Object.prototype.toString.call(i) === "[object Object]";
|
|
2701
2705
|
}
|
|
2702
|
-
function
|
|
2706
|
+
function br(i) {
|
|
2703
2707
|
var t, e;
|
|
2704
|
-
return !(
|
|
2708
|
+
return !(Zt(i) === !1 || (t = i.constructor, typeof t != "function") || (e = t.prototype, Zt(e) === !1) || e.hasOwnProperty("isPrototypeOf") === !1);
|
|
2705
2709
|
}
|
|
2706
|
-
var
|
|
2710
|
+
var be;
|
|
2707
2711
|
((i) => {
|
|
2708
|
-
function t(
|
|
2709
|
-
return
|
|
2712
|
+
function t(d, o) {
|
|
2713
|
+
return d.reduce((l, c) => (l[o(c)] = c, l), {});
|
|
2710
2714
|
}
|
|
2711
2715
|
i.fromArray = t;
|
|
2712
|
-
function e(
|
|
2713
|
-
return
|
|
2716
|
+
function e(d) {
|
|
2717
|
+
return d.reduce((o, l) => (o[l[0]] = l[1], o), {});
|
|
2714
2718
|
}
|
|
2715
2719
|
i.fromEntries = e;
|
|
2716
|
-
function r(
|
|
2717
|
-
return JSON.stringify(
|
|
2720
|
+
function r(d) {
|
|
2721
|
+
return JSON.stringify(d, (o, l) => typeof l == "object" && Object.getPrototypeOf(l) !== Object.prototype ? l.toString !== Object.prototype.toString ? l.toString() : `[object ${Object.getPrototypeOf(l).constructor.name}]` : l);
|
|
2718
2722
|
}
|
|
2719
2723
|
i.toJsonSafely = r;
|
|
2720
|
-
function s(
|
|
2721
|
-
|
|
2722
|
-
|
|
2724
|
+
function s(d) {
|
|
2725
|
+
br(d) && Object.keys(d).forEach((o) => {
|
|
2726
|
+
d[o] === void 0 ? delete d[o] : s(d[o]);
|
|
2723
2727
|
});
|
|
2724
2728
|
}
|
|
2725
2729
|
i.deleteUndefinedPropertyOnPlainObjectDeeply = s;
|
|
2726
|
-
function n(
|
|
2727
|
-
const l =
|
|
2728
|
-
for (const u in
|
|
2729
|
-
l(u) || (
|
|
2730
|
-
return
|
|
2730
|
+
function n(d, ...o) {
|
|
2731
|
+
const l = Wt(o), c = {};
|
|
2732
|
+
for (const u in d)
|
|
2733
|
+
l(u) || (c[u] = d[u]);
|
|
2734
|
+
return c;
|
|
2731
2735
|
}
|
|
2732
2736
|
i.omit = n;
|
|
2733
|
-
function a(
|
|
2734
|
-
const l =
|
|
2735
|
-
for (const u in
|
|
2736
|
-
l(u) && (
|
|
2737
|
-
return
|
|
2737
|
+
function a(d, ...o) {
|
|
2738
|
+
const l = Wt(o), c = {};
|
|
2739
|
+
for (const u in d)
|
|
2740
|
+
l(u) && (c[u] = d[u]);
|
|
2741
|
+
return c;
|
|
2738
2742
|
}
|
|
2739
2743
|
i.pick = a;
|
|
2740
|
-
})(
|
|
2741
|
-
function
|
|
2744
|
+
})(be || (be = {}));
|
|
2745
|
+
function Wt(i) {
|
|
2742
2746
|
if (i.length <= 4)
|
|
2743
2747
|
return i.includes.bind(i);
|
|
2744
2748
|
{
|
|
@@ -2746,22 +2750,22 @@ function Gt(i) {
|
|
|
2746
2750
|
return t.has.bind(t);
|
|
2747
2751
|
}
|
|
2748
2752
|
}
|
|
2749
|
-
|
|
2750
|
-
const
|
|
2751
|
-
var
|
|
2753
|
+
be.toJsonSafely;
|
|
2754
|
+
const xi = ["single", "multi"];
|
|
2755
|
+
var j = /* @__PURE__ */ ((i) => (i.auto = "auto", i.none = "none", i.greedy = "greedy", i.cooperative = "cooperative", i))(j || {}), rt;
|
|
2752
2756
|
((i) => {
|
|
2753
2757
|
function t(e) {
|
|
2754
|
-
|
|
2758
|
+
be.deleteUndefinedPropertyOnPlainObjectDeeply(e);
|
|
2755
2759
|
const r = { center: y.ZERO, zoom: 5 };
|
|
2756
|
-
return
|
|
2757
|
-
isMergeableObject:
|
|
2760
|
+
return Jt(r, e || {}, {
|
|
2761
|
+
isMergeableObject: br
|
|
2758
2762
|
});
|
|
2759
2763
|
}
|
|
2760
2764
|
i.create = t;
|
|
2761
|
-
})(
|
|
2762
|
-
class
|
|
2765
|
+
})(rt || (rt = {}));
|
|
2766
|
+
class Tr {
|
|
2763
2767
|
constructor(t, e, r) {
|
|
2764
|
-
|
|
2768
|
+
h(this, "_delegate");
|
|
2765
2769
|
this.innerOverlay = t, this.coordType = e, this.map = r;
|
|
2766
2770
|
}
|
|
2767
2771
|
get delegate() {
|
|
@@ -2777,12 +2781,12 @@ class _r {
|
|
|
2777
2781
|
this.map.removeOverlay(this);
|
|
2778
2782
|
}
|
|
2779
2783
|
}
|
|
2780
|
-
class
|
|
2784
|
+
class mt extends Tr {
|
|
2781
2785
|
constructor(t, e, r) {
|
|
2782
2786
|
super(t, e, r);
|
|
2783
2787
|
}
|
|
2784
2788
|
createDelegate() {
|
|
2785
|
-
return new
|
|
2789
|
+
return new re(this.innerOverlay, this.map);
|
|
2786
2790
|
}
|
|
2787
2791
|
isVisible() {
|
|
2788
2792
|
return this.innerOverlay.getVisible();
|
|
@@ -2791,12 +2795,12 @@ class pt extends _r {
|
|
|
2791
2795
|
this.innerOverlay.setVisible(t);
|
|
2792
2796
|
}
|
|
2793
2797
|
}
|
|
2794
|
-
class
|
|
2798
|
+
class je extends Tr {
|
|
2795
2799
|
constructor(t, e, r) {
|
|
2796
2800
|
super(t, e, r);
|
|
2797
2801
|
}
|
|
2798
2802
|
createDelegate() {
|
|
2799
|
-
return new
|
|
2803
|
+
return new ae(this.innerOverlay, this.map);
|
|
2800
2804
|
}
|
|
2801
2805
|
/** 仅限内部使用; 设为private时, 生成的d.ts文件中, 方法返回值会变成any, 故改成了public */
|
|
2802
2806
|
get overlay() {
|
|
@@ -2813,7 +2817,7 @@ class We extends _r {
|
|
|
2813
2817
|
return t !== void 0 && (t || this.setVisible(!1)), this;
|
|
2814
2818
|
}
|
|
2815
2819
|
}
|
|
2816
|
-
class
|
|
2820
|
+
const Ge = class extends je {
|
|
2817
2821
|
constructor(t, e, r, s) {
|
|
2818
2822
|
super(t, e, r), this.state = s;
|
|
2819
2823
|
}
|
|
@@ -2827,7 +2831,7 @@ class br extends We {
|
|
|
2827
2831
|
this.innerOverlay.setStrokeColor(t);
|
|
2828
2832
|
}
|
|
2829
2833
|
setStrokeOpacity(t) {
|
|
2830
|
-
this.innerOverlay.setStrokeOpacity(t);
|
|
2834
|
+
this.innerOverlay.setStrokeOpacity(t + Ge.OPACITY_DELTA);
|
|
2831
2835
|
}
|
|
2832
2836
|
setStrokeWeight(t) {
|
|
2833
2837
|
this.innerOverlay.setStrokeWeight(t);
|
|
@@ -2836,10 +2840,18 @@ class br extends We {
|
|
|
2836
2840
|
this.innerOverlay.setFillColor(t);
|
|
2837
2841
|
}
|
|
2838
2842
|
setFillOpacity(t) {
|
|
2839
|
-
this.innerOverlay.setFillOpacity(t);
|
|
2843
|
+
this.innerOverlay.setFillOpacity(t + Ge.OPACITY_DELTA);
|
|
2840
2844
|
}
|
|
2841
|
-
}
|
|
2842
|
-
|
|
2845
|
+
};
|
|
2846
|
+
let k = Ge;
|
|
2847
|
+
/**
|
|
2848
|
+
* baidu地图的透明度属性有如下问题:
|
|
2849
|
+
* - 在透明度为0时, 无法隐藏掉颜色
|
|
2850
|
+
* - 透明度为0.7和0.8时, 在maintain的发布模式下, polyline的线条会不可见 (原因未知, 在tg-map中无法复现)
|
|
2851
|
+
* 故统一加个0.001, 规避这些问题...
|
|
2852
|
+
*/
|
|
2853
|
+
h(k, "OPACITY_DELTA", 1e-3);
|
|
2854
|
+
class Ve extends mt {
|
|
2843
2855
|
isEditable() {
|
|
2844
2856
|
return this.innerOverlay.getEditable();
|
|
2845
2857
|
}
|
|
@@ -2862,25 +2874,25 @@ class He extends pt {
|
|
|
2862
2874
|
this.innerOverlay.setOptions({ fillOpacity: t });
|
|
2863
2875
|
}
|
|
2864
2876
|
}
|
|
2865
|
-
class
|
|
2877
|
+
class ft extends k {
|
|
2866
2878
|
constructor() {
|
|
2867
2879
|
super(...arguments);
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2880
|
+
h(this, "prevCenter");
|
|
2881
|
+
h(this, "prevRadius");
|
|
2882
|
+
h(this, "isDoingSetCenter", !1);
|
|
2883
|
+
h(this, "isDoingSetRadius", !1);
|
|
2884
|
+
h(this, "eventHubDelegate");
|
|
2885
|
+
h(this, "onRadiusChanged", () => {
|
|
2874
2886
|
var r;
|
|
2875
2887
|
const e = this.innerOverlay.getRadius();
|
|
2876
2888
|
this.prevRadius !== e && (this.isDoingSetRadius || (r = this.eventHubDelegate) == null || r.notify({ type: "radius-changed", target: this }), this.prevRadius = e);
|
|
2877
2889
|
});
|
|
2878
|
-
|
|
2890
|
+
h(this, "onCenterChanged", () => {
|
|
2879
2891
|
var r;
|
|
2880
2892
|
const e = this.innerOverlay.getCenter();
|
|
2881
2893
|
this.prevCenter !== e && (this.isDoingSetCenter || (r = this.eventHubDelegate) == null || r.notify({ type: "center-changed", target: this }), this.prevCenter = e);
|
|
2882
2894
|
});
|
|
2883
|
-
|
|
2895
|
+
h(this, "resetEditableTimeoutId");
|
|
2884
2896
|
}
|
|
2885
2897
|
static create(e) {
|
|
2886
2898
|
const r = this.coordType, s = new BMap.Circle(e.center.toBaidu(r), e.radius, {
|
|
@@ -2889,17 +2901,17 @@ class gt extends br {
|
|
|
2889
2901
|
enableEditing: !1,
|
|
2890
2902
|
// options.editable,
|
|
2891
2903
|
strokeColor: e.strokeColor,
|
|
2892
|
-
strokeOpacity: e.strokeOpacity,
|
|
2904
|
+
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity + k.OPACITY_DELTA : void 0,
|
|
2893
2905
|
strokeWeight: e.strokeWeight,
|
|
2894
2906
|
fillColor: e.fillColor,
|
|
2895
|
-
fillOpacity: e.fillOpacity
|
|
2896
|
-
}), n = new
|
|
2907
|
+
fillOpacity: e.fillOpacity != null ? e.fillOpacity + k.OPACITY_DELTA : void 0
|
|
2908
|
+
}), n = new ft(s, r, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
2897
2909
|
return n.state.editable && setTimeout(() => {
|
|
2898
2910
|
n.state.editable && s.enableEditing();
|
|
2899
2911
|
}, 0), n;
|
|
2900
2912
|
}
|
|
2901
2913
|
createDelegate() {
|
|
2902
|
-
return this.eventHubDelegate = new
|
|
2914
|
+
return this.eventHubDelegate = new He(super.createDelegate(), {
|
|
2903
2915
|
types: ["radius-changed", "center-changed"],
|
|
2904
2916
|
onListen: (e) => {
|
|
2905
2917
|
e === "radius-changed" ? (this.prevRadius = this.innerOverlay.getRadius(), this.innerOverlay.addEventListener("lineupdate", this.onRadiusChanged)) : (this.prevCenter = this.innerOverlay.getCenter(), this.innerOverlay.addEventListener("lineupdate", this.onCenterChanged));
|
|
@@ -2924,7 +2936,7 @@ class gt extends br {
|
|
|
2924
2936
|
return this.innerOverlay.getRadius();
|
|
2925
2937
|
}
|
|
2926
2938
|
}
|
|
2927
|
-
class
|
|
2939
|
+
class yt extends Ve {
|
|
2928
2940
|
static create(t) {
|
|
2929
2941
|
const e = this.coordType, r = new google.maps.Circle({
|
|
2930
2942
|
center: t.center.toGoogle(e),
|
|
@@ -2938,13 +2950,13 @@ class mt extends He {
|
|
|
2938
2950
|
fillOpacity: t.fillOpacity,
|
|
2939
2951
|
visible: t.visible
|
|
2940
2952
|
});
|
|
2941
|
-
return new
|
|
2953
|
+
return new yt(r, e, this);
|
|
2942
2954
|
}
|
|
2943
2955
|
setCenter(t) {
|
|
2944
2956
|
this.coordType = this.map.coordType, this.innerOverlay.setCenter(t.toGoogle(this.coordType));
|
|
2945
2957
|
}
|
|
2946
2958
|
getCenter() {
|
|
2947
|
-
return y.fromGoogle(this.innerOverlay.getCenter() ??
|
|
2959
|
+
return y.fromGoogle(this.innerOverlay.getCenter() ?? J.LATLNG_ZERO, this.coordType);
|
|
2948
2960
|
}
|
|
2949
2961
|
setRadius(t) {
|
|
2950
2962
|
this.innerOverlay.setRadius(t);
|
|
@@ -2956,39 +2968,39 @@ class mt extends He {
|
|
|
2956
2968
|
function Mr() {
|
|
2957
2969
|
BMap.OverlayV3 || (BMap.OverlayV3 = BMap.Overlay);
|
|
2958
2970
|
}
|
|
2959
|
-
const
|
|
2971
|
+
const Ht = {
|
|
2960
2972
|
/** {@link BMap.Point.equals} 无效, 故需要自己写一个 */
|
|
2961
2973
|
equals(i, t) {
|
|
2962
2974
|
return i.lat === t.lat && i.lng === t.lng;
|
|
2963
2975
|
}
|
|
2964
2976
|
};
|
|
2965
|
-
var
|
|
2977
|
+
var X;
|
|
2966
2978
|
((i) => {
|
|
2967
2979
|
i.ZERO = { x: 0, y: 0 };
|
|
2968
|
-
})(
|
|
2969
|
-
let
|
|
2970
|
-
function
|
|
2971
|
-
return
|
|
2980
|
+
})(X || (X = {}));
|
|
2981
|
+
let Ke;
|
|
2982
|
+
function Pi(i, t, e, r, s, n) {
|
|
2983
|
+
return Ke || (Ke = ki()), new Ke(i, t, e, r, s, n);
|
|
2972
2984
|
}
|
|
2973
|
-
function
|
|
2985
|
+
function ki() {
|
|
2974
2986
|
Mr();
|
|
2975
2987
|
const i = new BMap.Point(0, 0);
|
|
2976
2988
|
return class extends BMap.OverlayV3 {
|
|
2977
|
-
constructor(r, s = i, n =
|
|
2989
|
+
constructor(r, s = i, n = X.ZERO, a, d = 654, o = "") {
|
|
2978
2990
|
super();
|
|
2979
2991
|
// 类表达式不能有私有成员, 故改成public
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2992
|
+
h(this, "container");
|
|
2993
|
+
h(this, "border");
|
|
2994
|
+
h(this, "inner");
|
|
2995
|
+
h(this, "map");
|
|
2996
|
+
h(this, "marker");
|
|
2985
2997
|
this.content = r, this.position = s, this.offset = n;
|
|
2986
2998
|
const l = "baidu-info-box-container";
|
|
2987
2999
|
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";
|
|
2988
|
-
const
|
|
2989
|
-
|
|
3000
|
+
const c = document.createElement("img");
|
|
3001
|
+
c.className = l + "__close", c.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", c.addEventListener("click", () => {
|
|
2990
3002
|
this.close(), this.dispatchEvent({ type: "onclickclose" });
|
|
2991
|
-
}), this.inner.appendChild(r), this.border.appendChild(this.inner), this.border.appendChild(
|
|
3003
|
+
}), this.inner.appendChild(r), this.border.appendChild(this.inner), this.border.appendChild(c), this.container.appendChild(this.border), a && this.setZIndex(a), this.setMaxWidth(d), this.onMarkerPositionChanged = this.onMarkerPositionChanged.bind(this);
|
|
2992
3004
|
}
|
|
2993
3005
|
initialize(r) {
|
|
2994
3006
|
return this.map = r, r.getPanes().floatPane.appendChild(this.container), this.container;
|
|
@@ -3037,7 +3049,7 @@ function Pi() {
|
|
|
3037
3049
|
}
|
|
3038
3050
|
};
|
|
3039
3051
|
}
|
|
3040
|
-
class
|
|
3052
|
+
class vt {
|
|
3041
3053
|
constructor(t) {
|
|
3042
3054
|
this.delegate = t, this.delegate.setTarget(this);
|
|
3043
3055
|
}
|
|
@@ -3048,9 +3060,9 @@ class ft {
|
|
|
3048
3060
|
this.delegate.removeEventListener(t, e);
|
|
3049
3061
|
}
|
|
3050
3062
|
}
|
|
3051
|
-
class
|
|
3063
|
+
class _t extends vt {
|
|
3052
3064
|
constructor(t, e, r) {
|
|
3053
|
-
super(new
|
|
3065
|
+
super(new ae(t, e)), this.inner = t, this.map = e, this.state = r;
|
|
3054
3066
|
}
|
|
3055
3067
|
static create(t) {
|
|
3056
3068
|
const e = t.position || y.ZERO, r = new BMap.InfoWindow(t.content, {
|
|
@@ -3058,7 +3070,7 @@ class yt extends ft {
|
|
|
3058
3070
|
offset: t.offset && new BMap.Size(t.offset.x, t.offset.y),
|
|
3059
3071
|
enableAutoPan: !t.disableAutoPan
|
|
3060
3072
|
});
|
|
3061
|
-
return new
|
|
3073
|
+
return new _t(r, this, { position: e });
|
|
3062
3074
|
}
|
|
3063
3075
|
isOpen() {
|
|
3064
3076
|
return this.inner.isOpen();
|
|
@@ -3077,11 +3089,11 @@ class yt extends ft {
|
|
|
3077
3089
|
this.state.position = t, this.inner.isOpen() && this.open();
|
|
3078
3090
|
}
|
|
3079
3091
|
}
|
|
3080
|
-
class
|
|
3092
|
+
class bt extends vt {
|
|
3081
3093
|
constructor(e, r) {
|
|
3082
|
-
super(new
|
|
3083
|
-
|
|
3084
|
-
|
|
3094
|
+
super(new re(e, r));
|
|
3095
|
+
h(this, "eventHub", new ir());
|
|
3096
|
+
h(this, "isOpened", !1);
|
|
3085
3097
|
this.inner = e, this.map = r, e.addListener("closeclick", () => {
|
|
3086
3098
|
this.isOpened = !1, this.eventHub.hasListener("close") && this.eventHub.notify({ type: "close", target: this });
|
|
3087
3099
|
}), e.addListener("map_changed", () => {
|
|
@@ -3097,7 +3109,7 @@ class vt extends ft {
|
|
|
3097
3109
|
position: r.toGoogle(this.coordType),
|
|
3098
3110
|
disableAutoPan: e.disableAutoPan
|
|
3099
3111
|
});
|
|
3100
|
-
return new
|
|
3112
|
+
return new bt(s, this);
|
|
3101
3113
|
}
|
|
3102
3114
|
isOpen() {
|
|
3103
3115
|
return this.isOpened;
|
|
@@ -3129,19 +3141,19 @@ class vt extends ft {
|
|
|
3129
3141
|
this.isOpened && (this.isOpened = !1, this.inner.close(), this.eventHub.notify({ type: "close", target: this }));
|
|
3130
3142
|
}
|
|
3131
3143
|
getPosition() {
|
|
3132
|
-
return y.fromGoogle(this.inner.getPosition() ??
|
|
3144
|
+
return y.fromGoogle(this.inner.getPosition() ?? J.LATLNG_ZERO, this.map.coordType);
|
|
3133
3145
|
}
|
|
3134
3146
|
setPosition(e) {
|
|
3135
3147
|
this.inner.setPosition(e.toGoogle(this.map.coordType));
|
|
3136
3148
|
}
|
|
3137
3149
|
}
|
|
3138
|
-
class
|
|
3150
|
+
class Tt extends je {
|
|
3139
3151
|
constructor(t, e, r) {
|
|
3140
3152
|
super(t, e, r), this.baiduMap = r;
|
|
3141
3153
|
}
|
|
3142
3154
|
static create(t) {
|
|
3143
3155
|
var s;
|
|
3144
|
-
const e = this.coordType, r =
|
|
3156
|
+
const e = this.coordType, r = Pi(
|
|
3145
3157
|
t.content,
|
|
3146
3158
|
(s = t.position) == null ? void 0 : s.toBaidu(e),
|
|
3147
3159
|
t.offset,
|
|
@@ -3149,7 +3161,7 @@ class _t extends We {
|
|
|
3149
3161
|
t.maxWidth,
|
|
3150
3162
|
t.borderClass
|
|
3151
3163
|
);
|
|
3152
|
-
return new
|
|
3164
|
+
return new Tt(r, e, this);
|
|
3153
3165
|
}
|
|
3154
3166
|
open(t) {
|
|
3155
3167
|
this.innerOverlay.open(this.baiduMap.innerMap, t == null ? void 0 : t.innerOverlay);
|
|
@@ -3170,9 +3182,9 @@ class _t extends We {
|
|
|
3170
3182
|
this.innerOverlay.setZIndex(t);
|
|
3171
3183
|
}
|
|
3172
3184
|
}
|
|
3173
|
-
class
|
|
3185
|
+
class Mt extends vt {
|
|
3174
3186
|
constructor(t, e, r) {
|
|
3175
|
-
super(new
|
|
3187
|
+
super(new re(t, r)), this.inner = t, this.coordType = e, this.map = r;
|
|
3176
3188
|
}
|
|
3177
3189
|
static create(t) {
|
|
3178
3190
|
var n;
|
|
@@ -3184,10 +3196,10 @@ class bt extends ft {
|
|
|
3184
3196
|
maxWidth: t.maxWidth
|
|
3185
3197
|
}), s = t.borderClass;
|
|
3186
3198
|
return s && r.addListener("domready", () => {
|
|
3187
|
-
var
|
|
3188
|
-
const a = (
|
|
3199
|
+
var d;
|
|
3200
|
+
const a = (d = t.content.parentElement) == null ? void 0 : d.parentElement;
|
|
3189
3201
|
a && a.className.includes("gm-style-iw-c") && !a.className.includes(s) && (a.className += ` ${s}`);
|
|
3190
|
-
}), new
|
|
3202
|
+
}), new Mt(r, e, this);
|
|
3191
3203
|
}
|
|
3192
3204
|
open(t) {
|
|
3193
3205
|
this.inner.open(this.map.innerMap, t == null ? void 0 : t.innerOverlay);
|
|
@@ -3196,7 +3208,7 @@ class bt extends ft {
|
|
|
3196
3208
|
this.inner.close();
|
|
3197
3209
|
}
|
|
3198
3210
|
getPosition() {
|
|
3199
|
-
return y.fromGoogle(this.inner.getPosition() ??
|
|
3211
|
+
return y.fromGoogle(this.inner.getPosition() ?? J.LATLNG_ZERO, this.coordType);
|
|
3200
3212
|
}
|
|
3201
3213
|
setPosition(t) {
|
|
3202
3214
|
this.coordType = this.map.coordType, this.inner.setPosition(t.toGoogle(this.coordType));
|
|
@@ -3215,7 +3227,7 @@ class bt extends ft {
|
|
|
3215
3227
|
this.inner.setZIndex(t);
|
|
3216
3228
|
}
|
|
3217
3229
|
}
|
|
3218
|
-
var
|
|
3230
|
+
var Te;
|
|
3219
3231
|
((i) => {
|
|
3220
3232
|
function t(s, n) {
|
|
3221
3233
|
if (s !== void 0)
|
|
@@ -3229,18 +3241,18 @@ var be;
|
|
|
3229
3241
|
}
|
|
3230
3242
|
i.trimIndent = e;
|
|
3231
3243
|
function r(s) {
|
|
3232
|
-
return s.replace(/([^A-Z]?)([A-Z])/g, (n, a,
|
|
3244
|
+
return s.replace(/([^A-Z]?)([A-Z])/g, (n, a, d) => a ? `${a}-${d.toLowerCase()}` : d.toLowerCase());
|
|
3233
3245
|
}
|
|
3234
3246
|
i.pascal2kebab = r;
|
|
3235
|
-
})(
|
|
3236
|
-
const
|
|
3247
|
+
})(Te || (Te = {}));
|
|
3248
|
+
const Ii = {
|
|
3237
3249
|
/** @see https://nodejs.org/docs/v10.3.0/api/path.html#path_path_basename_path_ext */
|
|
3238
3250
|
basename(i, t) {
|
|
3239
3251
|
const e = i.endsWith("/") ? i.slice(0, -1) : i, r = e.lastIndexOf("/"), s = r >= 0 ? e.substring(r + 1) : e;
|
|
3240
3252
|
return t && s.endsWith(t) ? s.slice(0, -t.length) : s;
|
|
3241
3253
|
}
|
|
3242
3254
|
};
|
|
3243
|
-
var Me = /* @__PURE__ */ ((i) => (i.map = "map", i.overlay = "overlay", i.overlayMouseTarget = "overlayMouseTarget", i.float = "float", i))(Me || {}),
|
|
3255
|
+
var Me = /* @__PURE__ */ ((i) => (i.map = "map", i.overlay = "overlay", i.overlayMouseTarget = "overlayMouseTarget", i.float = "float", i))(Me || {}), Oe;
|
|
3244
3256
|
((i) => {
|
|
3245
3257
|
function t(r, s) {
|
|
3246
3258
|
switch (r) {
|
|
@@ -3253,7 +3265,7 @@ var Me = /* @__PURE__ */ ((i) => (i.map = "map", i.overlay = "overlay", i.overla
|
|
|
3253
3265
|
case "map":
|
|
3254
3266
|
return s.mapPane;
|
|
3255
3267
|
default:
|
|
3256
|
-
|
|
3268
|
+
Qe(r);
|
|
3257
3269
|
}
|
|
3258
3270
|
}
|
|
3259
3271
|
i.toGoogle = t;
|
|
@@ -3268,18 +3280,18 @@ var Me = /* @__PURE__ */ ((i) => (i.map = "map", i.overlay = "overlay", i.overla
|
|
|
3268
3280
|
case "map":
|
|
3269
3281
|
return s.mapPane;
|
|
3270
3282
|
default:
|
|
3271
|
-
|
|
3283
|
+
Qe(r);
|
|
3272
3284
|
}
|
|
3273
3285
|
}
|
|
3274
3286
|
i.toBaidu = e;
|
|
3275
|
-
})(
|
|
3287
|
+
})(Oe || (Oe = {}));
|
|
3276
3288
|
class Bi {
|
|
3277
3289
|
constructor(t, e) {
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3290
|
+
h(this, "baidu");
|
|
3291
|
+
h(this, "google");
|
|
3292
|
+
h(this, "projection");
|
|
3293
|
+
h(this, "element", void 0);
|
|
3294
|
+
h(this, "mapPane");
|
|
3283
3295
|
this.map = t, this.mapPane = e.mapPane;
|
|
3284
3296
|
}
|
|
3285
3297
|
create() {
|
|
@@ -3298,8 +3310,8 @@ class Bi {
|
|
|
3298
3310
|
class e extends BMap.OverlayV3 {
|
|
3299
3311
|
initialize(n) {
|
|
3300
3312
|
var o;
|
|
3301
|
-
const a = t.create(),
|
|
3302
|
-
return (o =
|
|
3313
|
+
const a = t.create(), d = n.getPanes();
|
|
3314
|
+
return (o = Oe.toBaidu(t.mapPane, d)) == null || o.appendChild(a), a;
|
|
3303
3315
|
}
|
|
3304
3316
|
draw() {
|
|
3305
3317
|
t.draw();
|
|
@@ -3324,7 +3336,7 @@ class Bi {
|
|
|
3324
3336
|
class e extends google.maps.OverlayView {
|
|
3325
3337
|
onAdd() {
|
|
3326
3338
|
const s = t.create(), n = this.getPanes() ?? C("onAdd回调中一定会有panes");
|
|
3327
|
-
|
|
3339
|
+
Oe.toGoogle(t.mapPane, n).appendChild(s);
|
|
3328
3340
|
}
|
|
3329
3341
|
draw() {
|
|
3330
3342
|
t.draw();
|
|
@@ -3336,25 +3348,25 @@ class Bi {
|
|
|
3336
3348
|
}
|
|
3337
3349
|
this.google = new e(), this.projection = {
|
|
3338
3350
|
fromLatLngToOverlayPoint(r) {
|
|
3339
|
-
return t.google.getProjection().fromLatLngToDivPixel(r.toGoogle(t.map.coordType)) ??
|
|
3351
|
+
return t.google.getProjection().fromLatLngToDivPixel(r.toGoogle(t.map.coordType)) ?? X.ZERO;
|
|
3340
3352
|
},
|
|
3341
3353
|
fromOverlayPointToLatLng(r) {
|
|
3342
|
-
return y.fromGoogle(t.google.getProjection().fromDivPixelToLatLng(new google.maps.Point(r.x, r.y)) ??
|
|
3354
|
+
return y.fromGoogle(t.google.getProjection().fromDivPixelToLatLng(new google.maps.Point(r.x, r.y)) ?? J.LATLNG_ZERO, t.map.coordType);
|
|
3343
3355
|
}
|
|
3344
3356
|
};
|
|
3345
3357
|
}
|
|
3346
3358
|
return this.google;
|
|
3347
3359
|
}
|
|
3348
3360
|
}
|
|
3349
|
-
let
|
|
3361
|
+
let Xe;
|
|
3350
3362
|
function Si(i, t, e, r, s) {
|
|
3351
|
-
return
|
|
3363
|
+
return Xe || (Xe = Ai()), new Xe(i, t, e, r, s);
|
|
3352
3364
|
}
|
|
3353
|
-
function
|
|
3365
|
+
function Ai() {
|
|
3354
3366
|
return class extends google.maps.OverlayView {
|
|
3355
3367
|
constructor(e, r, s, n = Me.overlayMouseTarget, a) {
|
|
3356
3368
|
super();
|
|
3357
|
-
|
|
3369
|
+
h(this, "container");
|
|
3358
3370
|
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", () => {
|
|
3359
3371
|
google.maps.event.trigger(this, "click");
|
|
3360
3372
|
}), this.setElement(e);
|
|
@@ -3368,7 +3380,7 @@ function Ii() {
|
|
|
3368
3380
|
}
|
|
3369
3381
|
onAdd() {
|
|
3370
3382
|
const e = this.getPanes() ?? C("onAdd回调中一定能够获取panes");
|
|
3371
|
-
|
|
3383
|
+
Oe.toGoogle(this._mapPane, e).appendChild(this.container);
|
|
3372
3384
|
}
|
|
3373
3385
|
draw() {
|
|
3374
3386
|
var e, r;
|
|
@@ -3404,7 +3416,7 @@ function Ii() {
|
|
|
3404
3416
|
}
|
|
3405
3417
|
};
|
|
3406
3418
|
}
|
|
3407
|
-
var
|
|
3419
|
+
var de;
|
|
3408
3420
|
((i) => {
|
|
3409
3421
|
function t(r) {
|
|
3410
3422
|
return typeof r == "string" ? r : r.outerHTML;
|
|
@@ -3418,19 +3430,19 @@ var ce;
|
|
|
3418
3430
|
return r;
|
|
3419
3431
|
}
|
|
3420
3432
|
i.toElement = e;
|
|
3421
|
-
})(
|
|
3422
|
-
class
|
|
3433
|
+
})(de || (de = {}));
|
|
3434
|
+
class Ot extends je {
|
|
3423
3435
|
constructor(e, r, s, n) {
|
|
3424
3436
|
super(e, r, s);
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3437
|
+
h(this, "icon");
|
|
3438
|
+
h(this, "iconAnchor");
|
|
3439
|
+
h(this, "content", void 0);
|
|
3440
|
+
h(this, "contentObserver");
|
|
3429
3441
|
this.setContentInternal(n, !0);
|
|
3430
3442
|
}
|
|
3431
3443
|
static create(e) {
|
|
3432
3444
|
var a;
|
|
3433
|
-
const r = this.coordType, s = new BMap.Label(
|
|
3445
|
+
const r = this.coordType, s = new BMap.Label(de.toString(e.content), {
|
|
3434
3446
|
position: (a = e.position) == null ? void 0 : a.toBaidu(r),
|
|
3435
3447
|
offset: e.offset && new BMap.Size(e.offset.x, e.offset.y)
|
|
3436
3448
|
});
|
|
@@ -3439,7 +3451,7 @@ class Mt extends We {
|
|
|
3439
3451
|
padding: "0px",
|
|
3440
3452
|
backgroundColor: "unset"
|
|
3441
3453
|
});
|
|
3442
|
-
const n = new
|
|
3454
|
+
const n = new Ot(s, r, this, e.content);
|
|
3443
3455
|
return s.__label__ = n, n;
|
|
3444
3456
|
}
|
|
3445
3457
|
setContentInternal(e, r = !1) {
|
|
@@ -3450,7 +3462,7 @@ class Mt extends We {
|
|
|
3450
3462
|
characterData: !0,
|
|
3451
3463
|
childList: !0,
|
|
3452
3464
|
subtree: !0
|
|
3453
|
-
})), r || this.innerOverlay.setContent(
|
|
3465
|
+
})), r || this.innerOverlay.setContent(de.toString(e)), this.content = e);
|
|
3454
3466
|
}
|
|
3455
3467
|
setZIndex(e) {
|
|
3456
3468
|
this.innerOverlay.setZIndex(e);
|
|
@@ -3478,7 +3490,7 @@ class Mt extends We {
|
|
|
3478
3490
|
* @description baidu中Label默认左上角对齐Icon的左上, 我们要将其转换为对齐marker的position
|
|
3479
3491
|
* */
|
|
3480
3492
|
attachIcon(e) {
|
|
3481
|
-
var
|
|
3493
|
+
var d;
|
|
3482
3494
|
let r;
|
|
3483
3495
|
if (e instanceof BMap.Icon)
|
|
3484
3496
|
r = e.anchor;
|
|
@@ -3486,18 +3498,18 @@ class Mt extends We {
|
|
|
3486
3498
|
if (e.anchor)
|
|
3487
3499
|
r = e.anchor;
|
|
3488
3500
|
else {
|
|
3489
|
-
const o = ((
|
|
3501
|
+
const o = ((d = e.__icon__) == null ? void 0 : d.baiduLabelOffset) ?? { x: 0, y: 0 };
|
|
3490
3502
|
r = {
|
|
3491
3503
|
width: e.style.anchor.width + o.x,
|
|
3492
3504
|
height: e.style.anchor.height + o.y
|
|
3493
3505
|
}, process.env.NODE_ENV !== "production" && setTimeout(() => {
|
|
3494
3506
|
var u, p;
|
|
3495
|
-
if (
|
|
3507
|
+
if (oe(e.__icon__, `${e}必须是由'SymbolIcon.toBaidu()'创建的`), !e.anchor) {
|
|
3496
3508
|
console.log("BaiduLabelOverlay.attachIcon", "Bmap.Symbol.anchor尚未计算完成");
|
|
3497
3509
|
return;
|
|
3498
3510
|
}
|
|
3499
|
-
const l = e.anchor.width - e.style.anchor.width,
|
|
3500
|
-
if (o.x !== l || o.y !==
|
|
3511
|
+
const l = e.anchor.width - e.style.anchor.width, c = e.anchor.height - e.style.anchor.height;
|
|
3512
|
+
if (o.x !== l || o.y !== c) {
|
|
3501
3513
|
const b = [
|
|
3502
3514
|
(u = e.__icon__.anchor) == null ? void 0 : u.x,
|
|
3503
3515
|
(p = e.__icon__.anchor) == null ? void 0 : p.y,
|
|
@@ -3505,10 +3517,10 @@ class Mt extends We {
|
|
|
3505
3517
|
e.__icon__.scale,
|
|
3506
3518
|
e.__icon__.strokeWeight
|
|
3507
3519
|
].map((_) => _ ?? "").join(",");
|
|
3508
|
-
console.warn("BaiduLabelOverlay.attachIcon", e.__icon__,
|
|
3520
|
+
console.warn("BaiduLabelOverlay.attachIcon", e.__icon__, Te.trimIndent(
|
|
3509
3521
|
`
|
|
3510
3522
|
为了保证Label的位置正确, 请将SymbolIcon(${b})中baiduLabelOffset的值改写成:
|
|
3511
|
-
${JSON.stringify({ x: l, y:
|
|
3523
|
+
${JSON.stringify({ x: l, y: c })}
|
|
3512
3524
|
`
|
|
3513
3525
|
));
|
|
3514
3526
|
}
|
|
@@ -3519,23 +3531,23 @@ class Mt extends We {
|
|
|
3519
3531
|
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;
|
|
3520
3532
|
}
|
|
3521
3533
|
}
|
|
3522
|
-
class
|
|
3534
|
+
class Ct extends mt {
|
|
3523
3535
|
static create(t) {
|
|
3524
3536
|
var s;
|
|
3525
3537
|
const e = this.coordType, r = Si(
|
|
3526
|
-
|
|
3538
|
+
de.toElement(t.content),
|
|
3527
3539
|
(s = t.position) == null ? void 0 : s.toGoogle(e),
|
|
3528
3540
|
t.offset,
|
|
3529
3541
|
t.mapPane,
|
|
3530
3542
|
t.zIndex
|
|
3531
3543
|
);
|
|
3532
|
-
return new
|
|
3544
|
+
return new Ct(r, e, this);
|
|
3533
3545
|
}
|
|
3534
3546
|
setZIndex(t) {
|
|
3535
3547
|
this.innerOverlay.setZIndex(t);
|
|
3536
3548
|
}
|
|
3537
3549
|
setContent(t) {
|
|
3538
|
-
this.innerOverlay.setElement(
|
|
3550
|
+
this.innerOverlay.setElement(de.toElement(t));
|
|
3539
3551
|
}
|
|
3540
3552
|
getPosition() {
|
|
3541
3553
|
const t = this.innerOverlay.getPosition();
|
|
@@ -3545,17 +3557,17 @@ class Tt extends pt {
|
|
|
3545
3557
|
this.coordType = this.map.coordType, this.innerOverlay.setPosition(t.toGoogle(this.coordType));
|
|
3546
3558
|
}
|
|
3547
3559
|
getOffset() {
|
|
3548
|
-
return this.innerOverlay.getOffset() ??
|
|
3560
|
+
return this.innerOverlay.getOffset() ?? X.ZERO;
|
|
3549
3561
|
}
|
|
3550
3562
|
setOffset(t) {
|
|
3551
3563
|
this.innerOverlay.setOffset(t);
|
|
3552
3564
|
}
|
|
3553
3565
|
}
|
|
3554
|
-
const
|
|
3555
|
-
toGoogle: (i) => "url" in i ?
|
|
3556
|
-
toBaidu: (i) => "url" in i ?
|
|
3566
|
+
const $e = {
|
|
3567
|
+
toGoogle: (i) => "url" in i ? De.toGoogle(i) : ze.toGoogle(i),
|
|
3568
|
+
toBaidu: (i) => "url" in i ? De.toBaidu(i) : ze.toBaidu(i)
|
|
3557
3569
|
};
|
|
3558
|
-
var
|
|
3570
|
+
var De;
|
|
3559
3571
|
((i) => {
|
|
3560
3572
|
function t(r) {
|
|
3561
3573
|
return {
|
|
@@ -3579,8 +3591,8 @@ var $e;
|
|
|
3579
3591
|
});
|
|
3580
3592
|
}
|
|
3581
3593
|
i.toBaidu = e;
|
|
3582
|
-
})(
|
|
3583
|
-
var
|
|
3594
|
+
})(De || (De = {}));
|
|
3595
|
+
var ze;
|
|
3584
3596
|
((i) => {
|
|
3585
3597
|
function t(r) {
|
|
3586
3598
|
return {
|
|
@@ -3611,22 +3623,22 @@ var De;
|
|
|
3611
3623
|
return s.__icon__ = r, s;
|
|
3612
3624
|
}
|
|
3613
3625
|
i.toBaidu = e;
|
|
3614
|
-
})(
|
|
3615
|
-
const
|
|
3626
|
+
})(ze || (ze = {}));
|
|
3627
|
+
const Hs = {
|
|
3616
3628
|
CIRCLE: { baidu: () => BMap_Symbol_SHAPE_CIRCLE, google: () => google.maps.SymbolPath.CIRCLE },
|
|
3617
3629
|
BACKWARD_CLOSED_ARROW: { baidu: () => BMap_Symbol_SHAPE_BACKWARD_CLOSED_ARROW, google: () => google.maps.SymbolPath.BACKWARD_CLOSED_ARROW },
|
|
3618
3630
|
BACKWARD_OPEN_ARROW: { baidu: () => BMap_Symbol_SHAPE_BACKWARD_OPEN_ARROW, google: () => google.maps.SymbolPath.BACKWARD_OPEN_ARROW },
|
|
3619
3631
|
FORWARD_CLOSED_ARROW: { baidu: () => BMap_Symbol_SHAPE_FORWARD_CLOSED_ARROW, google: () => google.maps.SymbolPath.FORWARD_CLOSED_ARROW },
|
|
3620
3632
|
FORWARD_OPEN_ARROW: { baidu: () => BMap_Symbol_SHAPE_FORWARD_OPEN_ARROW, google: () => google.maps.SymbolPath.FORWARD_OPEN_ARROW }
|
|
3621
3633
|
};
|
|
3622
|
-
class
|
|
3634
|
+
class Ce extends je {
|
|
3623
3635
|
constructor(t, e, r, s) {
|
|
3624
3636
|
super(t, e, r), this.state = s;
|
|
3625
3637
|
}
|
|
3626
3638
|
static create(t) {
|
|
3627
3639
|
const e = this.coordType, r = t.icon, s = {
|
|
3628
3640
|
title: t.title,
|
|
3629
|
-
icon: r &&
|
|
3641
|
+
icon: r && $e.toBaidu(r),
|
|
3630
3642
|
enableClicking: t.clickable,
|
|
3631
3643
|
enableDragging: t.draggable,
|
|
3632
3644
|
// baidu的raiseOnDrag属性, 默认为false, 而我们的options.crossOnDrag默认为true, 故这里需要转换下
|
|
@@ -3634,8 +3646,8 @@ class Oe extends We {
|
|
|
3634
3646
|
draggingCursor: t.cursor
|
|
3635
3647
|
}, n = new BMap.Marker(t.position.toBaidu(e), s);
|
|
3636
3648
|
t.zIndex !== void 0 && n.setZIndex(t.zIndex);
|
|
3637
|
-
const a = t.clickable === void 0 ? !0 : t.clickable,
|
|
3638
|
-
return new
|
|
3649
|
+
const a = t.clickable === void 0 ? !0 : t.clickable, d = !!t.draggable;
|
|
3650
|
+
return new Ce(n, e, this, { clickable: a, draggable: d, zIndex: t.zIndex }).visibleOptionInternal(t.visible);
|
|
3639
3651
|
}
|
|
3640
3652
|
getPosition() {
|
|
3641
3653
|
return y.fromBaidu(this.innerOverlay.getPosition(), this.coordType);
|
|
@@ -3651,7 +3663,7 @@ class Oe extends We {
|
|
|
3651
3663
|
return this.innerOverlay.getTitle();
|
|
3652
3664
|
}
|
|
3653
3665
|
setIcon(t) {
|
|
3654
|
-
const e =
|
|
3666
|
+
const e = $e.toBaidu(t);
|
|
3655
3667
|
this.innerOverlay.setIcon(e);
|
|
3656
3668
|
const r = this.getLabel();
|
|
3657
3669
|
r && r.attachIcon(e);
|
|
@@ -3686,13 +3698,13 @@ class Oe extends We {
|
|
|
3686
3698
|
return (t = this.innerOverlay.getLabel()) == null ? void 0 : t.__label__;
|
|
3687
3699
|
}
|
|
3688
3700
|
}
|
|
3689
|
-
class
|
|
3701
|
+
class wt extends mt {
|
|
3690
3702
|
constructor() {
|
|
3691
3703
|
super(...arguments);
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3704
|
+
h(this, "label");
|
|
3705
|
+
h(this, "labelPositionListener");
|
|
3706
|
+
h(this, "labelVisibleListener");
|
|
3707
|
+
h(this, "labelMapChangedListener");
|
|
3696
3708
|
}
|
|
3697
3709
|
static create(e) {
|
|
3698
3710
|
const r = this.coordType, s = e.icon, n = {
|
|
@@ -3700,7 +3712,7 @@ class Ot extends pt {
|
|
|
3700
3712
|
title: e.title,
|
|
3701
3713
|
zIndex: e.zIndex,
|
|
3702
3714
|
visible: e.visible,
|
|
3703
|
-
icon: s &&
|
|
3715
|
+
icon: s && $e.toGoogle(s),
|
|
3704
3716
|
clickable: e.clickable,
|
|
3705
3717
|
draggable: e.draggable,
|
|
3706
3718
|
// google的crossOnDrag和我们的crossOnDrag是匹配的, 不需要转换
|
|
@@ -3709,7 +3721,7 @@ class Ot extends pt {
|
|
|
3709
3721
|
// InfoWindow相对marker的position的偏移量, 若不指定, 则偏移到marker的icon的上部中央
|
|
3710
3722
|
anchorPoint: new google.maps.Point(0, 0)
|
|
3711
3723
|
};
|
|
3712
|
-
return new
|
|
3724
|
+
return new wt(new google.maps.Marker(n), r, this);
|
|
3713
3725
|
}
|
|
3714
3726
|
getPosition() {
|
|
3715
3727
|
return y.fromGoogle(this.innerOverlay.getPosition(), this.coordType);
|
|
@@ -3724,7 +3736,7 @@ class Ot extends pt {
|
|
|
3724
3736
|
return this.innerOverlay.getTitle() || "";
|
|
3725
3737
|
}
|
|
3726
3738
|
setIcon(e) {
|
|
3727
|
-
this.innerOverlay.setIcon(
|
|
3739
|
+
this.innerOverlay.setIcon($e.toGoogle(e));
|
|
3728
3740
|
}
|
|
3729
3741
|
getIcon() {
|
|
3730
3742
|
return this.innerOverlay.getIcon();
|
|
@@ -3762,13 +3774,13 @@ class Ot extends pt {
|
|
|
3762
3774
|
this.label = void 0, this.labelPositionListener = void 0, this.labelVisibleListener = void 0, this.labelMapChangedListener = void 0;
|
|
3763
3775
|
}
|
|
3764
3776
|
}
|
|
3765
|
-
class
|
|
3777
|
+
class Et extends k {
|
|
3766
3778
|
constructor() {
|
|
3767
3779
|
super(...arguments);
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3780
|
+
h(this, "eventHubDelegate");
|
|
3781
|
+
h(this, "prevPath");
|
|
3782
|
+
h(this, "isDoingSetPath", !1);
|
|
3783
|
+
h(this, "onLineUpdate", () => {
|
|
3772
3784
|
var r;
|
|
3773
3785
|
const e = this.innerOverlay.getPath();
|
|
3774
3786
|
e !== this.prevPath && (this.isDoingSetPath || (r = this.eventHubDelegate) == null || r.notify({
|
|
@@ -3787,7 +3799,7 @@ class Ct extends br {
|
|
|
3787
3799
|
this.isDoingSetPath = !0, this.innerOverlay.setPath(e), this.isDoingSetPath = !1;
|
|
3788
3800
|
}
|
|
3789
3801
|
createDelegate() {
|
|
3790
|
-
return this.eventHubDelegate = new
|
|
3802
|
+
return this.eventHubDelegate = new He(super.createDelegate(), {
|
|
3791
3803
|
types: [this.pathEditedEventType],
|
|
3792
3804
|
onListen: () => {
|
|
3793
3805
|
this.prevPath = this.innerOverlay.getPath(), this.innerOverlay.addEventListener("lineupdate", this.onLineUpdate);
|
|
@@ -3798,20 +3810,20 @@ class Ct extends br {
|
|
|
3798
3810
|
});
|
|
3799
3811
|
}
|
|
3800
3812
|
}
|
|
3801
|
-
class
|
|
3813
|
+
class Lt extends Et {
|
|
3802
3814
|
constructor() {
|
|
3803
3815
|
super(...arguments);
|
|
3804
|
-
|
|
3816
|
+
h(this, "pathEditedEventType", "path-edited");
|
|
3805
3817
|
}
|
|
3806
3818
|
static create(e) {
|
|
3807
3819
|
const r = this.coordType, s = new BMap.Polyline(e.path.map((n) => n.toBaidu(r)), {
|
|
3808
3820
|
enableClicking: e.clickable,
|
|
3809
3821
|
enableEditing: e.editable,
|
|
3810
3822
|
strokeColor: e.strokeColor,
|
|
3811
|
-
strokeOpacity: e.strokeOpacity,
|
|
3823
|
+
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity + k.OPACITY_DELTA : void 0,
|
|
3812
3824
|
strokeWeight: e.strokeWeight
|
|
3813
3825
|
});
|
|
3814
|
-
return new
|
|
3826
|
+
return new Lt(s, r, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
3815
3827
|
}
|
|
3816
3828
|
getPath() {
|
|
3817
3829
|
return this.innerOverlay.getPath().map((e) => y.fromBaidu(e, this.coordType));
|
|
@@ -3820,11 +3832,11 @@ class wt extends Ct {
|
|
|
3820
3832
|
this.coordType = this.map.coordType, this.setPathInternal(e.map((r) => r.toBaidu(this.coordType)));
|
|
3821
3833
|
}
|
|
3822
3834
|
}
|
|
3823
|
-
class
|
|
3835
|
+
class xt extends Ve {
|
|
3824
3836
|
constructor() {
|
|
3825
3837
|
super(...arguments);
|
|
3826
|
-
|
|
3827
|
-
|
|
3838
|
+
h(this, "pathChangedListeners");
|
|
3839
|
+
h(this, "eventHubDelegate");
|
|
3828
3840
|
}
|
|
3829
3841
|
static create(e) {
|
|
3830
3842
|
const r = this.coordType, s = new google.maps.Polyline({
|
|
@@ -3836,21 +3848,21 @@ class Et extends He {
|
|
|
3836
3848
|
strokeWeight: e.strokeWeight,
|
|
3837
3849
|
visible: e.visible
|
|
3838
3850
|
});
|
|
3839
|
-
return new
|
|
3851
|
+
return new xt(s, r, this);
|
|
3840
3852
|
}
|
|
3841
3853
|
setupPathChangedListeners() {
|
|
3842
3854
|
const e = () => {
|
|
3843
3855
|
var s;
|
|
3844
3856
|
return (s = this.eventHubDelegate) == null ? void 0 : s.notify({ type: "path-edited", target: this });
|
|
3845
3857
|
}, r = this.innerOverlay.getPath();
|
|
3846
|
-
this.pathChangedListeners =
|
|
3858
|
+
this.pathChangedListeners = ce.listenChanged(r, e);
|
|
3847
3859
|
}
|
|
3848
3860
|
clearPathChangedListeners() {
|
|
3849
3861
|
var e;
|
|
3850
3862
|
(e = this.pathChangedListeners) == null || e.forEach((r) => r.remove()), this.pathChangedListeners = void 0;
|
|
3851
3863
|
}
|
|
3852
3864
|
createDelegate() {
|
|
3853
|
-
return this.eventHubDelegate = new
|
|
3865
|
+
return this.eventHubDelegate = new He(super.createDelegate(), {
|
|
3854
3866
|
types: ["path-edited"],
|
|
3855
3867
|
onListen: () => this.setupPathChangedListeners(),
|
|
3856
3868
|
onCancel: () => this.clearPathChangedListeners()
|
|
@@ -3867,10 +3879,10 @@ class Et extends He {
|
|
|
3867
3879
|
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();
|
|
3868
3880
|
}
|
|
3869
3881
|
}
|
|
3870
|
-
class
|
|
3882
|
+
class Pt extends Et {
|
|
3871
3883
|
constructor() {
|
|
3872
3884
|
super(...arguments);
|
|
3873
|
-
|
|
3885
|
+
h(this, "pathEditedEventType", "paths-edited");
|
|
3874
3886
|
}
|
|
3875
3887
|
static create(e) {
|
|
3876
3888
|
const r = this.coordType;
|
|
@@ -3879,12 +3891,12 @@ class Lt extends Ct {
|
|
|
3879
3891
|
enableClicking: e.clickable,
|
|
3880
3892
|
enableEditing: e.editable,
|
|
3881
3893
|
strokeColor: e.strokeColor,
|
|
3882
|
-
strokeOpacity: e.strokeOpacity,
|
|
3894
|
+
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity + k.OPACITY_DELTA : void 0,
|
|
3883
3895
|
strokeWeight: e.strokeWeight,
|
|
3884
3896
|
fillColor: e.fillColor,
|
|
3885
|
-
fillOpacity: e.fillOpacity
|
|
3897
|
+
fillOpacity: e.fillOpacity != null ? e.fillOpacity + k.OPACITY_DELTA : void 0
|
|
3886
3898
|
});
|
|
3887
|
-
return new
|
|
3899
|
+
return new Pt(n, r, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
3888
3900
|
}
|
|
3889
3901
|
getPaths() {
|
|
3890
3902
|
return [this.innerOverlay.getPath().map((e) => y.fromBaidu(e, this.coordType))];
|
|
@@ -3893,11 +3905,11 @@ class Lt extends Ct {
|
|
|
3893
3905
|
e.length > 1 && console.warn("baidu不支持多path, 只会显示paths[0]"), this.coordType = this.map.coordType, this.setPathInternal((e[0] || []).map((r) => r.toBaidu(this.coordType)));
|
|
3894
3906
|
}
|
|
3895
3907
|
}
|
|
3896
|
-
class
|
|
3908
|
+
class kt extends Ve {
|
|
3897
3909
|
constructor() {
|
|
3898
3910
|
super(...arguments);
|
|
3899
|
-
|
|
3900
|
-
|
|
3911
|
+
h(this, "pathChangedListeners");
|
|
3912
|
+
h(this, "eventHubDelegate");
|
|
3901
3913
|
}
|
|
3902
3914
|
static create(e) {
|
|
3903
3915
|
const r = this.coordType, s = new google.maps.Polygon({
|
|
@@ -3911,7 +3923,7 @@ class xt extends He {
|
|
|
3911
3923
|
fillOpacity: e.fillOpacity,
|
|
3912
3924
|
visible: e.visible
|
|
3913
3925
|
});
|
|
3914
|
-
return new
|
|
3926
|
+
return new kt(s, r, this);
|
|
3915
3927
|
}
|
|
3916
3928
|
setupPathChangedListeners() {
|
|
3917
3929
|
const e = () => {
|
|
@@ -3919,7 +3931,7 @@ class xt extends He {
|
|
|
3919
3931
|
return (s = this.eventHubDelegate) == null ? void 0 : s.notify({ type: "paths-edited", target: this });
|
|
3920
3932
|
}, r = this.innerOverlay.getPaths();
|
|
3921
3933
|
this.pathChangedListeners = [], r.forEach((s) => {
|
|
3922
|
-
this.pathChangedListeners.push(...
|
|
3934
|
+
this.pathChangedListeners.push(...ce.listenChanged(s, e));
|
|
3923
3935
|
});
|
|
3924
3936
|
}
|
|
3925
3937
|
clearPathChangedListeners() {
|
|
@@ -3927,7 +3939,7 @@ class xt extends He {
|
|
|
3927
3939
|
(e = this.pathChangedListeners) == null || e.forEach((r) => r.remove()), this.pathChangedListeners = void 0;
|
|
3928
3940
|
}
|
|
3929
3941
|
createDelegate() {
|
|
3930
|
-
return this.eventHubDelegate = new
|
|
3942
|
+
return this.eventHubDelegate = new He(super.createDelegate(), {
|
|
3931
3943
|
types: ["paths-edited"],
|
|
3932
3944
|
onListen: () => this.setupPathChangedListeners(),
|
|
3933
3945
|
onCancel: () => this.clearPathChangedListeners()
|
|
@@ -3947,12 +3959,12 @@ class xt extends He {
|
|
|
3947
3959
|
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();
|
|
3948
3960
|
}
|
|
3949
3961
|
}
|
|
3950
|
-
class
|
|
3962
|
+
class It extends Et {
|
|
3951
3963
|
constructor(e, r, s, n) {
|
|
3952
3964
|
super(e, r, s, n);
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3965
|
+
h(this, "pathEditedEventType", "bounds-changed");
|
|
3966
|
+
h(this, "isDoingUpdateRectangle", !1);
|
|
3967
|
+
h(this, "onBoundsChanged", ({ originalEvent: e }) => {
|
|
3956
3968
|
if (this.isDoingUpdateRectangle)
|
|
3957
3969
|
return;
|
|
3958
3970
|
const r = e.prevPath ?? [], s = e.path;
|
|
@@ -3962,15 +3974,15 @@ class Pt extends Ct {
|
|
|
3962
3974
|
if (r.length === 4)
|
|
3963
3975
|
if (a > r.length) {
|
|
3964
3976
|
for (let o = 0; o < a; o++)
|
|
3965
|
-
if (r[o] == null || !
|
|
3966
|
-
const l = s[(o - 2 + a) % a],
|
|
3977
|
+
if (r[o] == null || !Ht.equals(s[o], r[o])) {
|
|
3978
|
+
const l = s[(o - 2 + a) % a], c = s[(o - 1 + a) % a], u = s[o], p = s[(o + 1) % a], b = s[(o + 2) % a];
|
|
3967
3979
|
let _;
|
|
3968
|
-
|
|
3980
|
+
c.lat === p.lat ? _ = new BMap.Point(c.lng, u.lat) : c.lng === p.lng ? _ = new BMap.Point(u.lng, c.lat) : _ = u, n = [l, b, _];
|
|
3969
3981
|
break;
|
|
3970
3982
|
}
|
|
3971
3983
|
} else if (a === r.length) {
|
|
3972
3984
|
for (let o = 0; o < a; o++)
|
|
3973
|
-
if (!
|
|
3985
|
+
if (!Ht.equals(s[o], r[o])) {
|
|
3974
3986
|
n = [
|
|
3975
3987
|
s[o],
|
|
3976
3988
|
s[(o + 2) % 4]
|
|
@@ -3979,8 +3991,8 @@ class Pt extends Ct {
|
|
|
3979
3991
|
}
|
|
3980
3992
|
} else
|
|
3981
3993
|
a < r.length;
|
|
3982
|
-
const
|
|
3983
|
-
|
|
3994
|
+
const d = A.fromArray(n.map((o) => y.fromBaidu(o, this.coordType)));
|
|
3995
|
+
d && (this.isDoingUpdateRectangle = !0, this.innerOverlay.setPath(d.toRectArray().map((o) => o.toBaidu(this.coordType))), this.isDoingUpdateRectangle = !1);
|
|
3984
3996
|
}, 0);
|
|
3985
3997
|
});
|
|
3986
3998
|
this.addEventListener("bounds-changed", this.onBoundsChanged);
|
|
@@ -3990,15 +4002,15 @@ class Pt extends Ct {
|
|
|
3990
4002
|
enableClicking: e.clickable,
|
|
3991
4003
|
enableEditing: e.editable,
|
|
3992
4004
|
strokeColor: e.strokeColor,
|
|
3993
|
-
strokeOpacity: e.strokeOpacity,
|
|
4005
|
+
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity + k.OPACITY_DELTA : void 0,
|
|
3994
4006
|
strokeWeight: e.strokeWeight,
|
|
3995
4007
|
fillColor: e.fillColor,
|
|
3996
|
-
fillOpacity: e.fillOpacity
|
|
4008
|
+
fillOpacity: e.fillOpacity != null ? e.fillOpacity + k.OPACITY_DELTA : void 0
|
|
3997
4009
|
});
|
|
3998
|
-
return new
|
|
4010
|
+
return new It(s, r, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
3999
4011
|
}
|
|
4000
4012
|
getBounds() {
|
|
4001
|
-
return
|
|
4013
|
+
return A.fromBaidu(this.innerOverlay.getBounds(), this.coordType);
|
|
4002
4014
|
}
|
|
4003
4015
|
setBounds(e) {
|
|
4004
4016
|
const r = e.toRectArray();
|
|
@@ -4007,7 +4019,7 @@ class Pt extends Ct {
|
|
|
4007
4019
|
}) : this.setPathInternal(r.map((s) => s.toBaidu(this.coordType)));
|
|
4008
4020
|
}
|
|
4009
4021
|
}
|
|
4010
|
-
class
|
|
4022
|
+
class Bt extends Ve {
|
|
4011
4023
|
static create(t) {
|
|
4012
4024
|
const e = this.coordType, r = new google.maps.Rectangle({
|
|
4013
4025
|
bounds: t.bounds.toGoogle(e),
|
|
@@ -4020,42 +4032,42 @@ class kt extends He {
|
|
|
4020
4032
|
fillOpacity: t.fillOpacity,
|
|
4021
4033
|
visible: t.visible
|
|
4022
4034
|
});
|
|
4023
|
-
return new
|
|
4035
|
+
return new Bt(r, e, this);
|
|
4024
4036
|
}
|
|
4025
4037
|
getBounds() {
|
|
4026
|
-
return
|
|
4038
|
+
return A.fromGoogle(this.innerOverlay.getBounds() ?? J.BOUNDS_ZERO, this.coordType);
|
|
4027
4039
|
}
|
|
4028
4040
|
setBounds(t) {
|
|
4029
4041
|
const e = t.toGoogle(this.coordType);
|
|
4030
4042
|
e.equals(this.innerOverlay.getBounds()) || this.innerOverlay.setBounds(e);
|
|
4031
4043
|
}
|
|
4032
4044
|
}
|
|
4033
|
-
const
|
|
4034
|
-
class
|
|
4045
|
+
const ee = 1;
|
|
4046
|
+
class Ri extends gt {
|
|
4035
4047
|
constructor(e, r) {
|
|
4036
4048
|
var s;
|
|
4037
4049
|
super(e);
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
this.buildInMapTypeId2BIMT =
|
|
4053
|
-
minZoom: r.minZoom && r.minZoom +
|
|
4054
|
-
maxZoom: r.maxZoom && r.maxZoom +
|
|
4050
|
+
h(this, "buildInMapTypeId2BIMT");
|
|
4051
|
+
h(this, "baiduMapType2BIMT");
|
|
4052
|
+
h(this, "map");
|
|
4053
|
+
h(this, "createLabel", Ot.create);
|
|
4054
|
+
h(this, "createCircle", ft.create);
|
|
4055
|
+
h(this, "createPolygon", Pt.create);
|
|
4056
|
+
h(this, "createPolyline", Lt.create);
|
|
4057
|
+
h(this, "createRectangle", It.create);
|
|
4058
|
+
h(this, "createInfoWindow", _t.create);
|
|
4059
|
+
h(this, "createInfoBox", Tt.create);
|
|
4060
|
+
h(this, "createMarker", Ce.create);
|
|
4061
|
+
h(this, "createMapTypeControl", lt.create);
|
|
4062
|
+
h(this, "createZoomControl", dt.create);
|
|
4063
|
+
h(this, "createScaleControl", ht.create);
|
|
4064
|
+
this.buildInMapTypeId2BIMT = R.BUILD_IN_MAP_TYPES.getValueMap(S.prototype.getId), this.baiduMapType2BIMT = R.BUILD_IN_MAP_TYPES.getValueMap(S.prototype.asBaiduMapType), this.map = new BMap.Map(e, {
|
|
4065
|
+
minZoom: r.minZoom && r.minZoom + ee,
|
|
4066
|
+
maxZoom: r.maxZoom && r.maxZoom + ee,
|
|
4055
4067
|
mapType: r.buildInMapTypeId && ((s = this.buildInMapTypeId2BIMT.get(r.buildInMapTypeId)) == null ? void 0 : s.asBaiduMapType()),
|
|
4056
4068
|
enableMapClick: !1
|
|
4057
4069
|
// 关闭底图点击功能
|
|
4058
|
-
}), this.map.centerAndZoom(r.center.toBaidu(this.coordType), r.zoom +
|
|
4070
|
+
}), this.map.centerAndZoom(r.center.toBaidu(this.coordType), r.zoom + ee), this.setGestureHandling(r.gestureHandling), r.infoWindowMode === "multi" && console.warn("baidu不支持多个InfoWindow, 可能会出现未知问题"), r.mapStyle && this.map.setMapStyleV2(r.mapStyle.toBaidu()), this.setEventTargetDelegate(new ae(this.map, this)), this.map.addEventListener("addoverlay", (n) => {
|
|
4059
4071
|
const a = n.target.__info_box__;
|
|
4060
4072
|
a && (console.debug("add:info-box", a), this.map.addOverlay(a));
|
|
4061
4073
|
}), this.map.addEventListener("removeoverlay", (n) => {
|
|
@@ -4063,15 +4075,15 @@ class Ai extends ut {
|
|
|
4063
4075
|
a && (console.debug("remove:info-box", a), this.map.removeOverlay(a));
|
|
4064
4076
|
});
|
|
4065
4077
|
}
|
|
4066
|
-
setGestureHandling(e =
|
|
4067
|
-
switch (e ===
|
|
4068
|
-
case
|
|
4078
|
+
setGestureHandling(e = j.auto) {
|
|
4079
|
+
switch (e === j.auto && (e = this.element.parentElement && tt.isScrollable(this.element.parentElement) ? j.cooperative : j.greedy), e) {
|
|
4080
|
+
case j.cooperative:
|
|
4069
4081
|
this.map.disableScrollWheelZoom(), this.map.enableDragging(), this.map.enableDoubleClickZoom();
|
|
4070
4082
|
break;
|
|
4071
|
-
case
|
|
4083
|
+
case j.greedy:
|
|
4072
4084
|
this.map.enableScrollWheelZoom(), this.map.enableDragging(), this.map.enableDoubleClickZoom();
|
|
4073
4085
|
break;
|
|
4074
|
-
case
|
|
4086
|
+
case j.none:
|
|
4075
4087
|
this.map.disableDragging(), this.map.disableScrollWheelZoom(), this.map.disableDoubleClickZoom();
|
|
4076
4088
|
break;
|
|
4077
4089
|
}
|
|
@@ -4118,16 +4130,16 @@ class Ai extends ut {
|
|
|
4118
4130
|
this.map.setCenter(e.toBaidu(this.coordType));
|
|
4119
4131
|
}
|
|
4120
4132
|
getZoom() {
|
|
4121
|
-
return super.getZoom() -
|
|
4133
|
+
return super.getZoom() - ee;
|
|
4122
4134
|
}
|
|
4123
4135
|
setZoom(e) {
|
|
4124
|
-
return super.setZoom(e +
|
|
4136
|
+
return super.setZoom(e + ee);
|
|
4125
4137
|
}
|
|
4126
4138
|
setMinZoom(e) {
|
|
4127
|
-
this.map.setMinZoom(e +
|
|
4139
|
+
this.map.setMinZoom(e + ee);
|
|
4128
4140
|
}
|
|
4129
4141
|
setMaxZoom(e) {
|
|
4130
|
-
this.map.setMaxZoom(e +
|
|
4142
|
+
this.map.setMaxZoom(e + ee);
|
|
4131
4143
|
}
|
|
4132
4144
|
setMapStyle(e) {
|
|
4133
4145
|
this.map.setMapStyleV2(e.toBaidu());
|
|
@@ -4163,7 +4175,7 @@ class Ai extends ut {
|
|
|
4163
4175
|
});
|
|
4164
4176
|
}
|
|
4165
4177
|
getBounds() {
|
|
4166
|
-
return
|
|
4178
|
+
return A.fromBaidu(this.map.getBounds(), this.coordType);
|
|
4167
4179
|
}
|
|
4168
4180
|
addElementOverlay(e) {
|
|
4169
4181
|
this.map.addOverlay(e.asBaidu());
|
|
@@ -4182,8 +4194,8 @@ class Ai extends ut {
|
|
|
4182
4194
|
const r = class extends BMap.Control {
|
|
4183
4195
|
constructor() {
|
|
4184
4196
|
super(...arguments);
|
|
4185
|
-
|
|
4186
|
-
|
|
4197
|
+
h(this, "defaultAnchor", $.getBaidu().toValue(e.position));
|
|
4198
|
+
h(this, "defaultOffset", new BMap.Size(0, 0));
|
|
4187
4199
|
}
|
|
4188
4200
|
initialize(n) {
|
|
4189
4201
|
const a = e.onCreateElement();
|
|
@@ -4194,46 +4206,46 @@ class Ai extends ut {
|
|
|
4194
4206
|
}
|
|
4195
4207
|
}
|
|
4196
4208
|
removeCustomControl(e) {
|
|
4197
|
-
e.inner && (
|
|
4209
|
+
e.inner && (oe(e.inner instanceof BMap.Control, `control.inner(${e.inner})需要是BMap.Control`), this.map.removeControl(e.inner));
|
|
4198
4210
|
}
|
|
4199
4211
|
createMarkerClusterer(e) {
|
|
4200
|
-
return new
|
|
4212
|
+
return new bi(this, e);
|
|
4201
4213
|
}
|
|
4202
4214
|
createAutocomplete(e) {
|
|
4203
|
-
return new
|
|
4215
|
+
return new mi(this, e);
|
|
4204
4216
|
}
|
|
4205
4217
|
createSearchBox(e) {
|
|
4206
|
-
return new
|
|
4218
|
+
return new wi(this, e);
|
|
4207
4219
|
}
|
|
4208
4220
|
createPlacesService(e) {
|
|
4209
|
-
return new
|
|
4221
|
+
return new Oi(this, e);
|
|
4210
4222
|
}
|
|
4211
4223
|
createMapUrls(e) {
|
|
4212
4224
|
return new Be(e);
|
|
4213
4225
|
}
|
|
4214
4226
|
}
|
|
4215
|
-
class
|
|
4227
|
+
class $i extends gt {
|
|
4216
4228
|
constructor(e, r) {
|
|
4217
4229
|
var n;
|
|
4218
4230
|
super(e);
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
this.mapOptions = r, this.buildInMapTypeId2BIMT =
|
|
4231
|
+
h(this, "buildInMapTypeId2BIMT");
|
|
4232
|
+
h(this, "googleMapTypeId2BIMT");
|
|
4233
|
+
h(this, "map");
|
|
4234
|
+
h(this, "createLabel", Ct.create);
|
|
4235
|
+
h(this, "createCircle", yt.create);
|
|
4236
|
+
h(this, "createPolygon", kt.create);
|
|
4237
|
+
h(this, "createPolyline", xt.create);
|
|
4238
|
+
h(this, "createRectangle", Bt.create);
|
|
4239
|
+
h(this, "createInfoWindow", bt.create);
|
|
4240
|
+
h(this, "createInfoBox", Mt.create);
|
|
4241
|
+
h(this, "createMarker", wt.create);
|
|
4242
|
+
h(this, "createMapTypeControl", ke.create);
|
|
4243
|
+
h(this, "createZoomControl", ut.create);
|
|
4244
|
+
h(this, "createScaleControl", ct.create);
|
|
4245
|
+
this.mapOptions = r, this.buildInMapTypeId2BIMT = R.BUILD_IN_MAP_TYPES.getValueMap(S.prototype.getId), this.googleMapTypeId2BIMT = R.BUILD_IN_MAP_TYPES.getValueMap(S.prototype.getGoogleMapTypeId);
|
|
4234
4246
|
const s = r.buildInMapTypeId && this.buildInMapTypeId2BIMT.get(r.buildInMapTypeId);
|
|
4235
4247
|
this.map = new google.maps.Map(e, {
|
|
4236
|
-
center: r.center.toGoogle((s ??
|
|
4248
|
+
center: r.center.toGoogle((s ?? R.NORMAL).getGoogleCoordType()),
|
|
4237
4249
|
zoom: r.zoom,
|
|
4238
4250
|
disableDefaultUI: !0,
|
|
4239
4251
|
streetViewControl: !0,
|
|
@@ -4242,7 +4254,7 @@ class Ri extends ut {
|
|
|
4242
4254
|
maxZoom: r.maxZoom,
|
|
4243
4255
|
styles: (n = r.mapStyle) == null ? void 0 : n.toGoogle(),
|
|
4244
4256
|
mapTypeId: s == null ? void 0 : s.getGoogleMapTypeId()
|
|
4245
|
-
}), this.setEventTargetDelegate(new
|
|
4257
|
+
}), this.setEventTargetDelegate(new re(this.map, this));
|
|
4246
4258
|
}
|
|
4247
4259
|
setGestureHandling(e) {
|
|
4248
4260
|
this.map.setOptions({
|
|
@@ -4259,21 +4271,21 @@ class Ri extends ut {
|
|
|
4259
4271
|
const r = this.innerMap.getProjection(), s = this.innerMap.getBounds();
|
|
4260
4272
|
if (r == null || s == null)
|
|
4261
4273
|
return y.ZERO;
|
|
4262
|
-
const n = r.fromLatLngToPoint(s.getSouthWest()), a = r.fromLatLngToPoint(s.getNorthEast()),
|
|
4263
|
-
if (n == null || a == null ||
|
|
4274
|
+
const n = r.fromLatLngToPoint(s.getSouthWest()), a = r.fromLatLngToPoint(s.getNorthEast()), d = this.innerMap.getZoom();
|
|
4275
|
+
if (n == null || a == null || d == null)
|
|
4264
4276
|
return y.ZERO;
|
|
4265
|
-
const o = Math.pow(2,
|
|
4266
|
-
return y.fromGoogle(r.fromPointToLatLng(l) ??
|
|
4277
|
+
const o = Math.pow(2, d), l = new google.maps.Point(e.x / o + n.x, e.y / o + a.y);
|
|
4278
|
+
return y.fromGoogle(r.fromPointToLatLng(l) ?? J.LATLNG_ZERO, this.coordType);
|
|
4267
4279
|
}
|
|
4268
4280
|
fromLatLngToContainerPoint(e) {
|
|
4269
4281
|
const r = this.innerMap.getProjection(), s = this.innerMap.getBounds();
|
|
4270
4282
|
if (r == null || s == null)
|
|
4271
|
-
return
|
|
4272
|
-
const n = r.fromLatLngToPoint(s.getSouthWest()), a = r.fromLatLngToPoint(s.getNorthEast()),
|
|
4273
|
-
if (n == null || a == null ||
|
|
4274
|
-
return
|
|
4275
|
-
const o = Math.pow(2,
|
|
4276
|
-
return l == null ?
|
|
4283
|
+
return X.ZERO;
|
|
4284
|
+
const n = r.fromLatLngToPoint(s.getSouthWest()), a = r.fromLatLngToPoint(s.getNorthEast()), d = this.innerMap.getZoom();
|
|
4285
|
+
if (n == null || a == null || d == null)
|
|
4286
|
+
return X.ZERO;
|
|
4287
|
+
const o = Math.pow(2, d), l = r.fromLatLngToPoint(e.toGoogle(this.coordType));
|
|
4288
|
+
return l == null ? X.ZERO : { x: (l.x - n.x) * o, y: (l.y - a.y) * o };
|
|
4277
4289
|
}
|
|
4278
4290
|
setDefaultCursor(e) {
|
|
4279
4291
|
this.innerMap.setOptions({ draggableCursor: e });
|
|
@@ -4285,7 +4297,7 @@ class Ri extends ut {
|
|
|
4285
4297
|
this.map.setOptions({ disableDoubleClickZoom: !e });
|
|
4286
4298
|
}
|
|
4287
4299
|
getCenter() {
|
|
4288
|
-
return y.fromGoogle(this.map.getCenter() ??
|
|
4300
|
+
return y.fromGoogle(this.map.getCenter() ?? J.LATLNG_ZERO, this.coordType);
|
|
4289
4301
|
}
|
|
4290
4302
|
setCenter(e) {
|
|
4291
4303
|
this.map.setCenter(e.toGoogle(this.coordType));
|
|
@@ -4315,7 +4327,7 @@ class Ri extends ut {
|
|
|
4315
4327
|
this.map.overlayMapTypes.push(e.asGoogleMapType());
|
|
4316
4328
|
}
|
|
4317
4329
|
removeOverlayMapType(e) {
|
|
4318
|
-
|
|
4330
|
+
ce.remove(this.map.overlayMapTypes, e.asGoogleMapType());
|
|
4319
4331
|
}
|
|
4320
4332
|
addLayer(e) {
|
|
4321
4333
|
e.asGoogleLayer().setMap(this.map);
|
|
@@ -4334,7 +4346,7 @@ class Ri extends ut {
|
|
|
4334
4346
|
}
|
|
4335
4347
|
getBounds() {
|
|
4336
4348
|
const e = this.map.getBounds();
|
|
4337
|
-
return e ?
|
|
4349
|
+
return e ? A.fromGoogle(e, this.coordType) : A.EMPTY;
|
|
4338
4350
|
}
|
|
4339
4351
|
addElementOverlay(e) {
|
|
4340
4352
|
e.asGoogle().setMap(this.map);
|
|
@@ -4349,39 +4361,39 @@ class Ri extends ut {
|
|
|
4349
4361
|
e.innerOverlay.setMap(null);
|
|
4350
4362
|
}
|
|
4351
4363
|
addCustomControl(e) {
|
|
4352
|
-
e.inner || (e.inner = e.onCreateElement(), this.map.controls[
|
|
4364
|
+
e.inner || (e.inner = e.onCreateElement(), this.map.controls[$.getGoogle().toValue(e.position)].push(e.inner));
|
|
4353
4365
|
}
|
|
4354
4366
|
removeCustomControl(e) {
|
|
4355
4367
|
if (e.inner) {
|
|
4356
|
-
const r = this.map.controls[
|
|
4357
|
-
|
|
4368
|
+
const r = this.map.controls[$.getGoogle().toValue(e.position)];
|
|
4369
|
+
ce.remove(r, e.inner);
|
|
4358
4370
|
}
|
|
4359
4371
|
}
|
|
4360
4372
|
createMarkerClusterer(e) {
|
|
4361
|
-
return new
|
|
4373
|
+
return new Ti(this, e);
|
|
4362
4374
|
}
|
|
4363
4375
|
createAutocomplete(e) {
|
|
4364
|
-
return new
|
|
4376
|
+
return new gi(this, e);
|
|
4365
4377
|
}
|
|
4366
4378
|
createSearchBox(e) {
|
|
4367
|
-
return new
|
|
4379
|
+
return new Ci(this, e);
|
|
4368
4380
|
}
|
|
4369
4381
|
createPlacesService(e) {
|
|
4370
4382
|
return new Mi(this, e);
|
|
4371
4383
|
}
|
|
4372
4384
|
createMapUrls(e) {
|
|
4373
|
-
return new
|
|
4385
|
+
return new Ie(e);
|
|
4374
4386
|
}
|
|
4375
4387
|
}
|
|
4376
|
-
class
|
|
4388
|
+
class Di extends gt {
|
|
4377
4389
|
constructor(e, r) {
|
|
4378
4390
|
var a;
|
|
4379
4391
|
super(e);
|
|
4380
|
-
|
|
4381
|
-
|
|
4392
|
+
h(this, "map");
|
|
4393
|
+
h(this, "defaultLayers");
|
|
4382
4394
|
this.mapOptions = r;
|
|
4383
|
-
const s =
|
|
4384
|
-
|
|
4395
|
+
const s = er().here;
|
|
4396
|
+
Ae.includes(s.version) || C(`不支持${s.version}, HereMap当前只支持如下版本: ${Ae}`);
|
|
4385
4397
|
const n = new H.service.Platform({
|
|
4386
4398
|
app_id: s.key.split(",")[0],
|
|
4387
4399
|
app_code: s.key.split(",")[1]
|
|
@@ -4525,89 +4537,89 @@ class $i extends ut {
|
|
|
4525
4537
|
throw new Error("Method not implemented.");
|
|
4526
4538
|
}
|
|
4527
4539
|
}
|
|
4528
|
-
var
|
|
4540
|
+
var G = /* @__PURE__ */ ((i) => (i.google = "google", i.baidu = "baidu", i.here = "here", i))(G || {}), it;
|
|
4529
4541
|
((i) => {
|
|
4530
4542
|
function t(e, r, s) {
|
|
4531
|
-
const n =
|
|
4543
|
+
const n = rt.create(s);
|
|
4532
4544
|
switch (e) {
|
|
4533
4545
|
case "google":
|
|
4534
|
-
return new
|
|
4546
|
+
return new $i(r, n);
|
|
4535
4547
|
case "baidu":
|
|
4536
|
-
return new
|
|
4548
|
+
return new Ri(r, n);
|
|
4537
4549
|
case "here":
|
|
4538
|
-
return new
|
|
4550
|
+
return new Di(r, n);
|
|
4539
4551
|
}
|
|
4540
4552
|
}
|
|
4541
4553
|
i.createMap = t;
|
|
4542
|
-
})(
|
|
4543
|
-
function
|
|
4544
|
-
const e = window, r =
|
|
4554
|
+
})(it || (it = {}));
|
|
4555
|
+
function zi({ type: i, config: t }) {
|
|
4556
|
+
const e = window, r = Ni(i);
|
|
4545
4557
|
if (e[r])
|
|
4546
4558
|
return Promise.resolve();
|
|
4547
|
-
switch (i !==
|
|
4548
|
-
case
|
|
4549
|
-
return {}.VITE_FALSE ? (
|
|
4559
|
+
switch (i !== G.here && !t.key && C(`请先配置${i}地图的key`), i) {
|
|
4560
|
+
case G.google:
|
|
4561
|
+
return {}.VITE_FALSE ? (di({
|
|
4550
4562
|
key: t.key,
|
|
4551
4563
|
v: "3.52"
|
|
4552
4564
|
// v: config.version,
|
|
4553
|
-
}), google.maps.importLibrary("core")) :
|
|
4554
|
-
case
|
|
4555
|
-
return
|
|
4556
|
-
case
|
|
4557
|
-
return pe(
|
|
4565
|
+
}), google.maps.importLibrary("core")) : jt(`https://maps.googleapis.com/maps/api/js?key=${t.key}&language=${t.language}&v=${t.version}&libraries=${t.libraries.join(",")}`);
|
|
4566
|
+
case G.baidu:
|
|
4567
|
+
return jt(`https://api.map.baidu.com/api?v=${t.version}&ak=${t.key}`);
|
|
4568
|
+
case G.here:
|
|
4569
|
+
return ge(pe("core", t.version)).then(() => Promise.all([
|
|
4558
4570
|
// 其他大多数模块都可以同时载入
|
|
4559
|
-
pe(
|
|
4560
|
-
pe(
|
|
4561
|
-
pe(
|
|
4562
|
-
pe(
|
|
4571
|
+
ge(pe("service", t.version)),
|
|
4572
|
+
ge(pe("mapevents", t.version)),
|
|
4573
|
+
ge(pe("clustering", t.version)),
|
|
4574
|
+
ge(pe("ui", t.version))
|
|
4563
4575
|
])).catch((s) => (delete e[r], Promise.reject(s)));
|
|
4564
4576
|
default:
|
|
4565
|
-
|
|
4577
|
+
Qe(i);
|
|
4566
4578
|
}
|
|
4567
4579
|
}
|
|
4568
|
-
function
|
|
4580
|
+
function pe(i, t = Ae[0]) {
|
|
4569
4581
|
return `https://js.api.here.com/v3/${t}/mapsjs-${i}.js`;
|
|
4570
4582
|
}
|
|
4571
|
-
function
|
|
4583
|
+
function Ni(i) {
|
|
4572
4584
|
switch (i) {
|
|
4573
|
-
case
|
|
4585
|
+
case G.google:
|
|
4574
4586
|
return "google";
|
|
4575
|
-
case
|
|
4587
|
+
case G.baidu:
|
|
4576
4588
|
return "BMap";
|
|
4577
|
-
case
|
|
4589
|
+
case G.here:
|
|
4578
4590
|
return "H";
|
|
4579
4591
|
}
|
|
4580
4592
|
}
|
|
4581
|
-
let
|
|
4582
|
-
function
|
|
4593
|
+
let Gi = 0;
|
|
4594
|
+
function jt(i, t = "callback") {
|
|
4583
4595
|
return new Promise((e, r) => {
|
|
4584
|
-
const s = `__callback${
|
|
4596
|
+
const s = `__callback${Gi++}`;
|
|
4585
4597
|
window[s] = e;
|
|
4586
4598
|
const n = document.createElement("script");
|
|
4587
4599
|
n.src = `${i}&${t}=${s}`, n.onerror = r, document.body.appendChild(n);
|
|
4588
4600
|
});
|
|
4589
4601
|
}
|
|
4590
|
-
function
|
|
4602
|
+
function ge(i) {
|
|
4591
4603
|
return new Promise((t, e) => {
|
|
4592
4604
|
const r = document.createElement("script");
|
|
4593
4605
|
r.src = i, r.onload = t, r.onerror = e, document.body.appendChild(r);
|
|
4594
4606
|
});
|
|
4595
4607
|
}
|
|
4596
|
-
function
|
|
4608
|
+
function Z(i, t) {
|
|
4597
4609
|
return {
|
|
4598
4610
|
type: String,
|
|
4599
4611
|
default: t,
|
|
4600
4612
|
validator: (e) => Object.values(i).includes(e)
|
|
4601
4613
|
};
|
|
4602
4614
|
}
|
|
4603
|
-
function
|
|
4615
|
+
function Zi(i, t) {
|
|
4604
4616
|
return {
|
|
4605
4617
|
type: String,
|
|
4606
4618
|
default: t,
|
|
4607
4619
|
validator: (e) => i.includes(e)
|
|
4608
4620
|
};
|
|
4609
4621
|
}
|
|
4610
|
-
function
|
|
4622
|
+
function D(i) {
|
|
4611
4623
|
return {
|
|
4612
4624
|
type: i,
|
|
4613
4625
|
required: !0
|
|
@@ -4619,7 +4631,7 @@ function m(i, t) {
|
|
|
4619
4631
|
default: t
|
|
4620
4632
|
};
|
|
4621
4633
|
}
|
|
4622
|
-
function
|
|
4634
|
+
function js(i) {
|
|
4623
4635
|
const t = {};
|
|
4624
4636
|
return Object.entries(i).forEach(([e, r]) => {
|
|
4625
4637
|
const s = `__${e}`;
|
|
@@ -4636,37 +4648,37 @@ function Hs(i) {
|
|
|
4636
4648
|
};
|
|
4637
4649
|
}), t;
|
|
4638
4650
|
}
|
|
4639
|
-
const
|
|
4651
|
+
const me = {
|
|
4640
4652
|
enumerable: !0,
|
|
4641
4653
|
configurable: !0,
|
|
4642
|
-
get:
|
|
4643
|
-
set:
|
|
4654
|
+
get: ve,
|
|
4655
|
+
set: ve
|
|
4644
4656
|
};
|
|
4645
|
-
function
|
|
4657
|
+
function Wi(i) {
|
|
4646
4658
|
return Object.keys(i).forEach((t) => {
|
|
4647
4659
|
const e = i[t];
|
|
4648
4660
|
let r = !1;
|
|
4649
|
-
typeof e == "function" ? (
|
|
4661
|
+
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));
|
|
4650
4662
|
}), i;
|
|
4651
4663
|
}
|
|
4652
|
-
function
|
|
4653
|
-
return
|
|
4664
|
+
function Vs(i) {
|
|
4665
|
+
return Wi(i);
|
|
4654
4666
|
}
|
|
4655
|
-
function
|
|
4656
|
-
return
|
|
4667
|
+
function Or() {
|
|
4668
|
+
return Je();
|
|
4657
4669
|
}
|
|
4658
|
-
function
|
|
4670
|
+
function Pe(i, t) {
|
|
4659
4671
|
const e = i.$options[t];
|
|
4660
4672
|
if (e)
|
|
4661
4673
|
for (const r of e)
|
|
4662
4674
|
r.call(i);
|
|
4663
4675
|
}
|
|
4664
|
-
function
|
|
4676
|
+
function Fs(i, t) {
|
|
4665
4677
|
for (const e of i)
|
|
4666
4678
|
if (e.$options.name === t.name)
|
|
4667
4679
|
return e;
|
|
4668
4680
|
}
|
|
4669
|
-
function
|
|
4681
|
+
function Us(i, t) {
|
|
4670
4682
|
if (!i.default)
|
|
4671
4683
|
return;
|
|
4672
4684
|
const e = i.default();
|
|
@@ -4674,12 +4686,12 @@ function Fs(i, t) {
|
|
|
4674
4686
|
if ((r == null ? void 0 : r.type).name === t.name)
|
|
4675
4687
|
return r;
|
|
4676
4688
|
}
|
|
4677
|
-
function
|
|
4689
|
+
function Hi(i, t) {
|
|
4678
4690
|
const e = {}, r = {}, s = {};
|
|
4679
4691
|
return Object.keys(i).forEach((n) => {
|
|
4680
|
-
n.startsWith("on") ? e[
|
|
4692
|
+
n.startsWith("on") ? e[Te.pascal2kebab(n.substring(2))] = i[n] : r[n] = i[n];
|
|
4681
4693
|
}), t && Object.keys(t).forEach((n) => {
|
|
4682
|
-
n.startsWith("on") && (s[
|
|
4694
|
+
n.startsWith("on") && (s[Te.pascal2kebab(n.substring(2))] = t[n]);
|
|
4683
4695
|
}), {
|
|
4684
4696
|
/** class/style/未声明的属性 等 */
|
|
4685
4697
|
binds: r,
|
|
@@ -4689,13 +4701,13 @@ function Wi(i, t) {
|
|
|
4689
4701
|
listenerProps: s
|
|
4690
4702
|
};
|
|
4691
4703
|
}
|
|
4692
|
-
function
|
|
4693
|
-
return
|
|
4704
|
+
function Y(i, t) {
|
|
4705
|
+
return Ft(() => Hi(i, t));
|
|
4694
4706
|
}
|
|
4695
4707
|
function L() {
|
|
4696
4708
|
return Function;
|
|
4697
4709
|
}
|
|
4698
|
-
const
|
|
4710
|
+
const Ys = () => {
|
|
4699
4711
|
let i, t;
|
|
4700
4712
|
function e(s) {
|
|
4701
4713
|
console.log(s), i = s && s.type, t = Date.now();
|
|
@@ -4704,33 +4716,33 @@ const Us = () => {
|
|
|
4704
4716
|
((s && s.type) !== i || Date.now() - (t ?? 0) > 1e3) && e(s);
|
|
4705
4717
|
}
|
|
4706
4718
|
return { eventLog: e, eventLogLess: r };
|
|
4707
|
-
},
|
|
4708
|
-
inject: [
|
|
4719
|
+
}, St = "$map", we = "onCreate", Ee = "onDestroy", P = w({
|
|
4720
|
+
inject: [St],
|
|
4709
4721
|
mounted() {
|
|
4710
|
-
|
|
4722
|
+
Pe(this, we);
|
|
4711
4723
|
},
|
|
4712
4724
|
beforeUnmount() {
|
|
4713
|
-
|
|
4725
|
+
Pe(this, Ee);
|
|
4714
4726
|
},
|
|
4715
4727
|
methods: {
|
|
4716
4728
|
recreate() {
|
|
4717
|
-
|
|
4729
|
+
Pe(this, Ee), Pe(this, we);
|
|
4718
4730
|
}
|
|
4719
4731
|
},
|
|
4720
4732
|
render() {
|
|
4721
|
-
return
|
|
4733
|
+
return Or();
|
|
4722
4734
|
}
|
|
4723
|
-
}),
|
|
4735
|
+
}), ji = w({
|
|
4724
4736
|
name: "tg-map",
|
|
4725
4737
|
provide() {
|
|
4726
4738
|
return {
|
|
4727
|
-
[
|
|
4739
|
+
[St]: Ft(() => this.map)
|
|
4728
4740
|
};
|
|
4729
4741
|
},
|
|
4730
4742
|
inheritAttrs: !1,
|
|
4731
4743
|
props: {
|
|
4732
4744
|
/** type没做响应式, 但外部可以把type作为tg-map的key, 让type修改时完全重建tg-map */
|
|
4733
|
-
type: G
|
|
4745
|
+
type: Z(G, G.google),
|
|
4734
4746
|
/**
|
|
4735
4747
|
* 当对该属性使用双向绑定时, 改变center将触发update:center又反过来触发center改变, 最终导致无限循环...
|
|
4736
4748
|
* 当前通过setCenter()时判断center是否有改变来避免该问题, 但为了避免可能存在的问题, 另外设计了如下机制:
|
|
@@ -4739,7 +4751,7 @@ const Us = () => {
|
|
|
4739
4751
|
* - :last-center.sync="center": 获取tg-map销毁时的最后的center的值, 使用这种方式可以做到type切换时保留中心点位置
|
|
4740
4752
|
* @see AbstractMapEventMap.center-changed
|
|
4741
4753
|
* */
|
|
4742
|
-
center:
|
|
4754
|
+
center: D(y),
|
|
4743
4755
|
/**
|
|
4744
4756
|
* 同步center的延时
|
|
4745
4757
|
* @default 300
|
|
@@ -4756,17 +4768,17 @@ const Us = () => {
|
|
|
4756
4768
|
* @see center
|
|
4757
4769
|
*/
|
|
4758
4770
|
lastCenter: m(y),
|
|
4759
|
-
zoom:
|
|
4771
|
+
zoom: D(Number),
|
|
4760
4772
|
/**
|
|
4761
4773
|
* 该属性不会响应式更新, 要让它立即生效, 请参考{@link file://./../views/map/InfoDemo.vue#L3}
|
|
4762
4774
|
* @see MapOptions.infoWindowMode
|
|
4763
4775
|
*/
|
|
4764
|
-
infoWindowMode:
|
|
4765
|
-
gestureHandling:
|
|
4776
|
+
infoWindowMode: Zi(xi),
|
|
4777
|
+
gestureHandling: Z(j),
|
|
4766
4778
|
minZoom: m(Number),
|
|
4767
4779
|
maxZoom: m(Number),
|
|
4768
4780
|
mapStyle: m(Object),
|
|
4769
|
-
mapTypeId:
|
|
4781
|
+
mapTypeId: Z(nr),
|
|
4770
4782
|
/** 地图类型对象, 优先级比mapTypeId高 */
|
|
4771
4783
|
mapType: m(Object),
|
|
4772
4784
|
hideLogo: m(Boolean),
|
|
@@ -4783,19 +4795,19 @@ const Us = () => {
|
|
|
4783
4795
|
emits: void 0,
|
|
4784
4796
|
setup(i, { attrs: t }) {
|
|
4785
4797
|
return {
|
|
4786
|
-
attrs:
|
|
4798
|
+
attrs: Y(t, i),
|
|
4787
4799
|
centerSyncTimeoutId: void 0
|
|
4788
4800
|
};
|
|
4789
4801
|
},
|
|
4790
4802
|
data() {
|
|
4791
4803
|
return {
|
|
4792
|
-
map:
|
|
4804
|
+
map: et(),
|
|
4793
4805
|
isDestroyed: !1
|
|
4794
4806
|
};
|
|
4795
4807
|
},
|
|
4796
4808
|
computed: {
|
|
4797
4809
|
propsJson() {
|
|
4798
|
-
return
|
|
4810
|
+
return be.toJsonSafely(this.$props);
|
|
4799
4811
|
}
|
|
4800
4812
|
},
|
|
4801
4813
|
watch: {
|
|
@@ -4821,13 +4833,13 @@ const Us = () => {
|
|
|
4821
4833
|
},
|
|
4822
4834
|
mapType(i) {
|
|
4823
4835
|
var t;
|
|
4824
|
-
(t = this.map) == null || t.setMapType(i ??
|
|
4836
|
+
(t = this.map) == null || t.setMapType(i ?? R.NORMAL);
|
|
4825
4837
|
}
|
|
4826
4838
|
},
|
|
4827
4839
|
async mounted() {
|
|
4828
4840
|
const i = this.type;
|
|
4829
4841
|
try {
|
|
4830
|
-
await
|
|
4842
|
+
await zi({ type: i, config: er()[i] });
|
|
4831
4843
|
} catch (s) {
|
|
4832
4844
|
this.$emit("error", s);
|
|
4833
4845
|
return;
|
|
@@ -4836,7 +4848,7 @@ const Us = () => {
|
|
|
4836
4848
|
console.warn(`tg-map(type=${i})已销毁, 不需要继续执行`);
|
|
4837
4849
|
return;
|
|
4838
4850
|
}
|
|
4839
|
-
const t =
|
|
4851
|
+
const t = it.createMap(
|
|
4840
4852
|
i,
|
|
4841
4853
|
this.$refs.map,
|
|
4842
4854
|
/* options: */
|
|
@@ -4851,17 +4863,17 @@ const Us = () => {
|
|
|
4851
4863
|
buildInMapTypeId: this.mapTypeId
|
|
4852
4864
|
}
|
|
4853
4865
|
);
|
|
4854
|
-
if (this.map = Br(t), this.mapType && t.setMapType(this.mapType), "ready" in this.attrs.listeners && console.error("地图载入完成的事件已经从ready改为了load, 请手动修改"),
|
|
4866
|
+
if (this.map = Br(t), this.mapType && t.setMapType(this.mapType), "ready" in this.attrs.listeners && console.error("地图载入完成的事件已经从ready改为了load, 请手动修改"), U(
|
|
4855
4867
|
this.attrs.listeners,
|
|
4856
4868
|
t,
|
|
4857
4869
|
/* excludes: */
|
|
4858
4870
|
["load"]
|
|
4859
|
-
), this.$emit("load", t),
|
|
4871
|
+
), this.$emit("load", t), Ut([
|
|
4860
4872
|
() => this.zoom,
|
|
4861
4873
|
() => this.center
|
|
4862
4874
|
//
|
|
4863
|
-
], ([s, n], [a,
|
|
4864
|
-
s !== a && t.setZoom(s), n !==
|
|
4875
|
+
], ([s, n], [a, d]) => {
|
|
4876
|
+
s !== a && t.setZoom(s), n !== d && (t.getCenter().equals(n) || t.setCenter(n));
|
|
4865
4877
|
}), "update:center" in this.attrs.listenerProps) {
|
|
4866
4878
|
const s = () => this.$emit("update:center", t.getCenter());
|
|
4867
4879
|
t.addEventListener("center-changed", () => {
|
|
@@ -4890,22 +4902,22 @@ const q = (i, t) => {
|
|
|
4890
4902
|
e[r] = s;
|
|
4891
4903
|
return e;
|
|
4892
4904
|
};
|
|
4893
|
-
function
|
|
4894
|
-
return
|
|
4905
|
+
function Vi(i, t, e, r, s, n) {
|
|
4906
|
+
return V(), F("div", ue({ class: "tg-map" }, i.attrs.binds), [
|
|
4895
4907
|
Sr("div", {
|
|
4896
4908
|
ref: "map",
|
|
4897
|
-
class:
|
|
4909
|
+
class: Ze({
|
|
4898
4910
|
"tg-map__map": !0,
|
|
4899
4911
|
[`tg-map__map--hide-logo-${i.type}`]: i.hideLogo
|
|
4900
4912
|
})
|
|
4901
4913
|
}, null, 2),
|
|
4902
|
-
|
|
4903
|
-
i.map ?
|
|
4904
|
-
|
|
4914
|
+
Je("", !0),
|
|
4915
|
+
i.map ? W(i.$slots, "default", { key: 1 }) : Je("", !0),
|
|
4916
|
+
W(i.$slots, "overlay")
|
|
4905
4917
|
], 16);
|
|
4906
4918
|
}
|
|
4907
|
-
const
|
|
4908
|
-
function
|
|
4919
|
+
const Cr = /* @__PURE__ */ q(ji, [["render", Vi]]);
|
|
4920
|
+
function Fi(i) {
|
|
4909
4921
|
if (i == null)
|
|
4910
4922
|
return;
|
|
4911
4923
|
let t;
|
|
@@ -4916,7 +4928,7 @@ function Vi(i) {
|
|
|
4916
4928
|
t = i;
|
|
4917
4929
|
return `${t}px`;
|
|
4918
4930
|
}
|
|
4919
|
-
const
|
|
4931
|
+
const Ui = w({
|
|
4920
4932
|
name: "tg-map-widget",
|
|
4921
4933
|
props: {
|
|
4922
4934
|
left: {
|
|
@@ -4942,22 +4954,22 @@ const Fi = w({
|
|
|
4942
4954
|
}
|
|
4943
4955
|
},
|
|
4944
4956
|
methods: {
|
|
4945
|
-
dimen:
|
|
4957
|
+
dimen: Fi
|
|
4946
4958
|
}
|
|
4947
4959
|
});
|
|
4948
|
-
function
|
|
4949
|
-
return
|
|
4950
|
-
class:
|
|
4951
|
-
style:
|
|
4960
|
+
function Yi(i, t, e, r, s, n) {
|
|
4961
|
+
return V(), F("div", {
|
|
4962
|
+
class: Ze(i.$options.name),
|
|
4963
|
+
style: Ar({ left: i.dimen(i.left), top: i.dimen(i.topValue), right: i.dimen(i.right), bottom: i.dimen(i.bottom) })
|
|
4952
4964
|
}, [
|
|
4953
|
-
|
|
4965
|
+
W(i.$slots, "default")
|
|
4954
4966
|
], 6);
|
|
4955
4967
|
}
|
|
4956
|
-
const qi = /* @__PURE__ */ q(
|
|
4968
|
+
const qi = /* @__PURE__ */ q(Ui, [["render", Yi]]), Ki = w({
|
|
4957
4969
|
name: "tg-custom-control",
|
|
4958
4970
|
mixins: [P],
|
|
4959
4971
|
props: {
|
|
4960
|
-
position:
|
|
4972
|
+
position: Z(I, I.RIGHT_BOTTOM)
|
|
4961
4973
|
},
|
|
4962
4974
|
setup() {
|
|
4963
4975
|
return {
|
|
@@ -4970,8 +4982,8 @@ const qi = /* @__PURE__ */ q(Fi, [["render", Ui]]), Yi = w({
|
|
|
4970
4982
|
}
|
|
4971
4983
|
},
|
|
4972
4984
|
onCreate() {
|
|
4973
|
-
|
|
4974
|
-
const { $el: i } = this, t = class extends
|
|
4985
|
+
Le(this.$parent, Cr) || console.warn("请将tg-custom-control放到tg-map中");
|
|
4986
|
+
const { $el: i } = this, t = class extends hi {
|
|
4975
4987
|
onCreateElement() {
|
|
4976
4988
|
return i;
|
|
4977
4989
|
}
|
|
@@ -4982,19 +4994,19 @@ const qi = /* @__PURE__ */ q(Fi, [["render", Ui]]), Yi = w({
|
|
|
4982
4994
|
this.$map.removeCustomControl(this.control);
|
|
4983
4995
|
}
|
|
4984
4996
|
});
|
|
4985
|
-
function
|
|
4986
|
-
return
|
|
4987
|
-
class:
|
|
4997
|
+
function Xi(i, t, e, r, s, n) {
|
|
4998
|
+
return V(), F("div", {
|
|
4999
|
+
class: Ze(i.$options.name)
|
|
4988
5000
|
}, [
|
|
4989
|
-
|
|
5001
|
+
W(i.$slots, "default")
|
|
4990
5002
|
], 2);
|
|
4991
5003
|
}
|
|
4992
|
-
const
|
|
5004
|
+
const Ji = /* @__PURE__ */ q(Ki, [["render", Xi]]), Qi = w({
|
|
4993
5005
|
name: "tg-map-type-control",
|
|
4994
5006
|
mixins: [P],
|
|
4995
5007
|
props: {
|
|
4996
|
-
position:
|
|
4997
|
-
type:
|
|
5008
|
+
position: Z(I, I.TOP_LEFT),
|
|
5009
|
+
type: Z(or),
|
|
4998
5010
|
mapTypes: m(Array)
|
|
4999
5011
|
},
|
|
5000
5012
|
setup() {
|
|
@@ -5022,11 +5034,11 @@ const Xi = /* @__PURE__ */ q(Yi, [["render", Ki]]), Ji = w({
|
|
|
5022
5034
|
onDestroy() {
|
|
5023
5035
|
this.$map.removeControl(this.control);
|
|
5024
5036
|
}
|
|
5025
|
-
}),
|
|
5037
|
+
}), es = w({
|
|
5026
5038
|
name: "tg-scale-control",
|
|
5027
5039
|
mixins: [P],
|
|
5028
5040
|
props: {
|
|
5029
|
-
position:
|
|
5041
|
+
position: Z(I, I.BOTTOM_RIGHT)
|
|
5030
5042
|
},
|
|
5031
5043
|
setup() {
|
|
5032
5044
|
return {
|
|
@@ -5045,32 +5057,32 @@ const Xi = /* @__PURE__ */ q(Yi, [["render", Ki]]), Ji = w({
|
|
|
5045
5057
|
this.$map.removeControl(this.control);
|
|
5046
5058
|
}
|
|
5047
5059
|
});
|
|
5048
|
-
function
|
|
5060
|
+
function wr() {
|
|
5049
5061
|
var e;
|
|
5050
|
-
const i = (e =
|
|
5062
|
+
const i = (e = Rr()) == null ? void 0 : e.type;
|
|
5051
5063
|
let t = (i == null ? void 0 : i.name) ?? (i == null ? void 0 : i.__name);
|
|
5052
5064
|
if (!t) {
|
|
5053
5065
|
const r = i == null ? void 0 : i.__file;
|
|
5054
|
-
r && (t =
|
|
5066
|
+
r && (t = Ii.basename(r, ".vue"));
|
|
5055
5067
|
}
|
|
5056
5068
|
return t;
|
|
5057
5069
|
}
|
|
5058
|
-
function
|
|
5059
|
-
const i =
|
|
5070
|
+
function ts() {
|
|
5071
|
+
const i = $r(St);
|
|
5060
5072
|
let t, e;
|
|
5061
|
-
return i == null && C(`<${
|
|
5073
|
+
return i == null && C(`<${wr() || "unknown"}>必须作为<tg-map>的子代组件`), {
|
|
5062
5074
|
mapRef: i,
|
|
5063
5075
|
/** 读取map对象, 只要放在<tg-map>里面的组件(除#overlay插槽外)都能够立即读取到map对象 */
|
|
5064
5076
|
get map() {
|
|
5065
5077
|
return i.value ?? C("map尚未初始化");
|
|
5066
5078
|
},
|
|
5067
5079
|
/** 地图元素创建回调 */
|
|
5068
|
-
[
|
|
5069
|
-
|
|
5080
|
+
[we](r) {
|
|
5081
|
+
Dr(r), t && C(`${we}只能调用一次`), t = r;
|
|
5070
5082
|
},
|
|
5071
5083
|
/** 地图元素销毁回调 */
|
|
5072
|
-
[
|
|
5073
|
-
|
|
5084
|
+
[Ee](r) {
|
|
5085
|
+
zr(r), e && C(`${Ee}只能调用一次`), e = r;
|
|
5074
5086
|
},
|
|
5075
5087
|
/** 重新创建地图元素 */
|
|
5076
5088
|
recreate() {
|
|
@@ -5078,23 +5090,23 @@ function es() {
|
|
|
5078
5090
|
}
|
|
5079
5091
|
};
|
|
5080
5092
|
}
|
|
5081
|
-
const
|
|
5093
|
+
const rs = w({
|
|
5082
5094
|
name: "tg-zoom-control",
|
|
5083
5095
|
props: {
|
|
5084
|
-
position:
|
|
5096
|
+
position: Z(I, I.RIGHT_BOTTOM)
|
|
5085
5097
|
},
|
|
5086
5098
|
setup(i) {
|
|
5087
5099
|
let t = void 0;
|
|
5088
|
-
const { map: e, onCreate: r, onDestroy: s } =
|
|
5100
|
+
const { map: e, onCreate: r, onDestroy: s } = ts();
|
|
5089
5101
|
return r(() => {
|
|
5090
5102
|
t = e.createZoomControl(i), e.addControl(t);
|
|
5091
5103
|
}), s(() => {
|
|
5092
5104
|
e.removeControl(t);
|
|
5093
|
-
}),
|
|
5105
|
+
}), Ut(() => i.position, (n) => {
|
|
5094
5106
|
t.setPosition(n);
|
|
5095
|
-
}),
|
|
5107
|
+
}), Or;
|
|
5096
5108
|
}
|
|
5097
|
-
}),
|
|
5109
|
+
}), is = w({
|
|
5098
5110
|
name: "tg-marker-clusterer",
|
|
5099
5111
|
mixins: [P],
|
|
5100
5112
|
// markers从this.$children中读取, 故需要省略(Omit)
|
|
@@ -5154,18 +5166,18 @@ const ts = w({
|
|
|
5154
5166
|
this.markers.push(i), this.isInitiated() && this.clusterer.addMarker(i);
|
|
5155
5167
|
},
|
|
5156
5168
|
onRemoveMarker(i) {
|
|
5157
|
-
this.isInitiated() && this.clusterer.removeMarker(i),
|
|
5169
|
+
this.isInitiated() && this.clusterer.removeMarker(i), he.remove(this.markers, i);
|
|
5158
5170
|
}
|
|
5159
5171
|
}
|
|
5160
5172
|
});
|
|
5161
|
-
function
|
|
5162
|
-
return
|
|
5163
|
-
class:
|
|
5173
|
+
function ss(i, t, e, r, s, n) {
|
|
5174
|
+
return V(), F("div", {
|
|
5175
|
+
class: Ze(i.$options.name)
|
|
5164
5176
|
}, [
|
|
5165
|
-
|
|
5177
|
+
W(i.$slots, "default")
|
|
5166
5178
|
], 2);
|
|
5167
5179
|
}
|
|
5168
|
-
const
|
|
5180
|
+
const Er = /* @__PURE__ */ q(is, [["render", ss]]), ns = w({
|
|
5169
5181
|
name: "tg-traffic-layer",
|
|
5170
5182
|
mixins: [P],
|
|
5171
5183
|
// 请直接使用v-if来控制它的显隐
|
|
@@ -5178,18 +5190,18 @@ const wr = /* @__PURE__ */ q(rs, [["render", is]]), ss = w({
|
|
|
5178
5190
|
},
|
|
5179
5191
|
watch: {},
|
|
5180
5192
|
onCreate() {
|
|
5181
|
-
this.layer = new
|
|
5193
|
+
this.layer = new ci(), this.$map.addLayer(this.layer);
|
|
5182
5194
|
},
|
|
5183
5195
|
onDestroy() {
|
|
5184
5196
|
this.$map.removeLayer(this.layer);
|
|
5185
5197
|
}
|
|
5186
|
-
}),
|
|
5198
|
+
}), os = w({
|
|
5187
5199
|
name: "tg-circle",
|
|
5188
5200
|
mixins: [P],
|
|
5189
5201
|
inheritAttrs: !1,
|
|
5190
5202
|
props: {
|
|
5191
|
-
center:
|
|
5192
|
-
radius:
|
|
5203
|
+
center: D(y),
|
|
5204
|
+
radius: D(Number),
|
|
5193
5205
|
clickable: m(Boolean),
|
|
5194
5206
|
editable: m(Boolean),
|
|
5195
5207
|
strokeColor: m(String),
|
|
@@ -5204,7 +5216,7 @@ const wr = /* @__PURE__ */ q(rs, [["render", is]]), ss = w({
|
|
|
5204
5216
|
emits: void 0,
|
|
5205
5217
|
setup(i, { attrs: t }) {
|
|
5206
5218
|
return {
|
|
5207
|
-
attrs:
|
|
5219
|
+
attrs: Y(t, i),
|
|
5208
5220
|
overlay: void 0,
|
|
5209
5221
|
emittedRadius: void 0,
|
|
5210
5222
|
emittedCenter: void 0
|
|
@@ -5214,7 +5226,7 @@ const wr = /* @__PURE__ */ q(rs, [["render", is]]), ss = w({
|
|
|
5214
5226
|
center(i) {
|
|
5215
5227
|
if (this.emittedCenter != null) {
|
|
5216
5228
|
const t = this.emittedCenter;
|
|
5217
|
-
if (this.emittedCenter = void 0, t ===
|
|
5229
|
+
if (this.emittedCenter = void 0, t === We(i))
|
|
5218
5230
|
return;
|
|
5219
5231
|
}
|
|
5220
5232
|
this.overlay.setCenter(i);
|
|
@@ -5253,7 +5265,7 @@ const wr = /* @__PURE__ */ q(rs, [["render", is]]), ss = w({
|
|
|
5253
5265
|
}
|
|
5254
5266
|
},
|
|
5255
5267
|
onCreate() {
|
|
5256
|
-
this.overlay = this.$map.createCircle(this), this.$map.addOverlay(this.overlay),
|
|
5268
|
+
this.overlay = this.$map.createCircle(this), this.$map.addOverlay(this.overlay), U(this.attrs.listeners, this.overlay), "update:center" in this.attrs.listenerProps && this.overlay.addEventListener("center-changed", () => {
|
|
5257
5269
|
this.$emit("update:center", this.emittedCenter = this.overlay.getCenter());
|
|
5258
5270
|
}), "update:radius" in this.attrs.listenerProps && this.overlay.addEventListener("radius-changed", () => {
|
|
5259
5271
|
this.$emit("update:radius", this.emittedRadius = this.overlay.getRadius());
|
|
@@ -5263,7 +5275,7 @@ const wr = /* @__PURE__ */ q(rs, [["render", is]]), ss = w({
|
|
|
5263
5275
|
this.$map.removeOverlay(this.overlay);
|
|
5264
5276
|
}
|
|
5265
5277
|
});
|
|
5266
|
-
class
|
|
5278
|
+
class as extends Bi {
|
|
5267
5279
|
constructor(t, e, r, s) {
|
|
5268
5280
|
super(t, e), this.content = r, this.position = s;
|
|
5269
5281
|
}
|
|
@@ -5278,12 +5290,12 @@ class os extends Bi {
|
|
|
5278
5290
|
this.position = t, this.draw();
|
|
5279
5291
|
}
|
|
5280
5292
|
}
|
|
5281
|
-
const
|
|
5293
|
+
const ls = w({
|
|
5282
5294
|
name: "tg-element-overlay",
|
|
5283
5295
|
mixins: [P],
|
|
5284
5296
|
props: {
|
|
5285
|
-
mapPane:
|
|
5286
|
-
position:
|
|
5297
|
+
mapPane: Z(Me, Me.overlayMouseTarget),
|
|
5298
|
+
position: D(y)
|
|
5287
5299
|
},
|
|
5288
5300
|
setup() {
|
|
5289
5301
|
return {
|
|
@@ -5304,25 +5316,25 @@ const as = w({
|
|
|
5304
5316
|
}
|
|
5305
5317
|
},
|
|
5306
5318
|
onCreate() {
|
|
5307
|
-
this.overlay = new
|
|
5319
|
+
this.overlay = new as(this.$map, this, this.content(), this.position), this.$map.addElementOverlay(this.overlay);
|
|
5308
5320
|
},
|
|
5309
5321
|
onDestroy() {
|
|
5310
5322
|
this.$map.removeElementOverlay(this.overlay);
|
|
5311
5323
|
}
|
|
5312
5324
|
});
|
|
5313
|
-
function
|
|
5314
|
-
return
|
|
5325
|
+
function hs(i, t, e, r, s, n) {
|
|
5326
|
+
return V(), F("div", ue({
|
|
5315
5327
|
class: i.$options.name
|
|
5316
5328
|
}, i.$attrs), [
|
|
5317
|
-
|
|
5329
|
+
W(i.$slots, "default")
|
|
5318
5330
|
], 16);
|
|
5319
5331
|
}
|
|
5320
|
-
const
|
|
5332
|
+
const cs = /* @__PURE__ */ q(ls, [["render", hs]]), ds = w({
|
|
5321
5333
|
name: "tg-marker",
|
|
5322
5334
|
mixins: [P],
|
|
5323
5335
|
inheritAttrs: !1,
|
|
5324
5336
|
props: {
|
|
5325
|
-
position:
|
|
5337
|
+
position: D(y),
|
|
5326
5338
|
title: m(String),
|
|
5327
5339
|
icon: m(Object),
|
|
5328
5340
|
clickable: m(Boolean),
|
|
@@ -5336,10 +5348,10 @@ const hs = /* @__PURE__ */ q(as, [["render", ls]]), cs = w({
|
|
|
5336
5348
|
emits: void 0,
|
|
5337
5349
|
setup(i, { attrs: t }) {
|
|
5338
5350
|
return {
|
|
5339
|
-
attrs:
|
|
5351
|
+
attrs: Y(t, i),
|
|
5340
5352
|
marker: void 0,
|
|
5341
|
-
label:
|
|
5342
|
-
info:
|
|
5353
|
+
label: et(),
|
|
5354
|
+
info: et(),
|
|
5343
5355
|
emittedPosition: void 0
|
|
5344
5356
|
};
|
|
5345
5357
|
},
|
|
@@ -5347,7 +5359,7 @@ const hs = /* @__PURE__ */ q(as, [["render", ls]]), cs = w({
|
|
|
5347
5359
|
position(i) {
|
|
5348
5360
|
if (this.emittedPosition != null) {
|
|
5349
5361
|
const t = this.emittedPosition;
|
|
5350
|
-
if (this.emittedPosition = void 0, t ===
|
|
5362
|
+
if (this.emittedPosition = void 0, t === We(i))
|
|
5351
5363
|
return;
|
|
5352
5364
|
}
|
|
5353
5365
|
this.marker.setPosition(i);
|
|
@@ -5359,7 +5371,7 @@ const hs = /* @__PURE__ */ q(as, [["render", ls]]), cs = w({
|
|
|
5359
5371
|
i ? this.marker.setIcon(i) : this.recreate();
|
|
5360
5372
|
},
|
|
5361
5373
|
clickable(i) {
|
|
5362
|
-
this.marker instanceof
|
|
5374
|
+
this.marker instanceof Ce ? this.recreate() : this.marker.setClickable(i);
|
|
5363
5375
|
},
|
|
5364
5376
|
draggable(i) {
|
|
5365
5377
|
this.marker.setDraggable(i);
|
|
@@ -5371,14 +5383,14 @@ const hs = /* @__PURE__ */ q(as, [["render", ls]]), cs = w({
|
|
|
5371
5383
|
this.recreate();
|
|
5372
5384
|
},
|
|
5373
5385
|
zIndex(i) {
|
|
5374
|
-
this.marker instanceof
|
|
5386
|
+
this.marker instanceof Ce ? this.recreate() : this.marker.setZIndex(i);
|
|
5375
5387
|
},
|
|
5376
5388
|
visible(i) {
|
|
5377
5389
|
this.marker.setVisible(i);
|
|
5378
5390
|
}
|
|
5379
5391
|
},
|
|
5380
5392
|
onCreate() {
|
|
5381
|
-
this.marker = this.$map.createMarker(this), this.label && this.marker.setLabel(this.label.overlay), this.$clusterer() ? this.$clusterer().onAddMarker(this.marker) : this.$map.addOverlay(this.marker), this.info && this.info.show && this.info.overlay.open(this.marker),
|
|
5393
|
+
this.marker = this.$map.createMarker(this), this.label && this.marker.setLabel(this.label.overlay), this.$clusterer() ? this.$clusterer().onAddMarker(this.marker) : this.$map.addOverlay(this.marker), this.info && this.info.show && this.info.overlay.open(this.marker), U(this.attrs.listeners, this.marker), "update:position" in this.attrs.listenerProps && this.marker.addEventListener("dragend", (i) => {
|
|
5382
5394
|
this.$emit("update:position", this.emittedPosition = i.position);
|
|
5383
5395
|
});
|
|
5384
5396
|
},
|
|
@@ -5387,7 +5399,7 @@ const hs = /* @__PURE__ */ q(as, [["render", ls]]), cs = w({
|
|
|
5387
5399
|
},
|
|
5388
5400
|
methods: {
|
|
5389
5401
|
$clusterer() {
|
|
5390
|
-
return
|
|
5402
|
+
return Le(this.$parent, Er);
|
|
5391
5403
|
},
|
|
5392
5404
|
onAddLabel(i) {
|
|
5393
5405
|
this.label = i, this.marker && this.marker.setLabel(i.overlay);
|
|
@@ -5406,19 +5418,19 @@ const hs = /* @__PURE__ */ q(as, [["render", ls]]), cs = w({
|
|
|
5406
5418
|
}
|
|
5407
5419
|
}
|
|
5408
5420
|
});
|
|
5409
|
-
function
|
|
5410
|
-
return
|
|
5421
|
+
function us(i, t, e, r, s, n) {
|
|
5422
|
+
return V(), F("div", ue({
|
|
5411
5423
|
class: i.$options.name
|
|
5412
5424
|
}, i.attrs.binds), [
|
|
5413
|
-
|
|
5425
|
+
W(i.$slots, "default")
|
|
5414
5426
|
], 16);
|
|
5415
5427
|
}
|
|
5416
|
-
const
|
|
5428
|
+
const Fe = /* @__PURE__ */ q(ds, [["render", us]]), ps = w({
|
|
5417
5429
|
name: "tg-info-box",
|
|
5418
5430
|
mixins: [P],
|
|
5419
5431
|
inheritAttrs: !1,
|
|
5420
5432
|
props: {
|
|
5421
|
-
show:
|
|
5433
|
+
show: D(Boolean),
|
|
5422
5434
|
position: m(y),
|
|
5423
5435
|
offset: m(Object),
|
|
5424
5436
|
maxWidth: m(Number),
|
|
@@ -5429,7 +5441,7 @@ const je = /* @__PURE__ */ q(cs, [["render", ds]]), us = w({
|
|
|
5429
5441
|
emits: void 0,
|
|
5430
5442
|
setup(i, { attrs: t }) {
|
|
5431
5443
|
return {
|
|
5432
|
-
attrs:
|
|
5444
|
+
attrs: Y(t, i),
|
|
5433
5445
|
overlay: void 0
|
|
5434
5446
|
};
|
|
5435
5447
|
},
|
|
@@ -5456,7 +5468,7 @@ const je = /* @__PURE__ */ q(cs, [["render", ds]]), us = w({
|
|
|
5456
5468
|
onCreate() {
|
|
5457
5469
|
this.overlay = this.$map.createInfoBox(this.getOptions()), this.$marker() ? this.$marker().onAddInfo(this) : this.show && this.overlay.open(), "update:show" in this.attrs.listenerProps && this.overlay.addEventListener("closeclick", () => {
|
|
5458
5470
|
this.$emit("update:show", !1);
|
|
5459
|
-
}),
|
|
5471
|
+
}), U(this.attrs.listeners, this.overlay);
|
|
5460
5472
|
},
|
|
5461
5473
|
onDestroy() {
|
|
5462
5474
|
this.$marker() ? this.$marker().onRemoveInfo(this) : this.overlay.close();
|
|
@@ -5476,7 +5488,7 @@ const je = /* @__PURE__ */ q(cs, [["render", ds]]), us = w({
|
|
|
5476
5488
|
return this.$el;
|
|
5477
5489
|
},
|
|
5478
5490
|
$marker() {
|
|
5479
|
-
return
|
|
5491
|
+
return Le(this.$parent, Fe);
|
|
5480
5492
|
},
|
|
5481
5493
|
open(i) {
|
|
5482
5494
|
this.overlay.open(i);
|
|
@@ -5486,19 +5498,19 @@ const je = /* @__PURE__ */ q(cs, [["render", ds]]), us = w({
|
|
|
5486
5498
|
}
|
|
5487
5499
|
}
|
|
5488
5500
|
});
|
|
5489
|
-
function
|
|
5490
|
-
return
|
|
5501
|
+
function gs(i, t, e, r, s, n) {
|
|
5502
|
+
return V(), F("div", ue({
|
|
5491
5503
|
class: i.$options.name
|
|
5492
5504
|
}, i.attrs.binds), [
|
|
5493
|
-
|
|
5505
|
+
W(i.$slots, "default")
|
|
5494
5506
|
], 16);
|
|
5495
5507
|
}
|
|
5496
|
-
const
|
|
5508
|
+
const ms = /* @__PURE__ */ q(ps, [["render", gs]]), fs = w({
|
|
5497
5509
|
name: "tg-info-window",
|
|
5498
5510
|
mixins: [P],
|
|
5499
5511
|
inheritAttrs: !1,
|
|
5500
5512
|
props: {
|
|
5501
|
-
show:
|
|
5513
|
+
show: D(Boolean),
|
|
5502
5514
|
position: m(y),
|
|
5503
5515
|
maxWidth: m(Number),
|
|
5504
5516
|
offset: m(Object),
|
|
@@ -5508,7 +5520,7 @@ const gs = /* @__PURE__ */ q(us, [["render", ps]]), ms = w({
|
|
|
5508
5520
|
emits: void 0,
|
|
5509
5521
|
setup(i, { attrs: t }) {
|
|
5510
5522
|
return {
|
|
5511
|
-
attrs:
|
|
5523
|
+
attrs: Y(t, i),
|
|
5512
5524
|
overlay: void 0
|
|
5513
5525
|
};
|
|
5514
5526
|
},
|
|
@@ -5534,7 +5546,7 @@ const gs = /* @__PURE__ */ q(us, [["render", ps]]), ms = w({
|
|
|
5534
5546
|
return this.$el;
|
|
5535
5547
|
},
|
|
5536
5548
|
$marker() {
|
|
5537
|
-
return
|
|
5549
|
+
return Le(this.$parent, Fe);
|
|
5538
5550
|
},
|
|
5539
5551
|
getOptions() {
|
|
5540
5552
|
return {
|
|
@@ -5551,22 +5563,22 @@ const gs = /* @__PURE__ */ q(us, [["render", ps]]), ms = w({
|
|
|
5551
5563
|
this.$emit("update:show", !0);
|
|
5552
5564
|
}), this.overlay.addEventListener("close", () => {
|
|
5553
5565
|
this.$emit("update:show", !1);
|
|
5554
|
-
}),
|
|
5566
|
+
}), U(this.attrs.listeners, this.overlay);
|
|
5555
5567
|
},
|
|
5556
5568
|
onDestroy() {
|
|
5557
5569
|
this.$marker() ? this.$marker().onRemoveInfo(this) : this.overlay.close();
|
|
5558
5570
|
}
|
|
5559
5571
|
});
|
|
5560
|
-
function
|
|
5561
|
-
return
|
|
5572
|
+
function ys(i, t, e, r, s, n) {
|
|
5573
|
+
return Nr((V(), F("div", ue({
|
|
5562
5574
|
class: i.$options.name
|
|
5563
5575
|
}, i.attrs.binds), [
|
|
5564
|
-
|
|
5576
|
+
W(i.$slots, "default")
|
|
5565
5577
|
], 16)), [
|
|
5566
|
-
[
|
|
5578
|
+
[Gr, i.show]
|
|
5567
5579
|
]);
|
|
5568
5580
|
}
|
|
5569
|
-
const
|
|
5581
|
+
const vs = /* @__PURE__ */ q(fs, [["render", ys]]), _s = w({
|
|
5570
5582
|
name: "tg-label",
|
|
5571
5583
|
mixins: [P],
|
|
5572
5584
|
inheritAttrs: !1,
|
|
@@ -5574,12 +5586,12 @@ const ys = /* @__PURE__ */ q(ms, [["render", fs]]), vs = w({
|
|
|
5574
5586
|
position: m(y),
|
|
5575
5587
|
offset: m(Object),
|
|
5576
5588
|
zIndex: m(Number),
|
|
5577
|
-
mapPane:
|
|
5589
|
+
mapPane: Z(Me)
|
|
5578
5590
|
},
|
|
5579
5591
|
emits: void 0,
|
|
5580
5592
|
setup(i, { attrs: t }) {
|
|
5581
5593
|
return {
|
|
5582
|
-
attrs:
|
|
5594
|
+
attrs: Y(t),
|
|
5583
5595
|
overlay: void 0
|
|
5584
5596
|
};
|
|
5585
5597
|
},
|
|
@@ -5609,7 +5621,7 @@ const ys = /* @__PURE__ */ q(ms, [["render", fs]]), vs = w({
|
|
|
5609
5621
|
return (i = this.$marker()) == null ? void 0 : i.marker;
|
|
5610
5622
|
},
|
|
5611
5623
|
$marker() {
|
|
5612
|
-
return
|
|
5624
|
+
return Le(this.$parent, Fe);
|
|
5613
5625
|
},
|
|
5614
5626
|
getOptions() {
|
|
5615
5627
|
return {
|
|
@@ -5622,25 +5634,25 @@ const ys = /* @__PURE__ */ q(ms, [["render", fs]]), vs = w({
|
|
|
5622
5634
|
}
|
|
5623
5635
|
},
|
|
5624
5636
|
onCreate() {
|
|
5625
|
-
this.overlay = this.$map.createLabel(this.getOptions()), this.$marker() ? this.$marker().onAddLabel(this) : this.$map.addOverlay(this.overlay),
|
|
5637
|
+
this.overlay = this.$map.createLabel(this.getOptions()), this.$marker() ? this.$marker().onAddLabel(this) : this.$map.addOverlay(this.overlay), U(this.attrs.listeners, this.overlay);
|
|
5626
5638
|
},
|
|
5627
5639
|
onDestroy() {
|
|
5628
5640
|
this.$marker() ? this.$marker().onRemoveLabel(this) : this.$map.removeOverlay(this.overlay);
|
|
5629
5641
|
}
|
|
5630
5642
|
});
|
|
5631
|
-
function
|
|
5632
|
-
return
|
|
5643
|
+
function bs(i, t, e, r, s, n) {
|
|
5644
|
+
return V(), F("div", ue({
|
|
5633
5645
|
class: i.$options.name
|
|
5634
5646
|
}, i.attrs.binds), [
|
|
5635
|
-
|
|
5647
|
+
W(i.$slots, "default")
|
|
5636
5648
|
], 16);
|
|
5637
5649
|
}
|
|
5638
|
-
const
|
|
5650
|
+
const Ts = /* @__PURE__ */ q(_s, [["render", bs]]), Ms = w({
|
|
5639
5651
|
name: "tg-polygon",
|
|
5640
5652
|
mixins: [P],
|
|
5641
5653
|
inheritAttrs: !1,
|
|
5642
5654
|
props: {
|
|
5643
|
-
paths:
|
|
5655
|
+
paths: D(Array),
|
|
5644
5656
|
clickable: m(Boolean),
|
|
5645
5657
|
editable: m(Boolean),
|
|
5646
5658
|
strokeColor: m(String),
|
|
@@ -5654,7 +5666,7 @@ const bs = /* @__PURE__ */ q(vs, [["render", _s]]), Ms = w({
|
|
|
5654
5666
|
emits: void 0,
|
|
5655
5667
|
setup(i, { attrs: t }) {
|
|
5656
5668
|
return {
|
|
5657
|
-
attrs:
|
|
5669
|
+
attrs: Y(t, i),
|
|
5658
5670
|
overlay: void 0,
|
|
5659
5671
|
emittedPaths: void 0
|
|
5660
5672
|
};
|
|
@@ -5664,7 +5676,7 @@ const bs = /* @__PURE__ */ q(vs, [["render", _s]]), Ms = w({
|
|
|
5664
5676
|
handler(i) {
|
|
5665
5677
|
if (this.emittedPaths != null) {
|
|
5666
5678
|
const t = this.emittedPaths;
|
|
5667
|
-
if (this.emittedPaths = void 0, t.length === i.length && t.every((e, r) => e ===
|
|
5679
|
+
if (this.emittedPaths = void 0, t.length === i.length && t.every((e, r) => e === We(i[r])))
|
|
5668
5680
|
return;
|
|
5669
5681
|
}
|
|
5670
5682
|
this.overlay.setPaths(i);
|
|
@@ -5697,19 +5709,19 @@ const bs = /* @__PURE__ */ q(vs, [["render", _s]]), Ms = w({
|
|
|
5697
5709
|
}
|
|
5698
5710
|
},
|
|
5699
5711
|
onCreate() {
|
|
5700
|
-
this.overlay = this.$map.createPolygon(this), this.$map.addOverlay(this.overlay),
|
|
5712
|
+
this.overlay = this.$map.createPolygon(this), this.$map.addOverlay(this.overlay), U(this.attrs.listeners, this.overlay), "update:paths" in this.attrs.listenerProps && this.overlay.addEventListener("paths-edited", () => {
|
|
5701
5713
|
this.$emit("update:paths", this.emittedPaths = this.overlay.getPaths());
|
|
5702
5714
|
});
|
|
5703
5715
|
},
|
|
5704
5716
|
onDestroy() {
|
|
5705
5717
|
this.$map.removeOverlay(this.overlay);
|
|
5706
5718
|
}
|
|
5707
|
-
}),
|
|
5719
|
+
}), Os = w({
|
|
5708
5720
|
name: "tg-polyline",
|
|
5709
5721
|
mixins: [P],
|
|
5710
5722
|
inheritAttrs: !1,
|
|
5711
5723
|
props: {
|
|
5712
|
-
path:
|
|
5724
|
+
path: D(Array),
|
|
5713
5725
|
clickable: m(Boolean),
|
|
5714
5726
|
editable: m(Boolean),
|
|
5715
5727
|
strokeColor: m(String),
|
|
@@ -5721,7 +5733,7 @@ const bs = /* @__PURE__ */ q(vs, [["render", _s]]), Ms = w({
|
|
|
5721
5733
|
emits: void 0,
|
|
5722
5734
|
setup(i, { attrs: t }) {
|
|
5723
5735
|
return {
|
|
5724
|
-
attrs:
|
|
5736
|
+
attrs: Y(t, i),
|
|
5725
5737
|
overlay: void 0,
|
|
5726
5738
|
emittedPath: void 0
|
|
5727
5739
|
};
|
|
@@ -5731,7 +5743,7 @@ const bs = /* @__PURE__ */ q(vs, [["render", _s]]), Ms = w({
|
|
|
5731
5743
|
handler(i) {
|
|
5732
5744
|
if (this.emittedPath != null) {
|
|
5733
5745
|
const t = this.emittedPath;
|
|
5734
|
-
if (this.emittedPath = void 0, t ===
|
|
5746
|
+
if (this.emittedPath = void 0, t === We(i))
|
|
5735
5747
|
return;
|
|
5736
5748
|
}
|
|
5737
5749
|
this.overlay.setPath(i);
|
|
@@ -5758,19 +5770,19 @@ const bs = /* @__PURE__ */ q(vs, [["render", _s]]), Ms = w({
|
|
|
5758
5770
|
}
|
|
5759
5771
|
},
|
|
5760
5772
|
onCreate() {
|
|
5761
|
-
this.overlay = this.$map.createPolyline(this), this.$map.addOverlay(this.overlay),
|
|
5773
|
+
this.overlay = this.$map.createPolyline(this), this.$map.addOverlay(this.overlay), U(this.attrs.listeners, this.overlay), "update:path" in this.attrs.listenerProps && this.overlay.addEventListener("path-edited", () => {
|
|
5762
5774
|
this.$emit("update:path", this.emittedPath = this.overlay.getPath());
|
|
5763
5775
|
});
|
|
5764
5776
|
},
|
|
5765
5777
|
onDestroy() {
|
|
5766
5778
|
this.$map.removeOverlay(this.overlay);
|
|
5767
5779
|
}
|
|
5768
|
-
}),
|
|
5780
|
+
}), Cs = w({
|
|
5769
5781
|
name: "tg-rectangle",
|
|
5770
5782
|
mixins: [P],
|
|
5771
5783
|
inheritAttrs: !1,
|
|
5772
5784
|
props: {
|
|
5773
|
-
bounds:
|
|
5785
|
+
bounds: D(Object),
|
|
5774
5786
|
clickable: m(Boolean),
|
|
5775
5787
|
editable: m(Boolean),
|
|
5776
5788
|
strokeColor: m(String),
|
|
@@ -5784,7 +5796,7 @@ const bs = /* @__PURE__ */ q(vs, [["render", _s]]), Ms = w({
|
|
|
5784
5796
|
emits: void 0,
|
|
5785
5797
|
setup(i, { attrs: t }) {
|
|
5786
5798
|
return {
|
|
5787
|
-
attrs:
|
|
5799
|
+
attrs: Y(t, i),
|
|
5788
5800
|
overlay: void 0,
|
|
5789
5801
|
emittedBounds: void 0
|
|
5790
5802
|
};
|
|
@@ -5824,21 +5836,21 @@ const bs = /* @__PURE__ */ q(vs, [["render", _s]]), Ms = w({
|
|
|
5824
5836
|
}
|
|
5825
5837
|
},
|
|
5826
5838
|
onCreate() {
|
|
5827
|
-
this.overlay = this.$map.createRectangle(this), this.$map.addOverlay(this.overlay),
|
|
5839
|
+
this.overlay = this.$map.createRectangle(this), this.$map.addOverlay(this.overlay), U(this.attrs.listeners, this.overlay), "update:bounds" in this.attrs.listenerProps && this.overlay.addEventListener("bounds-changed", () => {
|
|
5828
5840
|
this.$emit("update:bounds", this.emittedBounds = this.overlay.getBounds());
|
|
5829
5841
|
});
|
|
5830
5842
|
},
|
|
5831
5843
|
onDestroy() {
|
|
5832
5844
|
this.$map.removeOverlay(this.overlay);
|
|
5833
5845
|
}
|
|
5834
|
-
}),
|
|
5846
|
+
}), ws = ["beforeUpdate", "updated"], qs = {
|
|
5835
5847
|
install(i, t = {}) {
|
|
5836
5848
|
if (t.enable !== !1) {
|
|
5837
5849
|
const e = w({
|
|
5838
5850
|
beforeCreate() {
|
|
5839
|
-
const r =
|
|
5840
|
-
t.hookNames ? t.hookNames.includes(a) && console.debug("[lifecycle]", r, a) :
|
|
5841
|
-
} :
|
|
5851
|
+
const r = wr() ?? "", n = (t.nameRegex || /^[A-Z]/).test(r) ? (a) => {
|
|
5852
|
+
t.hookNames ? t.hookNames.includes(a) && console.debug("[lifecycle]", r, a) : ws.includes(a) || console.debug("[lifecycle]", r, a);
|
|
5853
|
+
} : ve;
|
|
5842
5854
|
n("beforeCreate"), this.__life_impl = n;
|
|
5843
5855
|
},
|
|
5844
5856
|
created() {
|
|
@@ -5877,184 +5889,184 @@ const bs = /* @__PURE__ */ q(vs, [["render", _s]]), Ms = w({
|
|
|
5877
5889
|
i.mixin(e);
|
|
5878
5890
|
}
|
|
5879
5891
|
}
|
|
5880
|
-
},
|
|
5881
|
-
function
|
|
5892
|
+
}, Es = 6378137;
|
|
5893
|
+
function ye(i) {
|
|
5882
5894
|
return i * Math.PI / 180;
|
|
5883
5895
|
}
|
|
5884
|
-
function
|
|
5896
|
+
function Vt(i) {
|
|
5885
5897
|
return i * 180 / Math.PI;
|
|
5886
5898
|
}
|
|
5887
|
-
function
|
|
5899
|
+
function Ls(i, t) {
|
|
5888
5900
|
if (i.lat === t.lat && i.lng === t.lng)
|
|
5889
5901
|
return 0;
|
|
5890
|
-
const e =
|
|
5891
|
-
let n = Math.sin(r), a = Math.sin(s),
|
|
5892
|
-
const o =
|
|
5893
|
-
n = n * n, a = a * a,
|
|
5894
|
-
const
|
|
5895
|
-
return _ * (1 + l * (
|
|
5896
|
-
}
|
|
5897
|
-
function
|
|
5898
|
-
const s = 63567523142e-4, n = 1 / 298.257223563, a =
|
|
5899
|
-
let v = 0, O = 0, x = 0, E = e / (s * g),
|
|
5900
|
-
for (; Math.abs(E -
|
|
5902
|
+
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), d = Math.sin(e);
|
|
5904
|
+
const o = Es, l = 1 / 298.257;
|
|
5905
|
+
n = n * n, a = a * a, d = d * d;
|
|
5906
|
+
const c = n * (1 - a) + (1 - d) * a, u = (1 - n) * (1 - a) + d * a, p = Math.atan(Math.sqrt(c / u)), b = Math.sqrt(c * u) / p, _ = 2 * p * o, T = (3 * b - 1) / 2 / u, g = (3 * b + 1) / 2 / c;
|
|
5907
|
+
return _ * (1 + l * (T * d * (1 - n) - g * (1 - d) * n));
|
|
5908
|
+
}
|
|
5909
|
+
function xs(i, t, e) {
|
|
5910
|
+
const s = 63567523142e-4, n = 1 / 298.257223563, a = ye(t), d = Math.sin(a), o = Math.cos(a), l = (1 - n) * Math.tan(ye(i.lat)), c = 1 / Math.sqrt(1 + l * l), u = l * c, p = Math.atan2(l, o), b = c * d, _ = 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)));
|
|
5911
|
+
let v = 0, O = 0, x = 0, E = e / (s * g), Q = 2 * Math.PI;
|
|
5912
|
+
for (; Math.abs(E - Q) > 1e-12; ) {
|
|
5901
5913
|
v = Math.cos(2 * p + E), O = Math.sin(E), x = Math.cos(E);
|
|
5902
|
-
const
|
|
5903
|
-
|
|
5904
|
-
}
|
|
5905
|
-
const
|
|
5906
|
-
u * x +
|
|
5907
|
-
(1 - n) * Math.sqrt(b * b +
|
|
5908
|
-
),
|
|
5909
|
-
return { lng: i.lng +
|
|
5910
|
-
}
|
|
5911
|
-
const
|
|
5912
|
-
getDistance:
|
|
5913
|
-
getDestination:
|
|
5914
|
-
},
|
|
5914
|
+
const Pr = f * O * (v + f / 4 * (x * (-1 + 2 * v * v) - f / 6 * v * (-3 + 4 * O * O) * (-3 + 4 * v * v)));
|
|
5915
|
+
Q = E, E = e / (s * g) + Pr;
|
|
5916
|
+
}
|
|
5917
|
+
const ie = u * O - c * x * o, Ue = Math.atan2(
|
|
5918
|
+
u * x + c * O * o,
|
|
5919
|
+
(1 - n) * Math.sqrt(b * b + ie * ie)
|
|
5920
|
+
), Lr = Math.atan2(O * d, c * x - u * O * o), Ye = n / 16 * _ * (4 + n * (4 - 3 * _)), xr = Lr - (1 - Ye) * n * b * (E + Ye * O * (v + Ye * x * (-1 + 2 * v * v)));
|
|
5921
|
+
return { lng: i.lng + Vt(xr), lat: Vt(Ue) };
|
|
5922
|
+
}
|
|
5923
|
+
const Ks = {
|
|
5924
|
+
getDistance: Ls,
|
|
5925
|
+
getDestination: xs
|
|
5926
|
+
}, Xs = {
|
|
5915
5927
|
install(i, t) {
|
|
5916
|
-
if (
|
|
5917
|
-
const r = /* @__PURE__ */ Object.assign({ "./TgMap.vue":
|
|
5928
|
+
if (ni(t), {}.VITE_FALSE) {
|
|
5929
|
+
const r = /* @__PURE__ */ Object.assign({ "./TgMap.vue": Cr, "./TgMapWidget.vue": qi, "./controls/TgCustomControl.vue": Ji, "./controls/TgMapTypeControl.vue": Qi, "./controls/TgScaleControl.vue": es, "./controls/TgZoomControl.vue": rs, "./extra/TgMarkerClusterer.vue": Er, "./layers/TgTrafficLayer.vue": ns, "./overlays/TgCircle.vue": os, "./overlays/TgElementOverlay.vue": cs, "./overlays/TgInfoBox.vue": ms, "./overlays/TgInfoWindow.vue": vs, "./overlays/TgLabel.vue": Ts, "./overlays/TgMarker.vue": Fe, "./overlays/TgPolygon.vue": Ms, "./overlays/TgPolyline.vue": Os, "./overlays/TgRectangle.vue": Cs });
|
|
5918
5930
|
Object.keys(r).forEach((s) => {
|
|
5919
5931
|
const n = r[s];
|
|
5920
5932
|
i.component(n.name ?? C(`Tg开头的组件必须设置name: ${s}`), n);
|
|
5921
5933
|
});
|
|
5922
5934
|
}
|
|
5923
5935
|
const e = i.config.optionMergeStrategies;
|
|
5924
|
-
e[
|
|
5936
|
+
e[we] = e[Ee] = (r, s) => r ? [...new Set([].concat(r, s))] : Array.isArray(s) ? s : [s];
|
|
5925
5937
|
}
|
|
5926
5938
|
};
|
|
5927
5939
|
export {
|
|
5928
|
-
|
|
5929
|
-
|
|
5930
|
-
|
|
5931
|
-
|
|
5932
|
-
|
|
5933
|
-
|
|
5934
|
-
|
|
5935
|
-
|
|
5936
|
-
|
|
5937
|
-
|
|
5940
|
+
sr as AbstractControl,
|
|
5941
|
+
gt as AbstractMap,
|
|
5942
|
+
he as Arrays,
|
|
5943
|
+
cr as Autocomplete,
|
|
5944
|
+
mi as BaiduAutocomplete,
|
|
5945
|
+
ft as BaiduCircle,
|
|
5946
|
+
ot as BaiduControl,
|
|
5947
|
+
Tt as BaiduInfoBoxOverlay,
|
|
5948
|
+
_t as BaiduInfoWindow,
|
|
5949
|
+
lt as BaiduMapTypeControl,
|
|
5938
5950
|
Be as BaiduMapUrls,
|
|
5939
|
-
|
|
5940
|
-
|
|
5941
|
-
|
|
5942
|
-
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
|
|
5946
|
-
|
|
5947
|
-
|
|
5948
|
-
|
|
5949
|
-
|
|
5951
|
+
Ce as BaiduMarker,
|
|
5952
|
+
bi as BaiduMarkerClusterer,
|
|
5953
|
+
je as BaiduOverlay,
|
|
5954
|
+
Oi as BaiduPlacesService,
|
|
5955
|
+
Et as BaiduPolyShape,
|
|
5956
|
+
Pt as BaiduPolygon,
|
|
5957
|
+
Lt as BaiduPolyline,
|
|
5958
|
+
It as BaiduRectangle,
|
|
5959
|
+
ht as BaiduScaleControl,
|
|
5960
|
+
wi as BaiduSearchBox,
|
|
5961
|
+
dt as BaiduZoomControl,
|
|
5950
5962
|
S as BuildInMapType,
|
|
5951
|
-
|
|
5952
|
-
|
|
5953
|
-
|
|
5954
|
-
|
|
5963
|
+
nr as BuildInMapTypeId,
|
|
5964
|
+
fe as CachedValue,
|
|
5965
|
+
I as ControlPosition,
|
|
5966
|
+
$ as ControlPositionConverter,
|
|
5955
5967
|
B as CoordType,
|
|
5956
|
-
|
|
5957
|
-
|
|
5958
|
-
|
|
5959
|
-
|
|
5960
|
-
|
|
5961
|
-
|
|
5962
|
-
|
|
5963
|
-
|
|
5964
|
-
|
|
5965
|
-
|
|
5966
|
-
|
|
5967
|
-
|
|
5968
|
+
hi as CustomControl,
|
|
5969
|
+
li as FastFindValues,
|
|
5970
|
+
gi as GoogleAutocomplete,
|
|
5971
|
+
yt as GoogleCircle,
|
|
5972
|
+
at as GoogleControl,
|
|
5973
|
+
Mt as GoogleInfoBoxOverlay,
|
|
5974
|
+
bt as GoogleInfoWindow,
|
|
5975
|
+
ke as GoogleMapTypeControl,
|
|
5976
|
+
Ie as GoogleMapUrls,
|
|
5977
|
+
wt as GoogleMarker,
|
|
5978
|
+
Ti as GoogleMarkerClusterer,
|
|
5979
|
+
mt as GoogleOverlay,
|
|
5968
5980
|
Mi as GooglePlacesService,
|
|
5969
|
-
|
|
5970
|
-
|
|
5971
|
-
|
|
5972
|
-
|
|
5973
|
-
|
|
5974
|
-
|
|
5975
|
-
|
|
5976
|
-
|
|
5977
|
-
|
|
5978
|
-
|
|
5981
|
+
kt as GooglePolygon,
|
|
5982
|
+
xt as GooglePolyline,
|
|
5983
|
+
Bt as GoogleRectangle,
|
|
5984
|
+
ct as GoogleScaleControl,
|
|
5985
|
+
Ci as GoogleSearchBox,
|
|
5986
|
+
ut as GoogleZoomControl,
|
|
5987
|
+
De as Icon,
|
|
5988
|
+
Ns as ImageMapType,
|
|
5989
|
+
vt as InfoWindow,
|
|
5990
|
+
Nt as KeyValue,
|
|
5979
5991
|
y as LatLng,
|
|
5980
|
-
|
|
5992
|
+
A as LatLngBounds,
|
|
5981
5993
|
qs as LifecycleLogPlugin,
|
|
5982
|
-
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
|
|
5986
|
-
|
|
5994
|
+
K as Location,
|
|
5995
|
+
we as MIXIN_HOOK_CREATE,
|
|
5996
|
+
Ee as MIXIN_HOOK_DESTROY,
|
|
5997
|
+
St as MIXIN_MAP_NAME,
|
|
5998
|
+
ce as MVCArrays,
|
|
5987
5999
|
P as MapMixin,
|
|
5988
|
-
|
|
5989
|
-
|
|
5990
|
-
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
|
|
5994
|
-
|
|
5995
|
-
|
|
5996
|
-
|
|
5997
|
-
|
|
5998
|
-
|
|
5999
|
-
|
|
6000
|
-
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
|
|
6005
|
-
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
|
|
6011
|
-
|
|
6000
|
+
R as MapType,
|
|
6001
|
+
or as MapTypeControlType,
|
|
6002
|
+
dr as MapUrls,
|
|
6003
|
+
Ei as MapZoom,
|
|
6004
|
+
yr as MarkerClusterer,
|
|
6005
|
+
be as Objects,
|
|
6006
|
+
Tr as Overlay,
|
|
6007
|
+
vr as PlacesService,
|
|
6008
|
+
X as Point,
|
|
6009
|
+
_r as SearchBox,
|
|
6010
|
+
Ks as SphericalUtils,
|
|
6011
|
+
Te as Strings,
|
|
6012
|
+
ze as SymbolIcon,
|
|
6013
|
+
Hs as SymbolPath,
|
|
6014
|
+
os as TgCircle,
|
|
6015
|
+
Ji as TgCustomControl,
|
|
6016
|
+
cs as TgElementOverlay,
|
|
6017
|
+
ms as TgInfoBox,
|
|
6018
|
+
vs as TgInfoWindow,
|
|
6019
|
+
Ts as TgLabel,
|
|
6020
|
+
Cr as TgMap,
|
|
6021
|
+
it as TgMapFactory,
|
|
6022
|
+
G as TgMapType,
|
|
6023
|
+
Qi as TgMapTypeControl,
|
|
6012
6024
|
qi as TgMapWidget,
|
|
6013
|
-
|
|
6014
|
-
|
|
6025
|
+
Fe as TgMarker,
|
|
6026
|
+
Er as TgMarkerClusterer,
|
|
6015
6027
|
Ms as TgPolygon,
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6028
|
+
Os as TgPolyline,
|
|
6029
|
+
Cs as TgRectangle,
|
|
6030
|
+
es as TgScaleControl,
|
|
6031
|
+
ns as TgTrafficLayer,
|
|
6032
|
+
rs as TgZoomControl,
|
|
6033
|
+
ci as TrafficLayer,
|
|
6034
|
+
$e as UnionIcon,
|
|
6035
|
+
oe as assert,
|
|
6036
|
+
Qe as assertNever,
|
|
6037
|
+
Pe as callHook,
|
|
6038
|
+
js as computedSaveOnThis,
|
|
6039
|
+
Or as createEmptyVNode,
|
|
6040
|
+
Wi as createPropertyObject,
|
|
6041
|
+
Vs as createPropertyObjectTyped,
|
|
6042
|
+
Ds as debug,
|
|
6043
|
+
Xs as default,
|
|
6032
6044
|
L as eventProp,
|
|
6033
|
-
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
|
|
6045
|
+
Us as extractVNodeFromSlotsByComponent,
|
|
6046
|
+
Fs as findByComponentType,
|
|
6047
|
+
xs as getDestination,
|
|
6048
|
+
er as getTgMapConfig,
|
|
6049
|
+
zs as isDef,
|
|
6050
|
+
Kt as isEntryValueDef,
|
|
6039
6051
|
Ss as isInstanceOf,
|
|
6040
6052
|
Bs as lateinit,
|
|
6041
|
-
|
|
6053
|
+
ve as noop,
|
|
6042
6054
|
m as optionalProp,
|
|
6043
|
-
|
|
6044
|
-
|
|
6045
|
-
|
|
6046
|
-
|
|
6047
|
-
|
|
6048
|
-
|
|
6049
|
-
|
|
6050
|
-
|
|
6055
|
+
Ii as path,
|
|
6056
|
+
D as requiredProp,
|
|
6057
|
+
As as safeAs,
|
|
6058
|
+
Le as safeAsComponent,
|
|
6059
|
+
ni as setTgMapConfig,
|
|
6060
|
+
Hi as splitAttrs,
|
|
6061
|
+
Z as stringEnumProp,
|
|
6062
|
+
Zi as stringUnionPropFromValues,
|
|
6051
6063
|
C as throwError,
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6064
|
+
nt as throwUnsupported,
|
|
6065
|
+
$s as todo,
|
|
6066
|
+
et as typed,
|
|
6067
|
+
Rs as unwrapStringEnumValue,
|
|
6068
|
+
Ys as useEventLogMethods,
|
|
6069
|
+
Y as useSplittedAttrs,
|
|
6070
|
+
ts as useTgMapInner
|
|
6059
6071
|
};
|
|
6060
6072
|
//# sourceMappingURL=tg-map.js.map
|