tg-map-vue3 3.1.2 → 3.1.4
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/dist/src/components/index.d.ts +2 -0
- package/dist/src/utils/spherical-utils.d.ts +20 -0
- package/dist/tg-map.js +1031 -995
- package/dist/tg-map.js.map +1 -1
- package/dist/tg-map.umd.cjs +4 -4
- package/dist/tg-map.umd.cjs.map +1 -1
- package/package.json +7 -2
package/dist/tg-map.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
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)}.tg-map{height:100vh;position:relative}.tg-map__map{width:100%;height:100%}.tg-map-widget{position:absolute}.tg-map>.tg-custom-control{display:none}.element-overlay{position:absolute}.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 qt = Object.defineProperty;
|
|
3
|
+
var Kt = (i, e, t) => e in i ? qt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
4
|
+
var d = (i, e, t) => (Kt(i, typeof e != "symbol" ? e + "" : e, t), t);
|
|
5
|
+
import { createCommentVNode as Se, computed as xt, defineComponent as C, markRaw as Xt, openBlock as G, createElementBlock as j, mergeProps as ne, createElementVNode as Jt, renderSlot as z, normalizeClass as je, normalizeStyle as Qt, withDirectives as er, vShow as tr, getCurrentInstance as yt } from "vue";
|
|
6
|
+
function U(i, e, t) {
|
|
7
7
|
Object.keys(i).forEach((r) => {
|
|
8
8
|
r.startsWith("update:") || t != null && t.includes(r) || e.addEventListener(r, i[r]);
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
|
-
let
|
|
12
|
-
function
|
|
13
|
-
return
|
|
11
|
+
let rr = 1;
|
|
12
|
+
function ir() {
|
|
13
|
+
return rr++;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
return e.__id__ || (e.__id__ =
|
|
15
|
+
function _e(i, e) {
|
|
16
|
+
return e.__id__ || (e.__id__ = ir()), `${i}::${e.__id__}`;
|
|
17
17
|
}
|
|
18
|
-
var
|
|
18
|
+
var Et = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, W = {}, sr = {
|
|
19
19
|
get exports() {
|
|
20
|
-
return
|
|
20
|
+
return W;
|
|
21
21
|
},
|
|
22
22
|
set exports(i) {
|
|
23
|
-
|
|
23
|
+
W = i;
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
(function(i) {
|
|
27
27
|
(function(e, t) {
|
|
28
28
|
i.exports ? i.exports = t() : e.coordtransform = t();
|
|
29
|
-
})(
|
|
29
|
+
})(Et, function() {
|
|
30
30
|
var e = 52.35987755982988, t = 3.141592653589793, r = 6378245, s = 0.006693421622965943;
|
|
31
|
-
function n(
|
|
32
|
-
this.west = Math.min(
|
|
31
|
+
function n(g, m, y, O) {
|
|
32
|
+
this.west = Math.min(g, y), this.north = Math.max(m, O), this.east = Math.max(g, y), this.south = Math.min(m, O);
|
|
33
33
|
}
|
|
34
|
-
n.prototype.contain = function(
|
|
35
|
-
return this.west <=
|
|
34
|
+
n.prototype.contain = function(g, m) {
|
|
35
|
+
return this.west <= g && this.east >= g && this.north >= m && this.south <= m;
|
|
36
36
|
};
|
|
37
37
|
var a = [
|
|
38
38
|
new n(79.4462, 49.2204, 96.33, 42.8899),
|
|
@@ -41,7 +41,7 @@ var Ot = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
41
41
|
new n(82.9684, 29.5297, 97.0352, 26.7186),
|
|
42
42
|
new n(97.0253, 29.5297, 124.367395, 20.414096),
|
|
43
43
|
new n(107.975793, 20.414096, 111.744104, 17.871542)
|
|
44
|
-
],
|
|
44
|
+
], c = [
|
|
45
45
|
new n(119.921265, 25.398623, 122.497559, 21.785006),
|
|
46
46
|
new n(101.8652, 22.284, 106.665, 20.0988),
|
|
47
47
|
new n(106.4525, 21.5422, 108.051, 20.4878),
|
|
@@ -50,129 +50,129 @@ var Ot = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
50
50
|
new n(131.2662, 44.8922, 137.0227, 42.5692),
|
|
51
51
|
new n(73.1246, 35.398637, 77.948114, 29.5297)
|
|
52
52
|
];
|
|
53
|
-
function o(
|
|
54
|
-
for (var
|
|
55
|
-
if (a[
|
|
56
|
-
for (var O = 0; O <
|
|
57
|
-
if (
|
|
53
|
+
function o(g, m) {
|
|
54
|
+
for (var y = 0; y < a.length; y++)
|
|
55
|
+
if (a[y].contain(g, m)) {
|
|
56
|
+
for (var O = 0; O < c.length; O++)
|
|
57
|
+
if (c[O].contain(g, m))
|
|
58
58
|
return !1;
|
|
59
59
|
return !0;
|
|
60
60
|
}
|
|
61
61
|
return !1;
|
|
62
62
|
}
|
|
63
|
-
function l(
|
|
64
|
-
var
|
|
65
|
-
return [
|
|
63
|
+
function l(g, m) {
|
|
64
|
+
var y = g - 65e-4, O = m - 6e-3, x = Math.sqrt(y * y + O * O) - 2e-5 * Math.sin(O * e), w = Math.atan2(O, y) - 3e-6 * Math.cos(y * e), q = x * Math.cos(w), Q = x * Math.sin(w);
|
|
65
|
+
return [q, Q];
|
|
66
66
|
}
|
|
67
|
-
function
|
|
68
|
-
var
|
|
69
|
-
return [
|
|
67
|
+
function h(g, m) {
|
|
68
|
+
var y = Math.sqrt(g * g + m * m) + 2e-5 * Math.sin(m * e), O = Math.atan2(m, g) + 3e-6 * Math.cos(g * e), x = y * Math.cos(O) + 65e-4, w = y * Math.sin(O) + 6e-3;
|
|
69
|
+
return [x, w];
|
|
70
70
|
}
|
|
71
|
-
function g
|
|
72
|
-
return o(
|
|
71
|
+
function u(g, m) {
|
|
72
|
+
return o(g, m) ? b(g, m) : [g, m];
|
|
73
73
|
}
|
|
74
|
-
function p(
|
|
75
|
-
if (!o(
|
|
76
|
-
return [
|
|
77
|
-
var
|
|
78
|
-
return [
|
|
74
|
+
function p(g, m) {
|
|
75
|
+
if (!o(g, m))
|
|
76
|
+
return [g, m];
|
|
77
|
+
var y = b(g, m);
|
|
78
|
+
return [g * 2 - y[0], m * 2 - y[1]];
|
|
79
79
|
}
|
|
80
|
-
function b(
|
|
81
|
-
var
|
|
82
|
-
|
|
83
|
-
var
|
|
84
|
-
|
|
85
|
-
var
|
|
86
|
-
return [
|
|
80
|
+
function b(g, m) {
|
|
81
|
+
var y = _(g - 105, m - 35), O = M(g - 105, m - 35), x = m / 180 * t, w = Math.sin(x);
|
|
82
|
+
w = 1 - s * w * w;
|
|
83
|
+
var q = Math.sqrt(w);
|
|
84
|
+
y = y * 180 / (r * (1 - s) / (w * q) * t), O = O * 180 / (r / q * Math.cos(x) * t);
|
|
85
|
+
var Q = m + y, ke = g + O;
|
|
86
|
+
return [ke, Q];
|
|
87
87
|
}
|
|
88
|
-
function
|
|
89
|
-
var
|
|
90
|
-
return
|
|
88
|
+
function _(g, m) {
|
|
89
|
+
var y = -100 + 2 * g + 3 * m + 0.2 * m * m + 0.1 * g * m + 0.2 * Math.sqrt(Math.abs(g));
|
|
90
|
+
return y += (20 * Math.sin(6 * g * t) + 20 * Math.sin(2 * g * t)) * 2 / 3, y += (20 * Math.sin(m * t) + 40 * Math.sin(m / 3 * t)) * 2 / 3, y += (160 * Math.sin(m / 12 * t) + 320 * Math.sin(m * t / 30)) * 2 / 3, y;
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
var
|
|
94
|
-
return
|
|
92
|
+
function M(g, m) {
|
|
93
|
+
var y = 300 + g + 2 * m + 0.1 * g * g + 0.1 * g * m + 0.1 * Math.sqrt(Math.abs(g));
|
|
94
|
+
return y += (20 * Math.sin(6 * g * t) + 20 * Math.sin(2 * g * t)) * 2 / 3, y += (20 * Math.sin(g * t) + 40 * Math.sin(g / 3 * t)) * 2 / 3, y += (150 * Math.sin(g / 12 * t) + 300 * Math.sin(g / 30 * t)) * 2 / 3, y;
|
|
95
95
|
}
|
|
96
96
|
return {
|
|
97
97
|
// 向前兼容
|
|
98
98
|
bd09togcj02: l,
|
|
99
|
-
gcj02tobd09:
|
|
100
|
-
wgs84togcj02:
|
|
99
|
+
gcj02tobd09: h,
|
|
100
|
+
wgs84togcj02: u,
|
|
101
101
|
gcj02towgs84: p,
|
|
102
102
|
// 小驼峰命名风格
|
|
103
103
|
bd09ToGcj02: l,
|
|
104
|
-
gcj02ToBd09:
|
|
105
|
-
wgs84ToGcj02:
|
|
104
|
+
gcj02ToBd09: h,
|
|
105
|
+
wgs84ToGcj02: u,
|
|
106
106
|
gcj02ToWgs84: p,
|
|
107
|
-
bd09ToWgs84: function(
|
|
108
|
-
if (!o(
|
|
109
|
-
return [
|
|
110
|
-
var
|
|
111
|
-
return p(
|
|
107
|
+
bd09ToWgs84: function(g, m) {
|
|
108
|
+
if (!o(g, m))
|
|
109
|
+
return [g, m];
|
|
110
|
+
var y = l(g, m);
|
|
111
|
+
return p(y[0], y[1]);
|
|
112
112
|
},
|
|
113
|
-
wgs84ToBd09: function(
|
|
114
|
-
if (!o(
|
|
115
|
-
return [
|
|
116
|
-
var
|
|
117
|
-
return
|
|
113
|
+
wgs84ToBd09: function(g, m) {
|
|
114
|
+
if (!o(g, m))
|
|
115
|
+
return [g, m];
|
|
116
|
+
var y = u(g, m);
|
|
117
|
+
return h(y[0], y[1]);
|
|
118
118
|
}
|
|
119
119
|
};
|
|
120
120
|
});
|
|
121
|
-
})(
|
|
122
|
-
function
|
|
121
|
+
})(sr);
|
|
122
|
+
function L(i) {
|
|
123
123
|
throw new Error(i);
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function nr(i) {
|
|
126
126
|
throw new Error(`Unsupported: ${i}`);
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function Ci(i) {
|
|
129
129
|
throw new Error(`todo: ${i}`);
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function xi(i) {
|
|
132
132
|
return i;
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function Me(...i) {
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function Ei(i) {
|
|
137
137
|
return i != null;
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function he(i, e) {
|
|
140
140
|
if (!i)
|
|
141
141
|
throw new Error(`AssertionError: ${e}`);
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function vt(i) {
|
|
144
144
|
throw new Error(`Unexpected object: ${i}`);
|
|
145
145
|
}
|
|
146
|
-
var
|
|
147
|
-
const
|
|
146
|
+
var X = /* @__PURE__ */ ((i) => (i.wgs84 = "wgs84", i.gcj02 = "gcj02", i.bd09 = "bd09", i))(X || {});
|
|
147
|
+
const Ie = "wgs84", A = class {
|
|
148
148
|
constructor(e, t, r) {
|
|
149
149
|
this.lat = e, this.lng = t, this.coord = r;
|
|
150
150
|
}
|
|
151
151
|
/** @param coord Baidu Map的坐标一般都是bd09 */
|
|
152
152
|
static fromBaidu(e, t) {
|
|
153
|
-
return new
|
|
153
|
+
return new A(e.lat, e.lng, t);
|
|
154
154
|
}
|
|
155
155
|
/** @param coord Google Map的坐标依据地图类型不同是不一样的 */
|
|
156
156
|
static fromGoogle(e, t) {
|
|
157
|
-
return new
|
|
157
|
+
return new A(e.lat(), e.lng(), t);
|
|
158
158
|
}
|
|
159
159
|
static fromHere(e, t) {
|
|
160
|
-
return new
|
|
160
|
+
return new A(e.lat, e.lng, t);
|
|
161
161
|
}
|
|
162
162
|
static fromLiteral(e) {
|
|
163
|
-
return new
|
|
163
|
+
return new A(e.lat, e.lng, e.coord || Ie);
|
|
164
164
|
}
|
|
165
|
-
static fromLngLat(e, t, r =
|
|
166
|
-
return new
|
|
165
|
+
static fromLngLat(e, t, r = Ie) {
|
|
166
|
+
return new A(t, e, r);
|
|
167
167
|
}
|
|
168
|
-
static create(e, t, r =
|
|
169
|
-
return new
|
|
168
|
+
static create(e, t, r = Ie) {
|
|
169
|
+
return new A(e, t, r);
|
|
170
170
|
}
|
|
171
171
|
to(e) {
|
|
172
172
|
if (this.coord === e)
|
|
173
173
|
return this;
|
|
174
174
|
const [t, r] = this.convert(e);
|
|
175
|
-
return new
|
|
175
|
+
return new A(r, t, e);
|
|
176
176
|
}
|
|
177
177
|
toBaidu(e) {
|
|
178
178
|
let t = this.lat, r = this.lng;
|
|
@@ -197,11 +197,11 @@ const Ee = "wgs84", S = class {
|
|
|
197
197
|
convert(e) {
|
|
198
198
|
switch (this.coord) {
|
|
199
199
|
case "bd09":
|
|
200
|
-
return e === "gcj02" ?
|
|
200
|
+
return e === "gcj02" ? W.bd09ToGcj02(this.lng, this.lat) : W.bd09ToWgs84(this.lng, this.lat);
|
|
201
201
|
case "gcj02":
|
|
202
|
-
return e === "wgs84" ?
|
|
202
|
+
return e === "wgs84" ? W.gcj02ToWgs84(this.lng, this.lat) : W.gcj02ToBd09(this.lng, this.lat);
|
|
203
203
|
case "wgs84":
|
|
204
|
-
return e === "bd09" ?
|
|
204
|
+
return e === "bd09" ? W.wgs84ToBd09(this.lng, this.lat) : W.wgs84ToGcj02(this.lng, this.lat);
|
|
205
205
|
}
|
|
206
206
|
throw new Error(`不支持的坐标转换: ${this.coord}=>${e}`);
|
|
207
207
|
}
|
|
@@ -212,8 +212,8 @@ const Ee = "wgs84", S = class {
|
|
|
212
212
|
return JSON.stringify(this);
|
|
213
213
|
}
|
|
214
214
|
};
|
|
215
|
-
let
|
|
216
|
-
|
|
215
|
+
let v = A;
|
|
216
|
+
d(v, "ZERO", A.create(0, 0));
|
|
217
217
|
const K = class {
|
|
218
218
|
/**
|
|
219
219
|
* 不推荐直接创建LatLngBounds, sw和ne的大小关系可能没法保证, 推荐用LatLngBounds.Builder或者LatLngBounds.from等静态方法来创建
|
|
@@ -221,8 +221,8 @@ const K = class {
|
|
|
221
221
|
* @param ne 东北, lat/lng更大
|
|
222
222
|
*/
|
|
223
223
|
constructor(e, t) {
|
|
224
|
-
|
|
225
|
-
this.sw = e, this.ne = t,
|
|
224
|
+
d(this, "coord");
|
|
225
|
+
this.sw = e, this.ne = t, he(e.coord === t.coord, "sw和ne的coord应该相同"), he(Number.isFinite(e.lat) && Number.isFinite(e.lng) && Number.isFinite(t.lat) && Number.isFinite(t.lng), `sw(${e})和ne(${t})不能包含NaN或Infinite`), he(e.lat <= t.lat, `sw.lat(${e.lat})应该比ne.lat(${t.lat})小`), this.coord = e.coord;
|
|
226
226
|
}
|
|
227
227
|
static isBetweenLng(e, t, r) {
|
|
228
228
|
return e <= t ? e <= r && r <= t : e <= r || r <= t;
|
|
@@ -236,18 +236,18 @@ const K = class {
|
|
|
236
236
|
return t.build();
|
|
237
237
|
}
|
|
238
238
|
static from(...e) {
|
|
239
|
-
return this.fromArray(e) ??
|
|
239
|
+
return this.fromArray(e) ?? L("positions中没有点");
|
|
240
240
|
}
|
|
241
241
|
static fromGoogle(e, t) {
|
|
242
242
|
return new K(
|
|
243
|
-
|
|
244
|
-
|
|
243
|
+
v.fromGoogle(e.getSouthWest(), t),
|
|
244
|
+
v.fromGoogle(e.getNorthEast(), t)
|
|
245
245
|
);
|
|
246
246
|
}
|
|
247
247
|
static fromBaidu(e, t) {
|
|
248
248
|
return new K(
|
|
249
|
-
|
|
250
|
-
|
|
249
|
+
v.fromBaidu(e.getSouthWest(), t),
|
|
250
|
+
v.fromBaidu(e.getNorthEast(), t)
|
|
251
251
|
);
|
|
252
252
|
}
|
|
253
253
|
static create(e, t) {
|
|
@@ -262,7 +262,7 @@ const K = class {
|
|
|
262
262
|
}
|
|
263
263
|
getCenter() {
|
|
264
264
|
const e = (this.sw.lat + this.ne.lat) / 2, t = (this.sw.lng + this.ne.lng + (this.sw.lng < this.ne.lng ? 0 : 360)) / 2;
|
|
265
|
-
return
|
|
265
|
+
return v.create(e, t, this.coord);
|
|
266
266
|
}
|
|
267
267
|
toString() {
|
|
268
268
|
return JSON.stringify(this);
|
|
@@ -280,24 +280,24 @@ const K = class {
|
|
|
280
280
|
return [this.sw.toBaidu(e), this.ne.toBaidu(e)];
|
|
281
281
|
}
|
|
282
282
|
};
|
|
283
|
-
let
|
|
284
|
-
|
|
283
|
+
let F = K;
|
|
284
|
+
d(F, "EMPTY", new K(v.ZERO, v.ZERO));
|
|
285
285
|
((i) => {
|
|
286
286
|
class e {
|
|
287
287
|
constructor(r) {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
288
|
+
d(this, "coord");
|
|
289
|
+
d(this, "minLat");
|
|
290
|
+
d(this, "minLng");
|
|
291
|
+
d(this, "maxLat");
|
|
292
|
+
d(this, "maxLng");
|
|
293
293
|
this.coord = r.coord, this.minLat = this.maxLat = r.lat, this.minLng = this.maxLng = r.lng;
|
|
294
294
|
}
|
|
295
295
|
build() {
|
|
296
296
|
return new i(
|
|
297
297
|
// sw对应min
|
|
298
|
-
|
|
298
|
+
v.create(this.minLat, this.minLng, this.coord),
|
|
299
299
|
// ne对应max
|
|
300
|
-
|
|
300
|
+
v.create(this.maxLat, this.maxLng, this.coord)
|
|
301
301
|
);
|
|
302
302
|
}
|
|
303
303
|
include(r) {
|
|
@@ -309,78 +309,78 @@ h(W, "EMPTY", new K(y.ZERO, y.ZERO));
|
|
|
309
309
|
}
|
|
310
310
|
}
|
|
311
311
|
i.Builder = e;
|
|
312
|
-
})(
|
|
313
|
-
var
|
|
314
|
-
return
|
|
312
|
+
})(F || (F = {}));
|
|
313
|
+
var or = function(e) {
|
|
314
|
+
return ar(e) && !lr(e);
|
|
315
315
|
};
|
|
316
|
-
function
|
|
316
|
+
function ar(i) {
|
|
317
317
|
return !!i && typeof i == "object";
|
|
318
318
|
}
|
|
319
|
-
function
|
|
319
|
+
function lr(i) {
|
|
320
320
|
var e = Object.prototype.toString.call(i);
|
|
321
|
-
return e === "[object RegExp]" || e === "[object Date]" ||
|
|
321
|
+
return e === "[object RegExp]" || e === "[object Date]" || dr(i);
|
|
322
322
|
}
|
|
323
|
-
var
|
|
324
|
-
function
|
|
325
|
-
return i.$$typeof ===
|
|
323
|
+
var hr = typeof Symbol == "function" && Symbol.for, cr = hr ? Symbol.for("react.element") : 60103;
|
|
324
|
+
function dr(i) {
|
|
325
|
+
return i.$$typeof === cr;
|
|
326
326
|
}
|
|
327
|
-
function
|
|
327
|
+
function pr(i) {
|
|
328
328
|
return Array.isArray(i) ? [] : {};
|
|
329
329
|
}
|
|
330
|
-
function
|
|
331
|
-
return e.clone !== !1 && e.isMergeableObject(i) ?
|
|
330
|
+
function de(i, e) {
|
|
331
|
+
return e.clone !== !1 && e.isMergeableObject(i) ? re(pr(i), i, e) : i;
|
|
332
332
|
}
|
|
333
|
-
function
|
|
333
|
+
function ur(i, e, t) {
|
|
334
334
|
return i.concat(e).map(function(r) {
|
|
335
|
-
return
|
|
335
|
+
return de(r, t);
|
|
336
336
|
});
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function gr(i, e) {
|
|
339
339
|
if (!e.customMerge)
|
|
340
|
-
return
|
|
340
|
+
return re;
|
|
341
341
|
var t = e.customMerge(i);
|
|
342
|
-
return typeof t == "function" ? t :
|
|
342
|
+
return typeof t == "function" ? t : re;
|
|
343
343
|
}
|
|
344
|
-
function
|
|
344
|
+
function mr(i) {
|
|
345
345
|
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(i).filter(function(e) {
|
|
346
346
|
return Object.propertyIsEnumerable.call(i, e);
|
|
347
347
|
}) : [];
|
|
348
348
|
}
|
|
349
|
-
function
|
|
350
|
-
return Object.keys(i).concat(
|
|
349
|
+
function _t(i) {
|
|
350
|
+
return Object.keys(i).concat(mr(i));
|
|
351
351
|
}
|
|
352
|
-
function
|
|
352
|
+
function kt(i, e) {
|
|
353
353
|
try {
|
|
354
354
|
return e in i;
|
|
355
355
|
} catch {
|
|
356
356
|
return !1;
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
|
-
function
|
|
360
|
-
return
|
|
359
|
+
function fr(i, e) {
|
|
360
|
+
return kt(i, e) && !(Object.hasOwnProperty.call(i, e) && Object.propertyIsEnumerable.call(i, e));
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function yr(i, e, t) {
|
|
363
363
|
var r = {};
|
|
364
|
-
return t.isMergeableObject(i) &&
|
|
365
|
-
r[s] =
|
|
366
|
-
}),
|
|
367
|
-
|
|
364
|
+
return t.isMergeableObject(i) && _t(i).forEach(function(s) {
|
|
365
|
+
r[s] = de(i[s], t);
|
|
366
|
+
}), _t(e).forEach(function(s) {
|
|
367
|
+
fr(i, s) || (kt(i, s) && t.isMergeableObject(e[s]) ? r[s] = gr(s, t)(i[s], e[s], t) : r[s] = de(e[s], t));
|
|
368
368
|
}), r;
|
|
369
369
|
}
|
|
370
|
-
function
|
|
371
|
-
t = t || {}, t.arrayMerge = t.arrayMerge ||
|
|
370
|
+
function re(i, e, t) {
|
|
371
|
+
t = t || {}, t.arrayMerge = t.arrayMerge || ur, t.isMergeableObject = t.isMergeableObject || or, t.cloneUnlessOtherwiseSpecified = de;
|
|
372
372
|
var r = Array.isArray(e), s = Array.isArray(i), n = r === s;
|
|
373
|
-
return n ? r ? t.arrayMerge(i, e, t) :
|
|
373
|
+
return n ? r ? t.arrayMerge(i, e, t) : yr(i, e, t) : de(e, t);
|
|
374
374
|
}
|
|
375
|
-
|
|
375
|
+
re.all = function(e, t) {
|
|
376
376
|
if (!Array.isArray(e))
|
|
377
377
|
throw new Error("first argument should be an array");
|
|
378
378
|
return e.reduce(function(r, s) {
|
|
379
|
-
return
|
|
379
|
+
return re(r, s, t);
|
|
380
380
|
}, {});
|
|
381
381
|
};
|
|
382
|
-
var
|
|
383
|
-
const
|
|
382
|
+
var vr = re, Pt = vr;
|
|
383
|
+
const be = ["3.0"], _r = {
|
|
384
384
|
baidu: {
|
|
385
385
|
version: "3.0",
|
|
386
386
|
// 在build时会被静态替换, 导致使用者不能无法设置它
|
|
@@ -395,42 +395,42 @@ const _e = ["3.0"], ur = {
|
|
|
395
395
|
language: "en-us"
|
|
396
396
|
},
|
|
397
397
|
here: {
|
|
398
|
-
version:
|
|
398
|
+
version: be[0],
|
|
399
399
|
key: {}.VITE_APP_DEV_KEY_HERE,
|
|
400
400
|
language: ""
|
|
401
401
|
}
|
|
402
402
|
};
|
|
403
|
-
let
|
|
404
|
-
function
|
|
405
|
-
return
|
|
403
|
+
let It;
|
|
404
|
+
function Lt() {
|
|
405
|
+
return It || L("请先安装: Vue<PartialTgMapConfig>.use(TgMap, {})");
|
|
406
406
|
}
|
|
407
|
-
function
|
|
408
|
-
i != null && (
|
|
407
|
+
function Mr(i) {
|
|
408
|
+
i != null && (It = Pt(_r, i));
|
|
409
409
|
}
|
|
410
|
-
function
|
|
410
|
+
function ki() {
|
|
411
411
|
}
|
|
412
|
-
function
|
|
412
|
+
function Ae(i) {
|
|
413
413
|
return i;
|
|
414
414
|
}
|
|
415
|
-
function
|
|
415
|
+
function Pi(i, e) {
|
|
416
416
|
return i instanceof e;
|
|
417
417
|
}
|
|
418
|
-
function
|
|
418
|
+
function Ii(i, e) {
|
|
419
419
|
if (i instanceof e)
|
|
420
420
|
return i;
|
|
421
421
|
}
|
|
422
|
-
function
|
|
422
|
+
function me(i, e) {
|
|
423
423
|
if ((i == null ? void 0 : i.$options.name) === e.name)
|
|
424
424
|
return i;
|
|
425
425
|
}
|
|
426
|
-
function
|
|
426
|
+
function Li(i) {
|
|
427
427
|
return i;
|
|
428
428
|
}
|
|
429
|
-
class
|
|
429
|
+
class Ve {
|
|
430
430
|
constructor(e) {
|
|
431
|
-
|
|
431
|
+
d(this, "latestInfoWindow");
|
|
432
432
|
/** 使用{@link setEventTargetDelegate}初始化 */
|
|
433
|
-
|
|
433
|
+
d(this, "delegate", void 0);
|
|
434
434
|
this.element = e, process.env.NODE_ENV !== "production" && setTimeout(() => {
|
|
435
435
|
this.delegate || console.warn(`${this.constructor.name}继承了AbstractMap, 但未调用setEventTargetDelegate(delegate)`);
|
|
436
436
|
});
|
|
@@ -478,7 +478,7 @@ class Ze {
|
|
|
478
478
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
479
479
|
* Released under the MIT License.
|
|
480
480
|
*/
|
|
481
|
-
function
|
|
481
|
+
function br(i) {
|
|
482
482
|
return i != null && typeof i == "object" && Array.isArray(i) === !1;
|
|
483
483
|
}
|
|
484
484
|
/*!
|
|
@@ -487,59 +487,59 @@ function mr(i) {
|
|
|
487
487
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
488
488
|
* Released under the MIT License.
|
|
489
489
|
*/
|
|
490
|
-
function
|
|
491
|
-
return
|
|
490
|
+
function Mt(i) {
|
|
491
|
+
return br(i) === !0 && Object.prototype.toString.call(i) === "[object Object]";
|
|
492
492
|
}
|
|
493
|
-
function
|
|
493
|
+
function Bt(i) {
|
|
494
494
|
var e, t;
|
|
495
|
-
return !(
|
|
495
|
+
return !(Mt(i) === !1 || (e = i.constructor, typeof e != "function") || (t = e.prototype, Mt(t) === !1) || t.hasOwnProperty("isPrototypeOf") === !1);
|
|
496
496
|
}
|
|
497
|
-
var
|
|
497
|
+
var pe;
|
|
498
498
|
((i) => {
|
|
499
499
|
function e(n, a) {
|
|
500
|
-
return n.reduce((
|
|
500
|
+
return n.reduce((c, o) => (c[a(o)] = o, c), {});
|
|
501
501
|
}
|
|
502
502
|
i.fromArray = e;
|
|
503
503
|
function t(n) {
|
|
504
|
-
return n.reduce((a,
|
|
504
|
+
return n.reduce((a, c) => (a[c[0]] = c[1], a), {});
|
|
505
505
|
}
|
|
506
506
|
i.fromEntries = t;
|
|
507
507
|
function r(n) {
|
|
508
|
-
return JSON.stringify(n, (a,
|
|
508
|
+
return JSON.stringify(n, (a, c) => typeof c == "object" && Object.getPrototypeOf(c) !== Object.prototype ? c.toString !== Object.prototype.toString ? c.toString() : `[object ${Object.getPrototypeOf(c).constructor.name}]` : c);
|
|
509
509
|
}
|
|
510
510
|
i.toJsonSafely = r;
|
|
511
511
|
function s(n) {
|
|
512
|
-
|
|
512
|
+
Bt(n) && Object.keys(n).forEach((a) => {
|
|
513
513
|
n[a] === void 0 ? delete n[a] : s(n[a]);
|
|
514
514
|
});
|
|
515
515
|
}
|
|
516
516
|
i.deleteUndefinedPropertyOnPlainObjectDeeply = s;
|
|
517
|
-
})(
|
|
518
|
-
|
|
519
|
-
const
|
|
520
|
-
var
|
|
517
|
+
})(pe || (pe = {}));
|
|
518
|
+
pe.toJsonSafely;
|
|
519
|
+
const Tr = ["single", "multi"];
|
|
520
|
+
var D = /* @__PURE__ */ ((i) => (i.auto = "auto", i.none = "none", i.greedy = "greedy", i.cooperative = "cooperative", i))(D || {}), $e;
|
|
521
521
|
((i) => {
|
|
522
522
|
function e(t) {
|
|
523
|
-
|
|
524
|
-
const r = { center:
|
|
525
|
-
return
|
|
526
|
-
isMergeableObject:
|
|
523
|
+
pe.deleteUndefinedPropertyOnPlainObjectDeeply(t);
|
|
524
|
+
const r = { center: v.ZERO, zoom: 5 };
|
|
525
|
+
return Pt(r, t || {}, {
|
|
526
|
+
isMergeableObject: Bt
|
|
527
527
|
});
|
|
528
528
|
}
|
|
529
529
|
i.create = e;
|
|
530
|
-
})(
|
|
531
|
-
var
|
|
530
|
+
})($e || ($e = {}));
|
|
531
|
+
var ze = {}, Or = {
|
|
532
532
|
get exports() {
|
|
533
|
-
return
|
|
533
|
+
return ze;
|
|
534
534
|
},
|
|
535
535
|
set exports(i) {
|
|
536
|
-
|
|
536
|
+
ze = i;
|
|
537
537
|
}
|
|
538
538
|
};
|
|
539
539
|
(function(i, e) {
|
|
540
540
|
(function(t, r) {
|
|
541
541
|
i.exports = r();
|
|
542
|
-
})(
|
|
542
|
+
})(Et, function() {
|
|
543
543
|
var t, r = t = r || { version: "1.3.8" }, s = {};
|
|
544
544
|
r.guid = "$BAIDU$", s[r.guid] = s[r.guid] || {}, r.dom = r.dom || {}, r.dom.g = function(o) {
|
|
545
545
|
return typeof o == "string" || o instanceof String ? document.getElementById(o) : o && o.nodeName && (o.nodeType == 1 || o.nodeType == 9) ? o : null;
|
|
@@ -551,55 +551,55 @@ var Se = {}, yr = {
|
|
|
551
551
|
return r.lang.isString(o) ? document.getElementById(o) : o;
|
|
552
552
|
}, 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) {
|
|
553
553
|
o = r.dom._g(o);
|
|
554
|
-
var
|
|
555
|
-
return
|
|
556
|
-
}, r.dom._styleFixer = r.dom._styleFixer || {}, r.dom._styleFilter = r.dom._styleFilter || [], r.dom._styleFilter.filter = function(o, l,
|
|
557
|
-
for (var
|
|
558
|
-
(b = b[
|
|
554
|
+
var h = r.dom.getDocument(o), u;
|
|
555
|
+
return h.defaultView && h.defaultView.getComputedStyle && (u = h.defaultView.getComputedStyle(o, null), u) ? u[l] || u.getPropertyValue(l) : "";
|
|
556
|
+
}, r.dom._styleFixer = r.dom._styleFixer || {}, r.dom._styleFilter = r.dom._styleFilter || [], r.dom._styleFilter.filter = function(o, l, h) {
|
|
557
|
+
for (var u = 0, p = r.dom._styleFilter, b; b = p[u]; u++)
|
|
558
|
+
(b = b[h]) && (l = b(o, l));
|
|
559
559
|
return l;
|
|
560
560
|
}, r.string = r.string || {}, r.string.toCamelCase = function(o) {
|
|
561
561
|
return o.indexOf("-") < 0 && o.indexOf("_") < 0 ? o : o.replace(/[-_][^-_]/g, function(l) {
|
|
562
562
|
return l.charAt(1).toUpperCase();
|
|
563
563
|
});
|
|
564
564
|
}, r.dom.getStyle = function(o, l) {
|
|
565
|
-
var
|
|
566
|
-
o =
|
|
567
|
-
var
|
|
568
|
-
if (!
|
|
569
|
-
var p =
|
|
570
|
-
p && (
|
|
565
|
+
var h = r.dom;
|
|
566
|
+
o = h.g(o), l = r.string.toCamelCase(l);
|
|
567
|
+
var u = o.style[l] || (o.currentStyle ? o.currentStyle[l] : "") || h.getComputedStyle(o, l);
|
|
568
|
+
if (!u) {
|
|
569
|
+
var p = h._styleFixer[l];
|
|
570
|
+
p && (u = p.get ? p.get(o) : r.dom.getStyle(o, p));
|
|
571
571
|
}
|
|
572
|
-
return (p =
|
|
572
|
+
return (p = h._styleFilter) && (u = p.filter(l, u, "get")), u;
|
|
573
573
|
}, 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) {
|
|
574
574
|
o = r.dom.g(o);
|
|
575
|
-
var l = r.dom.getDocument(o),
|
|
576
|
-
|
|
577
|
-
var p = { left: 0, top: 0 }, b =
|
|
575
|
+
var l = r.dom.getDocument(o), h = r.browser, u = r.dom.getStyle;
|
|
576
|
+
h.isGecko > 0 && l.getBoxObjectFor && u(o, "position") == "absolute" && (o.style.top === "" || o.style.left);
|
|
577
|
+
var p = { left: 0, top: 0 }, b = h.ie && !h.isStrict ? l.body : l.documentElement, _, M;
|
|
578
578
|
if (o == b)
|
|
579
579
|
return p;
|
|
580
580
|
if (o.getBoundingClientRect) {
|
|
581
|
-
|
|
582
|
-
var
|
|
583
|
-
|
|
581
|
+
M = o.getBoundingClientRect(), p.left = Math.floor(M.left) + Math.max(l.documentElement.scrollLeft, l.body.scrollLeft), p.top = Math.floor(M.top) + Math.max(l.documentElement.scrollTop, l.body.scrollTop), p.left -= l.documentElement.clientLeft, p.top -= l.documentElement.clientTop;
|
|
582
|
+
var g = l.body, m = parseInt(u(g, "borderLeftWidth")), y = parseInt(u(g, "borderTopWidth"));
|
|
583
|
+
h.ie && !h.isStrict && (p.left -= isNaN(m) ? 2 : m, p.top -= isNaN(y) ? 2 : y);
|
|
584
584
|
} else {
|
|
585
|
-
|
|
585
|
+
_ = o;
|
|
586
586
|
do {
|
|
587
|
-
if (p.left +=
|
|
587
|
+
if (p.left += _.offsetLeft, p.top += _.offsetTop, h.isWebkit > 0 && u(_, "position") == "fixed") {
|
|
588
588
|
p.left += l.body.scrollLeft, p.top += l.body.scrollTop;
|
|
589
589
|
break;
|
|
590
590
|
}
|
|
591
|
-
|
|
592
|
-
} while (
|
|
593
|
-
for ((
|
|
594
|
-
p.left -=
|
|
591
|
+
_ = _.offsetParent;
|
|
592
|
+
} while (_ && _ != o);
|
|
593
|
+
for ((h.opera > 0 || h.isWebkit > 0 && u(o, "position") == "absolute") && (p.top -= l.body.offsetTop), _ = o.offsetParent; _ && _ != l.body; )
|
|
594
|
+
p.left -= _.scrollLeft, (!h.opera || _.tagName != "TR") && (p.top -= _.scrollTop), _ = _.offsetParent;
|
|
595
595
|
}
|
|
596
596
|
return p;
|
|
597
|
-
}, r.event = r.event || {}, r.event._listeners = r.event._listeners || [], r.event.on = function(o, l,
|
|
597
|
+
}, r.event = r.event || {}, r.event._listeners = r.event._listeners || [], r.event.on = function(o, l, h) {
|
|
598
598
|
l = l.replace(/^on/i, ""), o = r.dom._g(o);
|
|
599
|
-
var
|
|
600
|
-
|
|
601
|
-
}, p = r.event._listeners, b = r.event._eventFilter,
|
|
602
|
-
return l = l.toLowerCase(), b && b[l] && (
|
|
599
|
+
var u = function(g) {
|
|
600
|
+
h.call(o, g);
|
|
601
|
+
}, p = r.event._listeners, b = r.event._eventFilter, _, M = l;
|
|
602
|
+
return l = l.toLowerCase(), b && b[l] && (_ = b[l](o, l, u), M = _.type, u = _.listener), o.addEventListener ? o.addEventListener(M, u, !1) : o.attachEvent && o.attachEvent("on" + M, u), p[p.length] = [o, l, h, u, M], o;
|
|
603
603
|
}, r.on = r.event.on, function() {
|
|
604
604
|
var o = s[r.guid];
|
|
605
605
|
r.lang.guid = function() {
|
|
@@ -618,134 +618,134 @@ var Se = {}, yr = {
|
|
|
618
618
|
return "[object " + (this._className || "Object") + "]";
|
|
619
619
|
}, r.lang.Event = function(o, l) {
|
|
620
620
|
this.type = o, this.returnValue = !0, this.target = l || null, this.currentTarget = null;
|
|
621
|
-
}, r.lang.Class.prototype.addEventListener = function(o, l,
|
|
621
|
+
}, r.lang.Class.prototype.addEventListener = function(o, l, h) {
|
|
622
622
|
if (r.lang.isFunction(l)) {
|
|
623
623
|
!this.__listeners && (this.__listeners = {});
|
|
624
|
-
var
|
|
625
|
-
if (typeof
|
|
626
|
-
if (/[^\w\-]/.test(
|
|
627
|
-
throw "nonstandard key:" +
|
|
628
|
-
l.hashCode =
|
|
624
|
+
var u = this.__listeners, p;
|
|
625
|
+
if (typeof h == "string" && h) {
|
|
626
|
+
if (/[^\w\-]/.test(h))
|
|
627
|
+
throw "nonstandard key:" + h;
|
|
628
|
+
l.hashCode = h, p = h;
|
|
629
629
|
}
|
|
630
|
-
o.indexOf("on") != 0 && (o = "on" + o), typeof
|
|
630
|
+
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;
|
|
631
631
|
}
|
|
632
632
|
}, r.lang.Class.prototype.removeEventListener = function(o, l) {
|
|
633
633
|
if (!(typeof l < "u" && (r.lang.isFunction(l) && !(l = l.hashCode) || !r.lang.isString(l)))) {
|
|
634
634
|
!this.__listeners && (this.__listeners = {}), o.indexOf("on") != 0 && (o = "on" + o);
|
|
635
|
-
var
|
|
636
|
-
if (
|
|
635
|
+
var h = this.__listeners;
|
|
636
|
+
if (h[o])
|
|
637
637
|
if (typeof l < "u")
|
|
638
|
-
|
|
638
|
+
h[o][l] && delete h[o][l];
|
|
639
639
|
else
|
|
640
|
-
for (var
|
|
641
|
-
delete
|
|
640
|
+
for (var u in h[o])
|
|
641
|
+
delete h[o][u];
|
|
642
642
|
}
|
|
643
643
|
}, r.lang.Class.prototype.dispatchEvent = function(o, l) {
|
|
644
644
|
r.lang.isString(o) && (o = new r.lang.Event(o)), !this.__listeners && (this.__listeners = {}), l = l || {};
|
|
645
|
-
for (var
|
|
646
|
-
o[
|
|
647
|
-
var
|
|
648
|
-
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
|
|
649
|
-
for (
|
|
650
|
-
|
|
645
|
+
for (var h in l)
|
|
646
|
+
o[h] = l[h];
|
|
647
|
+
var h, u = this.__listeners, p = o.type;
|
|
648
|
+
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")
|
|
649
|
+
for (h in u[p])
|
|
650
|
+
u[p][h].apply(this, arguments);
|
|
651
651
|
return o.returnValue;
|
|
652
|
-
}, r.lang.inherits = function(o, l,
|
|
653
|
-
var
|
|
654
|
-
|
|
655
|
-
for (
|
|
656
|
-
p[
|
|
657
|
-
o.prototype.constructor = o, o.superClass = l.prototype, typeof
|
|
652
|
+
}, r.lang.inherits = function(o, l, h) {
|
|
653
|
+
var u, p, b = o.prototype, _ = new Function();
|
|
654
|
+
_.prototype = l.prototype, p = o.prototype = new _();
|
|
655
|
+
for (u in b)
|
|
656
|
+
p[u] = b[u];
|
|
657
|
+
o.prototype.constructor = o, o.superClass = l.prototype, typeof h == "string" && (p._className = h);
|
|
658
658
|
}, r.inherits = r.lang.inherits;
|
|
659
|
-
var n = "http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m", a = "png",
|
|
659
|
+
var n = "http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m", a = "png", c = function(o, l, h) {
|
|
660
660
|
try {
|
|
661
661
|
BMap;
|
|
662
662
|
} catch {
|
|
663
663
|
throw Error("Baidu Map JS API is not ready yet!");
|
|
664
664
|
}
|
|
665
|
-
t.lang.inherits(
|
|
665
|
+
t.lang.inherits(c, BMap.Overlay, "TextIconOverlay"), this._position = o, this._text = l, this._options = h || {}, this._styles = this._options.styles || [], this._zIndex = this._options.zIndex, !this._styles.length && this._setupDefaultStyles();
|
|
666
666
|
};
|
|
667
|
-
return
|
|
668
|
-
for (var o = [53, 56, 66, 78, 90], l = 0,
|
|
667
|
+
return c.prototype._setupDefaultStyles = function() {
|
|
668
|
+
for (var o = [53, 56, 66, 78, 90], l = 0, h; h = o[l]; l++)
|
|
669
669
|
this._styles.push({
|
|
670
670
|
url: n + l + "." + a,
|
|
671
|
-
size: new BMap.Size(
|
|
671
|
+
size: new BMap.Size(h, h)
|
|
672
672
|
});
|
|
673
|
-
},
|
|
673
|
+
}, c.prototype.initialize = function(o) {
|
|
674
674
|
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;
|
|
675
|
-
},
|
|
675
|
+
}, c.prototype.draw = function() {
|
|
676
676
|
this._map && this._updatePosition();
|
|
677
|
-
},
|
|
677
|
+
}, c.prototype.getText = function() {
|
|
678
678
|
return this._text;
|
|
679
|
-
},
|
|
679
|
+
}, c.prototype.setText = function(o) {
|
|
680
680
|
o && (!this._text || this._text.toString() != o.toString()) && (this._text = o, this._updateText(), this._updateCss(), this._updatePosition());
|
|
681
|
-
},
|
|
681
|
+
}, c.prototype.getPosition = function() {
|
|
682
682
|
return this._position;
|
|
683
|
-
},
|
|
683
|
+
}, c.prototype.setPosition = function(o) {
|
|
684
684
|
o && (!this._position || !this._position.equals(o)) && (this._position = o, this._updatePosition());
|
|
685
|
-
},
|
|
686
|
-
var
|
|
687
|
-
return
|
|
688
|
-
},
|
|
685
|
+
}, c.prototype.getStyleByText = function(o, l) {
|
|
686
|
+
var h = parseInt(o), u = parseInt(h / 10);
|
|
687
|
+
return u = Math.max(0, u), u = Math.min(u, l.length - 1), l[u];
|
|
688
|
+
}, c.prototype._updateCss = function() {
|
|
689
689
|
if (this._domElement) {
|
|
690
690
|
var o = this.getStyleByText(this._text, this._styles);
|
|
691
691
|
this._domElement.style.cssText = this._buildCssText(o);
|
|
692
692
|
}
|
|
693
|
-
},
|
|
693
|
+
}, c.prototype._updateText = function() {
|
|
694
694
|
this._domElement && (this._domElement.innerHTML = this._text);
|
|
695
|
-
},
|
|
695
|
+
}, c.prototype._updatePosition = function() {
|
|
696
696
|
if (this._domElement && this._position) {
|
|
697
697
|
var o = this._domElement.style, l = this._map.pointToOverlayPixel(this._position);
|
|
698
698
|
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";
|
|
699
699
|
}
|
|
700
|
-
},
|
|
701
|
-
var l = o.url,
|
|
702
|
-
if (this._zIndex &&
|
|
703
|
-
|
|
700
|
+
}, c.prototype._buildCssText = function(o) {
|
|
701
|
+
var l = o.url, h = o.size, u = o.anchor, p = o.offset, b = o.textColor || "black", _ = o.textSize || 10, M = [];
|
|
702
|
+
if (this._zIndex && M.push("z-index:" + this._zIndex + ";"), t.browser.ie < 7)
|
|
703
|
+
M.push('filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="' + l + '");');
|
|
704
704
|
else {
|
|
705
|
-
|
|
706
|
-
var
|
|
707
|
-
p instanceof BMap.Size && (
|
|
705
|
+
M.push("background-image:url(" + l + ");");
|
|
706
|
+
var g = "0 0";
|
|
707
|
+
p instanceof BMap.Size && (g = p.width + "px " + p.height + "px"), M.push("background-position:" + g + ";");
|
|
708
708
|
}
|
|
709
|
-
return
|
|
710
|
-
},
|
|
709
|
+
return h instanceof BMap.Size && (u instanceof BMap.Size ? (u.height > 0 && u.height < h.height && M.push("height:" + (h.height - u.height) + "px; padding-top:" + u.height + "px;"), u.width > 0 && u.width < h.width && M.push("width:" + (h.width - u.width) + "px; padding-left:" + u.width + "px;")) : (M.push("height:" + h.height + "px; line-height:" + h.height + "px;"), M.push("width:" + h.width + "px; text-align:center;"))), M.push("cursor:pointer; color:" + b + "; position:absolute; font-size:" + _ + "px; font-family:Arial,sans-serif; font-weight:bold"), M.join("");
|
|
710
|
+
}, c.prototype._bind = function() {
|
|
711
711
|
if (!this._domElement)
|
|
712
712
|
return;
|
|
713
|
-
var o = this, l = this._map,
|
|
714
|
-
function
|
|
715
|
-
var
|
|
716
|
-
if (p && b &&
|
|
717
|
-
var
|
|
718
|
-
b.pixel = new BMap.Pixel(
|
|
713
|
+
var o = this, l = this._map, h = t.lang.Event;
|
|
714
|
+
function u(p, b) {
|
|
715
|
+
var _ = p.srcElement || p.target, M = p.clientX || p.pageX, g = p.clientY || p.pageY;
|
|
716
|
+
if (p && b && M && g && _) {
|
|
717
|
+
var m = t.dom.getPosition(l.getContainer());
|
|
718
|
+
b.pixel = new BMap.Pixel(M - m.left, g - m.top), b.point = l.pixelToPoint(b.pixel);
|
|
719
719
|
}
|
|
720
720
|
return b;
|
|
721
721
|
}
|
|
722
722
|
t.event.on(this._domElement, "mouseover", function(p) {
|
|
723
|
-
o.dispatchEvent(
|
|
723
|
+
o.dispatchEvent(u(p, new h("onmouseover")));
|
|
724
724
|
}), t.event.on(this._domElement, "mouseout", function(p) {
|
|
725
|
-
o.dispatchEvent(
|
|
725
|
+
o.dispatchEvent(u(p, new h("onmouseout")));
|
|
726
726
|
}), t.event.on(this._domElement, "click", function(p) {
|
|
727
|
-
o.dispatchEvent(
|
|
727
|
+
o.dispatchEvent(u(p, new h("onclick")));
|
|
728
728
|
});
|
|
729
|
-
},
|
|
729
|
+
}, c;
|
|
730
730
|
});
|
|
731
|
-
})(
|
|
732
|
-
const
|
|
733
|
-
var
|
|
734
|
-
e =
|
|
731
|
+
})(Or);
|
|
732
|
+
const bt = ze;
|
|
733
|
+
var St = function(i, e, t) {
|
|
734
|
+
e = wr(e);
|
|
735
735
|
var r = i.pointToPixel(e.getNorthEast()), s = i.pointToPixel(e.getSouthWest());
|
|
736
736
|
r.x += t, r.y -= t, s.x -= t, s.y += t;
|
|
737
737
|
var n = i.pixelToPoint(r), a = i.pixelToPoint(s);
|
|
738
738
|
return new BMap.Bounds(a, n);
|
|
739
|
-
},
|
|
740
|
-
var e =
|
|
739
|
+
}, wr = function(i) {
|
|
740
|
+
var e = fe(i.getNorthEast().lng, -180, 180), t = fe(i.getSouthWest().lng, -180, 180), r = fe(i.getNorthEast().lat, -74, 74), s = fe(i.getSouthWest().lat, -74, 74);
|
|
741
741
|
return new BMap.Bounds(new BMap.Point(t, s), new BMap.Point(e, r));
|
|
742
|
-
},
|
|
742
|
+
}, fe = function(i, e, t) {
|
|
743
743
|
return e && (i = Math.max(i, e)), t && (i = Math.min(i, t)), i;
|
|
744
|
-
},
|
|
744
|
+
}, At = function(i) {
|
|
745
745
|
return Object.prototype.toString.call(i) === "[object Array]";
|
|
746
|
-
},
|
|
746
|
+
}, $t = function(i, e) {
|
|
747
747
|
var t = -1;
|
|
748
|
-
if (
|
|
748
|
+
if (At(e)) {
|
|
749
749
|
if (e.indexOf)
|
|
750
750
|
t = e.indexOf(i);
|
|
751
751
|
else
|
|
@@ -756,7 +756,7 @@ var Pt = function(i, e, t) {
|
|
|
756
756
|
}
|
|
757
757
|
}
|
|
758
758
|
return t;
|
|
759
|
-
},
|
|
759
|
+
}, T = function(i, e) {
|
|
760
760
|
try {
|
|
761
761
|
BMap;
|
|
762
762
|
} catch {
|
|
@@ -773,33 +773,33 @@ var Pt = function(i, e, t) {
|
|
|
773
773
|
r._redraw();
|
|
774
774
|
});
|
|
775
775
|
var s = t.markers;
|
|
776
|
-
|
|
776
|
+
At(s) && this.addMarkers(s);
|
|
777
777
|
}
|
|
778
778
|
};
|
|
779
|
-
|
|
779
|
+
T.prototype.addMarkers = function(i) {
|
|
780
780
|
if (i.length) {
|
|
781
781
|
for (var e = 0, t = i.length; e < t; e++)
|
|
782
782
|
this._pushMarkerTo(i[e]);
|
|
783
783
|
this._createClusters();
|
|
784
784
|
}
|
|
785
785
|
};
|
|
786
|
-
|
|
787
|
-
var e =
|
|
786
|
+
T.prototype._pushMarkerTo = function(i) {
|
|
787
|
+
var e = $t(i, this._markers);
|
|
788
788
|
e === -1 && (i.isInCluster = !1, this._markers.push(i));
|
|
789
789
|
};
|
|
790
|
-
|
|
790
|
+
T.prototype.addMarker = function(i) {
|
|
791
791
|
this._pushMarkerTo(i), this._createClusters();
|
|
792
792
|
};
|
|
793
|
-
|
|
793
|
+
T.prototype._createClusters = function() {
|
|
794
794
|
var i = this._map.getBounds();
|
|
795
795
|
if (i.getCenter()) {
|
|
796
|
-
for (var e =
|
|
796
|
+
for (var e = St(this._map, i, this._gridSize), t = 0, r; r = this._markers[t]; t++)
|
|
797
797
|
!r.isInCluster && e.containsPoint(r.getPosition()) && this._addToClosestCluster(r);
|
|
798
798
|
for (var s = this._markers.length, t = 0; t < s; t++)
|
|
799
799
|
this._clusters[t] && this._clusters[t].render();
|
|
800
800
|
}
|
|
801
801
|
};
|
|
802
|
-
|
|
802
|
+
T.prototype._addToClosestCluster = function(i) {
|
|
803
803
|
var e = 4e6, t = null;
|
|
804
804
|
i.getPosition();
|
|
805
805
|
for (var r = 0, s; s = this._clusters[r]; r++) {
|
|
@@ -812,104 +812,104 @@ _.prototype._addToClosestCluster = function(i) {
|
|
|
812
812
|
if (t && t.isMarkerInClusterBounds(i))
|
|
813
813
|
t.addMarker(i);
|
|
814
814
|
else {
|
|
815
|
-
var s = new
|
|
815
|
+
var s = new S(this);
|
|
816
816
|
s.addMarker(i), this._clusters.push(s);
|
|
817
817
|
}
|
|
818
818
|
};
|
|
819
|
-
|
|
819
|
+
T.prototype._clearLastClusters = function() {
|
|
820
820
|
for (var i = 0, e; e = this._clusters[i]; i++)
|
|
821
821
|
e.remove();
|
|
822
822
|
this._clusters = [], this._removeMarkersFromCluster();
|
|
823
823
|
};
|
|
824
|
-
|
|
824
|
+
T.prototype._removeMarkersFromCluster = function() {
|
|
825
825
|
for (var i = 0, e; e = this._markers[i]; i++)
|
|
826
826
|
e.isInCluster = !1;
|
|
827
827
|
};
|
|
828
|
-
|
|
828
|
+
T.prototype._removeMarkersFromMap = function() {
|
|
829
829
|
for (var i = 0, e; e = this._markers[i]; i++) {
|
|
830
830
|
e.isInCluster = !1;
|
|
831
831
|
var t = e.getLabel();
|
|
832
832
|
this._map.removeOverlay(e), e.setLabel(t);
|
|
833
833
|
}
|
|
834
834
|
};
|
|
835
|
-
|
|
836
|
-
var e =
|
|
835
|
+
T.prototype._removeMarker = function(i) {
|
|
836
|
+
var e = $t(i, this._markers);
|
|
837
837
|
return e === -1 ? !1 : (this._map.removeOverlay(i), this._markers.splice(e, 1), !0);
|
|
838
838
|
};
|
|
839
|
-
|
|
839
|
+
T.prototype.removeMarker = function(i) {
|
|
840
840
|
var e = this._removeMarker(i);
|
|
841
841
|
return e && (this._clearLastClusters(), this._createClusters()), e;
|
|
842
842
|
};
|
|
843
|
-
|
|
843
|
+
T.prototype.removeMarkers = function(i) {
|
|
844
844
|
for (var e = !1, t = 0; t < i.length; t++) {
|
|
845
845
|
var r = this._removeMarker(i[t]);
|
|
846
846
|
e = e || r;
|
|
847
847
|
}
|
|
848
848
|
return e && (this._clearLastClusters(), this._createClusters()), e;
|
|
849
849
|
};
|
|
850
|
-
|
|
850
|
+
T.prototype.clearMarkers = function() {
|
|
851
851
|
this._clearLastClusters(), this._removeMarkersFromMap(), this._markers = [];
|
|
852
852
|
};
|
|
853
|
-
|
|
853
|
+
T.prototype._redraw = function() {
|
|
854
854
|
this._clearLastClusters(), this._createClusters();
|
|
855
855
|
};
|
|
856
|
-
|
|
856
|
+
T.prototype.getGridSize = function() {
|
|
857
857
|
return this._gridSize;
|
|
858
858
|
};
|
|
859
|
-
|
|
859
|
+
T.prototype.setGridSize = function(i) {
|
|
860
860
|
this._gridSize = i, this._redraw();
|
|
861
861
|
};
|
|
862
|
-
|
|
862
|
+
T.prototype.getMaxZoom = function() {
|
|
863
863
|
return this._maxZoom;
|
|
864
864
|
};
|
|
865
|
-
|
|
865
|
+
T.prototype.setMaxZoom = function(i) {
|
|
866
866
|
this._maxZoom = i, this._redraw();
|
|
867
867
|
};
|
|
868
|
-
|
|
868
|
+
T.prototype.getZIndex = function() {
|
|
869
869
|
return this._zIndex;
|
|
870
870
|
};
|
|
871
|
-
|
|
871
|
+
T.prototype.setZIndex = function(i) {
|
|
872
872
|
this._zIndex != i && (this.zIndex = i, this._redraw());
|
|
873
873
|
};
|
|
874
|
-
|
|
874
|
+
T.prototype.getStyles = function() {
|
|
875
875
|
return this._styles;
|
|
876
876
|
};
|
|
877
|
-
|
|
877
|
+
T.prototype.setStyles = function(i) {
|
|
878
878
|
this._styles = i, this._redraw();
|
|
879
879
|
};
|
|
880
|
-
|
|
880
|
+
T.prototype.getMinClusterSize = function() {
|
|
881
881
|
return this._minClusterSize;
|
|
882
882
|
};
|
|
883
|
-
|
|
883
|
+
T.prototype.setMinClusterSize = function(i) {
|
|
884
884
|
this._minClusterSize = i, this._redraw();
|
|
885
885
|
};
|
|
886
|
-
|
|
886
|
+
T.prototype.isAverageCenter = function() {
|
|
887
887
|
return this._isAverageCenter;
|
|
888
888
|
};
|
|
889
|
-
|
|
889
|
+
T.prototype.getMap = function() {
|
|
890
890
|
return this._map;
|
|
891
891
|
};
|
|
892
|
-
|
|
892
|
+
T.prototype.getMarkers = function() {
|
|
893
893
|
return this._markers;
|
|
894
894
|
};
|
|
895
|
-
|
|
895
|
+
T.prototype.getClustersCount = function() {
|
|
896
896
|
for (var i = 0, e = 0, t; t = this._clusters[e]; e++)
|
|
897
897
|
t.isReal() && i++;
|
|
898
898
|
return i;
|
|
899
899
|
};
|
|
900
|
-
|
|
900
|
+
T.prototype._textCalculator = function(i) {
|
|
901
901
|
return i.length.toString();
|
|
902
902
|
};
|
|
903
|
-
|
|
904
|
-
|
|
903
|
+
T.prototype._stylesIndexCalculator = null;
|
|
904
|
+
T.prototype.setTextCalculator = function(i) {
|
|
905
905
|
this._textCalculator = i;
|
|
906
906
|
};
|
|
907
|
-
|
|
907
|
+
T.prototype.setStylesIndexCalculator = function(i) {
|
|
908
908
|
this._stylesIndexCalculator = i;
|
|
909
909
|
};
|
|
910
|
-
function
|
|
910
|
+
function S(i) {
|
|
911
911
|
var e = this;
|
|
912
|
-
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
|
|
912
|
+
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 bt(this._center, this._markers.length, {
|
|
913
913
|
styles: this._markerClusterer.getStyles(),
|
|
914
914
|
zIndex: i._zIndex
|
|
915
915
|
}), this._clusterMarker.getStyleByText = function(t, r) {
|
|
@@ -917,12 +917,12 @@ function L(i) {
|
|
|
917
917
|
var s = e._markerClusterer._stylesIndexCalculator(e._markers, r.length);
|
|
918
918
|
return r[s];
|
|
919
919
|
}
|
|
920
|
-
return
|
|
920
|
+
return bt.prototype.getStyleByText.call(this, t, r);
|
|
921
921
|
}, this._clusterMarker.addEventListener && this._clusterMarker.addEventListener("click", function(t) {
|
|
922
922
|
e._map.setViewport(e.getBounds());
|
|
923
923
|
});
|
|
924
924
|
}
|
|
925
|
-
|
|
925
|
+
S.prototype.addMarker = function(i) {
|
|
926
926
|
if (this.isMarkerInCluster(i))
|
|
927
927
|
return !1;
|
|
928
928
|
if (!this._center)
|
|
@@ -933,7 +933,7 @@ L.prototype.addMarker = function(i) {
|
|
|
933
933
|
}
|
|
934
934
|
return i.isInCluster = !0, this._markers.push(i), !0;
|
|
935
935
|
};
|
|
936
|
-
|
|
936
|
+
S.prototype.render = function() {
|
|
937
937
|
var i = this._markers.length;
|
|
938
938
|
if (i < this._minClusterSize)
|
|
939
939
|
for (var e = 0; e < i; e++)
|
|
@@ -941,7 +941,7 @@ L.prototype.render = function() {
|
|
|
941
941
|
else
|
|
942
942
|
this._map.addOverlay(this._clusterMarker), this._isReal = !0, this.updateClusterMarker();
|
|
943
943
|
};
|
|
944
|
-
|
|
944
|
+
S.prototype.isMarkerInCluster = function(i) {
|
|
945
945
|
if (this._markers.indexOf)
|
|
946
946
|
return this._markers.indexOf(i) != -1;
|
|
947
947
|
for (var e = 0, t; t = this._markers[e]; e++)
|
|
@@ -949,17 +949,17 @@ L.prototype.isMarkerInCluster = function(i) {
|
|
|
949
949
|
return !0;
|
|
950
950
|
return !1;
|
|
951
951
|
};
|
|
952
|
-
|
|
952
|
+
S.prototype.isMarkerInClusterBounds = function(i) {
|
|
953
953
|
return this._gridBounds.containsPoint(i.getPosition());
|
|
954
954
|
};
|
|
955
|
-
|
|
955
|
+
S.prototype.isReal = function(i) {
|
|
956
956
|
return this._isReal;
|
|
957
957
|
};
|
|
958
|
-
|
|
958
|
+
S.prototype.updateGridBounds = function() {
|
|
959
959
|
var i = new BMap.Bounds(this._center, this._center);
|
|
960
|
-
this._gridBounds =
|
|
960
|
+
this._gridBounds = St(this._map, i, this._markerClusterer.getGridSize());
|
|
961
961
|
};
|
|
962
|
-
|
|
962
|
+
S.prototype.updateClusterMarker = function() {
|
|
963
963
|
if (this._map.getZoom() > this._markerClusterer.getMaxZoom()) {
|
|
964
964
|
this._clusterMarker && this._map.removeOverlay(this._clusterMarker);
|
|
965
965
|
for (var i = 0, e; e = this._markers[i]; i++)
|
|
@@ -972,33 +972,33 @@ L.prototype.updateClusterMarker = function() {
|
|
|
972
972
|
}
|
|
973
973
|
this._clusterMarker.setPosition(this._center), this._clusterMarker.setText(this._markerClusterer._textCalculator(this._markers));
|
|
974
974
|
};
|
|
975
|
-
|
|
975
|
+
S.prototype.remove = function() {
|
|
976
976
|
for (var i = 0, e; e = this._markers[i]; i++) {
|
|
977
977
|
var t = this._markers[i].getLabel();
|
|
978
978
|
this._markers[i].getMap() && this._map.removeOverlay(this._markers[i]), this._markers[i].setLabel(t);
|
|
979
979
|
}
|
|
980
980
|
this._map.removeOverlay(this._clusterMarker), this._markers.length = 0, delete this._markers;
|
|
981
981
|
};
|
|
982
|
-
|
|
982
|
+
S.prototype.getBounds = function() {
|
|
983
983
|
for (var i = new BMap.Bounds(this._center, this._center), e = 0, t; t = this._markers[e]; e++)
|
|
984
984
|
i.extend(t.getPosition());
|
|
985
985
|
return i;
|
|
986
986
|
};
|
|
987
|
-
|
|
987
|
+
S.prototype.getCenter = function() {
|
|
988
988
|
return this._center;
|
|
989
989
|
};
|
|
990
|
-
let
|
|
990
|
+
let Cr = class zt {
|
|
991
991
|
constructor(e, t, r) {
|
|
992
|
-
this.extend(
|
|
992
|
+
this.extend(zt, google.maps.OverlayView), this.map_ = e, 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;
|
|
993
993
|
var s = r || {};
|
|
994
994
|
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(e), this.prevZoom_ = this.map_.getZoom();
|
|
995
995
|
var n = this;
|
|
996
996
|
google.maps.event.addListener(this.map_, "zoom_changed", function() {
|
|
997
|
-
var a = n.map_.getZoom(),
|
|
997
|
+
var a = n.map_.getZoom(), c = n.map_.minZoom || 0, o = Math.min(
|
|
998
998
|
n.map_.maxZoom || 100,
|
|
999
999
|
n.map_.mapTypes[n.map_.getMapTypeId()].maxZoom
|
|
1000
1000
|
);
|
|
1001
|
-
a = Math.min(Math.max(a,
|
|
1001
|
+
a = Math.min(Math.max(a, c), o), n.prevZoom_ != a && (n.prevZoom_ = a, n.resetViewport());
|
|
1002
1002
|
}), google.maps.event.addListener(this.map_, "idle", function() {
|
|
1003
1003
|
n.redraw();
|
|
1004
1004
|
}), t && (t.length || Object.keys(t).length) && this.addMarkers(t, !1);
|
|
@@ -1241,8 +1241,8 @@ let _r = class Bt {
|
|
|
1241
1241
|
*/
|
|
1242
1242
|
removeMarkers(e, t) {
|
|
1243
1243
|
for (var r = e === this.getMarkers() ? e.slice() : e, s = !1, n = 0, a; a = r[n]; n++) {
|
|
1244
|
-
var
|
|
1245
|
-
s = s ||
|
|
1244
|
+
var c = this.removeMarker_(a);
|
|
1245
|
+
s = s || c;
|
|
1246
1246
|
}
|
|
1247
1247
|
if (!t && s)
|
|
1248
1248
|
return this.resetViewport(), this.redraw(), !0;
|
|
@@ -1329,8 +1329,8 @@ let _r = class Bt {
|
|
|
1329
1329
|
n.x += this.gridSize_, n.y -= this.gridSize_;
|
|
1330
1330
|
var a = t.fromLatLngToDivPixel(s);
|
|
1331
1331
|
a.x -= this.gridSize_, a.y += this.gridSize_;
|
|
1332
|
-
var
|
|
1333
|
-
return e.extend(
|
|
1332
|
+
var c = t.fromDivPixelToLatLng(n), o = t.fromDivPixelToLatLng(a);
|
|
1333
|
+
return e.extend(c), e.extend(o), e;
|
|
1334
1334
|
}
|
|
1335
1335
|
/**
|
|
1336
1336
|
* Determins if a marker is contained in a bounds.
|
|
@@ -1388,7 +1388,7 @@ let _r = class Bt {
|
|
|
1388
1388
|
distanceBetweenPoints_(e, t) {
|
|
1389
1389
|
if (!e || !t)
|
|
1390
1390
|
return 0;
|
|
1391
|
-
var r = 6371, s = (t.lat() - e.lat()) * Math.PI / 180, n = (t.lng() - e.lng()) * Math.PI / 180, a = Math.sin(s / 2) * Math.sin(s / 2) + Math.cos(e.lat() * Math.PI / 180) * Math.cos(t.lat() * Math.PI / 180) * Math.sin(n / 2) * Math.sin(n / 2),
|
|
1391
|
+
var r = 6371, s = (t.lat() - e.lat()) * Math.PI / 180, n = (t.lng() - e.lng()) * Math.PI / 180, a = Math.sin(s / 2) * Math.sin(s / 2) + Math.cos(e.lat() * Math.PI / 180) * Math.cos(t.lat() * Math.PI / 180) * Math.sin(n / 2) * Math.sin(n / 2), c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)), o = r * c;
|
|
1392
1392
|
return o;
|
|
1393
1393
|
}
|
|
1394
1394
|
/**
|
|
@@ -1401,14 +1401,14 @@ let _r = class Bt {
|
|
|
1401
1401
|
for (var t = 4e4, r = null, s = 0, n; n = this.clusters_[s]; s++) {
|
|
1402
1402
|
var a = n.getCenter();
|
|
1403
1403
|
if (a) {
|
|
1404
|
-
var
|
|
1405
|
-
|
|
1404
|
+
var c = this.distanceBetweenPoints_(a, e.getPosition());
|
|
1405
|
+
c < t && (t = c, r = n);
|
|
1406
1406
|
}
|
|
1407
1407
|
}
|
|
1408
1408
|
if (r && r.isMarkerInClusterBounds(e))
|
|
1409
1409
|
r.addMarker(e);
|
|
1410
1410
|
else {
|
|
1411
|
-
var o = new
|
|
1411
|
+
var o = new xr(this);
|
|
1412
1412
|
o.addMarker(e), this.clusters_.push(o);
|
|
1413
1413
|
}
|
|
1414
1414
|
}
|
|
@@ -1426,9 +1426,9 @@ let _r = class Bt {
|
|
|
1426
1426
|
!s.isAdded && this.isMarkerInBounds_(s, t) && this.addToClosestCluster_(s);
|
|
1427
1427
|
}
|
|
1428
1428
|
};
|
|
1429
|
-
class
|
|
1429
|
+
class xr {
|
|
1430
1430
|
constructor(e) {
|
|
1431
|
-
this.markerClusterer_ = e, this.map_ = e.getMap(), this.gridSize_ = e.getGridSize(), this.minClusterSize_ = e.getMinClusterSize(), this.averageCenter_ = e.isAverageCenter(), this.center_ = null, this.markers_ = [], this.bounds_ = null, this.clusterIcon_ = new
|
|
1431
|
+
this.markerClusterer_ = e, this.map_ = e.getMap(), this.gridSize_ = e.getGridSize(), this.minClusterSize_ = e.getMinClusterSize(), this.averageCenter_ = e.isAverageCenter(), this.center_ = null, this.markers_ = [], this.bounds_ = null, this.clusterIcon_ = new We(
|
|
1432
1432
|
this,
|
|
1433
1433
|
e.getStyles(),
|
|
1434
1434
|
e.getGridSize()
|
|
@@ -1562,9 +1562,9 @@ class Mr {
|
|
|
1562
1562
|
this.clusterIcon_.setCenter(this.center_), this.clusterIcon_.setSums(a), this.clusterIcon_.show();
|
|
1563
1563
|
}
|
|
1564
1564
|
}
|
|
1565
|
-
class
|
|
1565
|
+
class We {
|
|
1566
1566
|
constructor(e, t, r) {
|
|
1567
|
-
e.getMarkerClusterer().extend(
|
|
1567
|
+
e.getMarkerClusterer().extend(We, google.maps.OverlayView), this.styles_ = t, this.padding_ = r || 0, this.cluster_ = e, this.center_ = null, this.map_ = e.getMap(), this.div_ = null, this.sums_ = null, this.visible_ = !1, this.setMap(this.map_);
|
|
1568
1568
|
}
|
|
1569
1569
|
/**
|
|
1570
1570
|
* Triggers the clusterclick event and zoom's if the option is set.
|
|
@@ -1695,7 +1695,7 @@ class Ge {
|
|
|
1695
1695
|
), t.join("");
|
|
1696
1696
|
}
|
|
1697
1697
|
}
|
|
1698
|
-
var
|
|
1698
|
+
var Te;
|
|
1699
1699
|
((i) => {
|
|
1700
1700
|
function e(r) {
|
|
1701
1701
|
return {
|
|
@@ -1720,10 +1720,10 @@ var Me;
|
|
|
1720
1720
|
};
|
|
1721
1721
|
}
|
|
1722
1722
|
i.toGoogle = t;
|
|
1723
|
-
})(
|
|
1724
|
-
class
|
|
1723
|
+
})(Te || (Te = {}));
|
|
1724
|
+
class Nt {
|
|
1725
1725
|
constructor(e) {
|
|
1726
|
-
|
|
1726
|
+
d(this, "inner");
|
|
1727
1727
|
this.map = e;
|
|
1728
1728
|
}
|
|
1729
1729
|
/** baidu/google 拥有相同的函数名 */
|
|
@@ -1747,17 +1747,17 @@ class St {
|
|
|
1747
1747
|
return this.inner.removeMarkers(e.map((t) => t.innerOverlay));
|
|
1748
1748
|
}
|
|
1749
1749
|
}
|
|
1750
|
-
class
|
|
1750
|
+
class Er extends Nt {
|
|
1751
1751
|
constructor(e, t) {
|
|
1752
1752
|
var s;
|
|
1753
|
-
super(e), this.inner = new
|
|
1753
|
+
super(e), this.inner = new T(e.innerMap, {
|
|
1754
1754
|
// baidu的构造器中的markers, 会触发重绘, 会导致使用旧的calculator计算cluster
|
|
1755
1755
|
// markers: options.markers?.map(it => (it as BaiduMarker).innerOverlay),
|
|
1756
1756
|
gridSize: t.gridSize,
|
|
1757
1757
|
maxZoom: t.maxZoom,
|
|
1758
1758
|
minClusterSize: t.minClusterSize,
|
|
1759
1759
|
isAverageCenter: t.averageCenter,
|
|
1760
|
-
styles: (s = t.styles) == null ? void 0 : s.map((n) =>
|
|
1760
|
+
styles: (s = t.styles) == null ? void 0 : s.map((n) => Te.toBaidu(n)),
|
|
1761
1761
|
zIndex: t.zIndex
|
|
1762
1762
|
});
|
|
1763
1763
|
const r = t.stylesIndexCalculator;
|
|
@@ -1767,10 +1767,10 @@ class br extends St {
|
|
|
1767
1767
|
this.inner._redraw();
|
|
1768
1768
|
}
|
|
1769
1769
|
}
|
|
1770
|
-
class
|
|
1770
|
+
class kr extends Nt {
|
|
1771
1771
|
constructor(e, t) {
|
|
1772
1772
|
var s, n;
|
|
1773
|
-
super(e), this.inner = new
|
|
1773
|
+
super(e), this.inner = new Cr(
|
|
1774
1774
|
e.innerMap,
|
|
1775
1775
|
// google的构造器中的markers,不会触发重绘, 第一次绘制通过监听地图的'idle'事件触发, 可以直接设置
|
|
1776
1776
|
(s = t.markers) == null ? void 0 : s.map((a) => a.innerOverlay),
|
|
@@ -1779,22 +1779,22 @@ class Tr extends St {
|
|
|
1779
1779
|
maxZoom: t.maxZoom,
|
|
1780
1780
|
minimumClusterSize: t.minClusterSize,
|
|
1781
1781
|
averageCenter: t.averageCenter,
|
|
1782
|
-
styles: (n = t.styles) == null ? void 0 : n.map((a) =>
|
|
1782
|
+
styles: (n = t.styles) == null ? void 0 : n.map((a) => Te.toGoogle(a)),
|
|
1783
1783
|
zIndex: t.zIndex
|
|
1784
1784
|
}
|
|
1785
1785
|
);
|
|
1786
1786
|
const r = t.stylesIndexCalculator;
|
|
1787
|
-
r && this.inner.setCalculator((a,
|
|
1787
|
+
r && this.inner.setCalculator((a, c) => ({
|
|
1788
1788
|
text: a.length,
|
|
1789
1789
|
// google内部, 取index时, 会`-1`...故我们这里`+1`, 抵消掉它
|
|
1790
|
-
index: r(a.length,
|
|
1790
|
+
index: r(a.length, c) + 1
|
|
1791
1791
|
}));
|
|
1792
1792
|
}
|
|
1793
1793
|
recreate() {
|
|
1794
1794
|
this.inner.repaint();
|
|
1795
1795
|
}
|
|
1796
1796
|
}
|
|
1797
|
-
var
|
|
1797
|
+
var Oe;
|
|
1798
1798
|
((i) => {
|
|
1799
1799
|
function e(r, s) {
|
|
1800
1800
|
const n = r.indexOf(s);
|
|
@@ -1808,8 +1808,8 @@ var be;
|
|
|
1808
1808
|
return n;
|
|
1809
1809
|
}
|
|
1810
1810
|
i.findByType = t;
|
|
1811
|
-
})(
|
|
1812
|
-
var
|
|
1811
|
+
})(Oe || (Oe = {}));
|
|
1812
|
+
var we;
|
|
1813
1813
|
((i) => {
|
|
1814
1814
|
function e(r, s) {
|
|
1815
1815
|
const n = r.getLength();
|
|
@@ -1825,42 +1825,42 @@ var Te;
|
|
|
1825
1825
|
return r.removeAt(n);
|
|
1826
1826
|
}
|
|
1827
1827
|
i.remove = t;
|
|
1828
|
-
})(
|
|
1829
|
-
class
|
|
1828
|
+
})(we || (we = {}));
|
|
1829
|
+
class Rt {
|
|
1830
1830
|
constructor(e, t) {
|
|
1831
|
-
|
|
1832
|
-
|
|
1831
|
+
d(this, "eventMap", /* @__PURE__ */ new Map());
|
|
1832
|
+
d(this, "target", void 0);
|
|
1833
1833
|
this.inner = e, this.coordTypeSupplier = t, this.addEventListener = this.addEventListener.bind(this), this.removeEventListener = this.removeEventListener.bind(this);
|
|
1834
1834
|
}
|
|
1835
1835
|
setTarget(e) {
|
|
1836
1836
|
return this.target = e, this;
|
|
1837
1837
|
}
|
|
1838
1838
|
}
|
|
1839
|
-
const
|
|
1839
|
+
const ft = class extends Rt {
|
|
1840
1840
|
addEventListener(e, t) {
|
|
1841
|
-
const r =
|
|
1841
|
+
const r = _e(e, t);
|
|
1842
1842
|
if (this.eventMap.get(r)) {
|
|
1843
1843
|
console.warn("listener已经添加过了", r, t);
|
|
1844
1844
|
return;
|
|
1845
1845
|
}
|
|
1846
|
-
const s = this.inner.addListener(
|
|
1846
|
+
const s = this.inner.addListener(ft.EVENT_TYPE_MAP[e] || e, (n) => {
|
|
1847
1847
|
const a = {
|
|
1848
1848
|
type: e,
|
|
1849
1849
|
target: this.target,
|
|
1850
1850
|
originalEvent: n
|
|
1851
1851
|
};
|
|
1852
|
-
n != null && n.latLng && (a.position =
|
|
1852
|
+
n != null && n.latLng && (a.position = v.fromGoogle(n.latLng, this.coordTypeSupplier.coordType)), t.call(this.target, a);
|
|
1853
1853
|
});
|
|
1854
1854
|
this.eventMap.set(r, s);
|
|
1855
1855
|
}
|
|
1856
1856
|
removeEventListener(e, t) {
|
|
1857
|
-
const r =
|
|
1857
|
+
const r = _e(e, t), s = this.eventMap.get(r);
|
|
1858
1858
|
s ? (s.remove(), this.eventMap.delete(r)) : console.warn("移除失败, 不存在该listener", r, t);
|
|
1859
1859
|
}
|
|
1860
1860
|
};
|
|
1861
|
-
let
|
|
1861
|
+
let J = ft;
|
|
1862
1862
|
// 事件类型映射: tg => google
|
|
1863
|
-
|
|
1863
|
+
d(J, "EVENT_TYPE_MAP", {
|
|
1864
1864
|
"center-changed": "center_changed",
|
|
1865
1865
|
"zoom-changed": "zoom_changed",
|
|
1866
1866
|
"map-type-changed": "maptypeid_changed",
|
|
@@ -1871,9 +1871,9 @@ h(X, "EVENT_TYPE_MAP", {
|
|
|
1871
1871
|
"map-mouseup": "mouseup",
|
|
1872
1872
|
"map-dblclick": "dblclick"
|
|
1873
1873
|
});
|
|
1874
|
-
const
|
|
1874
|
+
const xe = class extends Rt {
|
|
1875
1875
|
addEventListener(e, t) {
|
|
1876
|
-
const r =
|
|
1876
|
+
const r = _e(e, t);
|
|
1877
1877
|
if (this.eventMap.get(r)) {
|
|
1878
1878
|
console.warn("listener已经添加过了", r, t);
|
|
1879
1879
|
return;
|
|
@@ -1884,27 +1884,27 @@ const Ce = class extends $t {
|
|
|
1884
1884
|
target: this.target,
|
|
1885
1885
|
originalEvent: n
|
|
1886
1886
|
};
|
|
1887
|
-
n.point && (a.position =
|
|
1887
|
+
n.point && (a.position = v.fromBaidu(n.point, this.coordTypeSupplier.coordType)), t.call(this.target, a);
|
|
1888
1888
|
};
|
|
1889
|
-
this.inner.addEventListener(
|
|
1889
|
+
this.inner.addEventListener(xe.EVENT_TYPE_MAP[e] || e, s), this.eventMap.set(r, s);
|
|
1890
1890
|
}
|
|
1891
1891
|
removeEventListener(e, t) {
|
|
1892
|
-
const r =
|
|
1893
|
-
s ? (this.inner.removeEventListener(
|
|
1892
|
+
const r = _e(e, t), s = this.eventMap.get(r);
|
|
1893
|
+
s ? (this.inner.removeEventListener(xe.EVENT_TYPE_MAP[e] || e, s), this.eventMap.delete(r)) : console.warn("移除失败, 不存在该listener", r, t);
|
|
1894
1894
|
}
|
|
1895
1895
|
};
|
|
1896
|
-
let
|
|
1896
|
+
let te = xe;
|
|
1897
1897
|
// cSpell:words clickclose
|
|
1898
1898
|
// 事件类型映射, tg => baidu
|
|
1899
|
-
|
|
1899
|
+
d(te, "EVENT_TYPE_MAP", {
|
|
1900
1900
|
drag: "dragging",
|
|
1901
1901
|
closeclick: "clickclose",
|
|
1902
1902
|
"zoom-changed": "zoomend",
|
|
1903
1903
|
"map-type-changed": "maptypechange"
|
|
1904
1904
|
});
|
|
1905
|
-
class
|
|
1905
|
+
class Pr {
|
|
1906
1906
|
constructor() {
|
|
1907
|
-
|
|
1907
|
+
d(this, "typeMap", /* @__PURE__ */ new Map());
|
|
1908
1908
|
}
|
|
1909
1909
|
addEventListener(e, t) {
|
|
1910
1910
|
let r = this.typeMap.get(e);
|
|
@@ -1912,7 +1912,7 @@ class Or {
|
|
|
1912
1912
|
}
|
|
1913
1913
|
removeEventListener(e, t) {
|
|
1914
1914
|
const r = this.typeMap.get(e);
|
|
1915
|
-
r &&
|
|
1915
|
+
r && Oe.remove(r, t);
|
|
1916
1916
|
}
|
|
1917
1917
|
hasListener(e) {
|
|
1918
1918
|
const t = this.typeMap.get(e);
|
|
@@ -1923,19 +1923,19 @@ class Or {
|
|
|
1923
1923
|
t && t.forEach((r) => r.call(e.target, e));
|
|
1924
1924
|
}
|
|
1925
1925
|
}
|
|
1926
|
-
class
|
|
1926
|
+
class Dt {
|
|
1927
1927
|
constructor(e, t, r, s) {
|
|
1928
|
-
|
|
1929
|
-
|
|
1928
|
+
d(this, "addEventListener");
|
|
1929
|
+
d(this, "removeEventListener");
|
|
1930
1930
|
this.innerOverlay = e, this.coordType = t, this.map = r, this.delegate = s, this.delegate.setTarget(this), this.addEventListener = this.delegate.addEventListener, this.removeEventListener = this.delegate.removeEventListener;
|
|
1931
1931
|
}
|
|
1932
1932
|
remove() {
|
|
1933
1933
|
this.map.removeOverlay(this);
|
|
1934
1934
|
}
|
|
1935
1935
|
}
|
|
1936
|
-
class
|
|
1936
|
+
class He extends Dt {
|
|
1937
1937
|
constructor(e, t, r) {
|
|
1938
|
-
super(e, t, r, new
|
|
1938
|
+
super(e, t, r, new J(e, r));
|
|
1939
1939
|
}
|
|
1940
1940
|
isVisible() {
|
|
1941
1941
|
return this.innerOverlay.getVisible();
|
|
@@ -1944,9 +1944,9 @@ class je extends At {
|
|
|
1944
1944
|
this.innerOverlay.setVisible(e);
|
|
1945
1945
|
}
|
|
1946
1946
|
}
|
|
1947
|
-
class
|
|
1947
|
+
class Ee extends Dt {
|
|
1948
1948
|
constructor(e, t, r) {
|
|
1949
|
-
super(e, t, r, new
|
|
1949
|
+
super(e, t, r, new te(e, r));
|
|
1950
1950
|
}
|
|
1951
1951
|
/** 仅限内部使用; 设为private时, 生成的d.ts文件中, 方法返回值会变成any, 故改成了public */
|
|
1952
1952
|
get overlay() {
|
|
@@ -1963,7 +1963,7 @@ class we extends At {
|
|
|
1963
1963
|
return e !== void 0 && (e || this.setVisible(!1)), this;
|
|
1964
1964
|
}
|
|
1965
1965
|
}
|
|
1966
|
-
class
|
|
1966
|
+
class Fe extends Ee {
|
|
1967
1967
|
constructor(e, t, r, s) {
|
|
1968
1968
|
super(e, t, r), this.state = s;
|
|
1969
1969
|
}
|
|
@@ -1989,7 +1989,7 @@ class Ve extends we {
|
|
|
1989
1989
|
this.innerOverlay.setFillOpacity(e);
|
|
1990
1990
|
}
|
|
1991
1991
|
}
|
|
1992
|
-
class
|
|
1992
|
+
class Ue extends He {
|
|
1993
1993
|
isEditable() {
|
|
1994
1994
|
return this.innerOverlay.getEditable();
|
|
1995
1995
|
}
|
|
@@ -2012,7 +2012,7 @@ class We extends je {
|
|
|
2012
2012
|
this.innerOverlay.setOptions({ fillOpacity: e });
|
|
2013
2013
|
}
|
|
2014
2014
|
}
|
|
2015
|
-
class
|
|
2015
|
+
class Ye extends Fe {
|
|
2016
2016
|
static create(e) {
|
|
2017
2017
|
const t = this.coordType, r = new BMap.Polyline(e.path.map((s) => s.toBaidu(t)), {
|
|
2018
2018
|
enableClicking: e.clickable,
|
|
@@ -2021,16 +2021,16 @@ class He extends Ve {
|
|
|
2021
2021
|
strokeOpacity: e.strokeOpacity,
|
|
2022
2022
|
strokeWeight: e.strokeWeight
|
|
2023
2023
|
});
|
|
2024
|
-
return new
|
|
2024
|
+
return new Ye(r, t, this, { editable: e.editable === !0 }).visibleOptionInternal(e.visible);
|
|
2025
2025
|
}
|
|
2026
2026
|
getPath() {
|
|
2027
|
-
return this.innerOverlay.getPath().map((e) =>
|
|
2027
|
+
return this.innerOverlay.getPath().map((e) => v.fromBaidu(e, this.coordType));
|
|
2028
2028
|
}
|
|
2029
2029
|
setPath(e) {
|
|
2030
2030
|
this.coordType = this.map.coordType, this.innerOverlay.setPath(e.map((t) => t.toBaidu(this.coordType)));
|
|
2031
2031
|
}
|
|
2032
2032
|
}
|
|
2033
|
-
class
|
|
2033
|
+
class qe extends Ue {
|
|
2034
2034
|
static create(e) {
|
|
2035
2035
|
const t = this.coordType, r = new google.maps.Polyline({
|
|
2036
2036
|
path: e.path.map((s) => s.toGoogle(t)),
|
|
@@ -2041,19 +2041,19 @@ class Fe extends We {
|
|
|
2041
2041
|
strokeWeight: e.strokeWeight,
|
|
2042
2042
|
visible: e.visible
|
|
2043
2043
|
});
|
|
2044
|
-
return new
|
|
2044
|
+
return new qe(r, t, this);
|
|
2045
2045
|
}
|
|
2046
2046
|
getPath() {
|
|
2047
2047
|
const e = [];
|
|
2048
2048
|
return this.innerOverlay.getPath().forEach((t) => {
|
|
2049
|
-
e.push(
|
|
2049
|
+
e.push(v.fromGoogle(t, this.coordType));
|
|
2050
2050
|
}), e;
|
|
2051
2051
|
}
|
|
2052
2052
|
setPath(e) {
|
|
2053
2053
|
this.coordType = this.map.coordType, this.innerOverlay.setPath(e.map((t) => t.toGoogle(this.coordType)));
|
|
2054
2054
|
}
|
|
2055
2055
|
}
|
|
2056
|
-
class
|
|
2056
|
+
class Ke extends Fe {
|
|
2057
2057
|
static create(e) {
|
|
2058
2058
|
const t = this.coordType;
|
|
2059
2059
|
e.paths.length > 1 && console.warn("baidu不支持多path, 只会显示paths[0]");
|
|
@@ -2066,16 +2066,16 @@ class Ue extends Ve {
|
|
|
2066
2066
|
fillColor: e.fillColor,
|
|
2067
2067
|
fillOpacity: e.fillOpacity
|
|
2068
2068
|
});
|
|
2069
|
-
return new
|
|
2069
|
+
return new Ke(s, t, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
2070
2070
|
}
|
|
2071
2071
|
getPaths() {
|
|
2072
|
-
return [this.innerOverlay.getPath().map((e) =>
|
|
2072
|
+
return [this.innerOverlay.getPath().map((e) => v.fromBaidu(e, this.coordType))];
|
|
2073
2073
|
}
|
|
2074
2074
|
setPaths(e) {
|
|
2075
2075
|
e.length > 1 && console.warn("baidu不支持多path, 只会显示paths[0]"), this.coordType = this.map.coordType, this.innerOverlay.setPath((e[0] || []).map((t) => t.toBaidu(this.coordType)));
|
|
2076
2076
|
}
|
|
2077
2077
|
}
|
|
2078
|
-
class
|
|
2078
|
+
class Xe extends Ue {
|
|
2079
2079
|
static create(e) {
|
|
2080
2080
|
const t = this.coordType, r = new google.maps.Polygon({
|
|
2081
2081
|
paths: e.paths.map((s) => s.map((n) => n.toGoogle(t))),
|
|
@@ -2088,14 +2088,14 @@ class Ye extends We {
|
|
|
2088
2088
|
fillOpacity: e.fillOpacity,
|
|
2089
2089
|
visible: e.visible
|
|
2090
2090
|
});
|
|
2091
|
-
return new
|
|
2091
|
+
return new Xe(r, t, this);
|
|
2092
2092
|
}
|
|
2093
2093
|
getPaths() {
|
|
2094
2094
|
const e = this.innerOverlay.getPaths(), t = [];
|
|
2095
2095
|
return e.forEach((r) => {
|
|
2096
2096
|
const s = [];
|
|
2097
2097
|
t.push(s), r.forEach((n) => {
|
|
2098
|
-
s.push(
|
|
2098
|
+
s.push(v.fromGoogle(n, this.coordType));
|
|
2099
2099
|
});
|
|
2100
2100
|
}), t;
|
|
2101
2101
|
}
|
|
@@ -2103,7 +2103,7 @@ class Ye extends We {
|
|
|
2103
2103
|
this.coordType = this.map.coordType, this.innerOverlay.setPaths(e.map((t) => t.map((r) => r.toGoogle(this.coordType))));
|
|
2104
2104
|
}
|
|
2105
2105
|
}
|
|
2106
|
-
class
|
|
2106
|
+
class Je extends Fe {
|
|
2107
2107
|
static create(e) {
|
|
2108
2108
|
const t = this.coordType, r = new BMap.Circle(e.center.toBaidu(t), e.radius, {
|
|
2109
2109
|
enableClicking: e.clickable,
|
|
@@ -2114,13 +2114,13 @@ class Ke extends Ve {
|
|
|
2114
2114
|
fillColor: e.fillColor,
|
|
2115
2115
|
fillOpacity: e.fillOpacity
|
|
2116
2116
|
});
|
|
2117
|
-
return new
|
|
2117
|
+
return new Je(r, t, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
2118
2118
|
}
|
|
2119
2119
|
setCenter(e) {
|
|
2120
2120
|
this.coordType = this.map.coordType, this.innerOverlay.setCenter(e.toBaidu(this.coordType));
|
|
2121
2121
|
}
|
|
2122
2122
|
getCenter() {
|
|
2123
|
-
return
|
|
2123
|
+
return v.fromBaidu(this.innerOverlay.getCenter(), this.coordType);
|
|
2124
2124
|
}
|
|
2125
2125
|
setRadius(e) {
|
|
2126
2126
|
this.innerOverlay.setRadius(e);
|
|
@@ -2129,7 +2129,7 @@ class Ke extends Ve {
|
|
|
2129
2129
|
return this.innerOverlay.getRadius();
|
|
2130
2130
|
}
|
|
2131
2131
|
}
|
|
2132
|
-
class
|
|
2132
|
+
class Qe extends Ue {
|
|
2133
2133
|
static create(e) {
|
|
2134
2134
|
const t = this.coordType, r = new google.maps.Circle({
|
|
2135
2135
|
center: e.center.toGoogle(t),
|
|
@@ -2143,13 +2143,13 @@ class qe extends We {
|
|
|
2143
2143
|
fillOpacity: e.fillOpacity,
|
|
2144
2144
|
visible: e.visible
|
|
2145
2145
|
});
|
|
2146
|
-
return new
|
|
2146
|
+
return new Qe(r, t, this);
|
|
2147
2147
|
}
|
|
2148
2148
|
setCenter(e) {
|
|
2149
2149
|
this.coordType = this.map.coordType, this.innerOverlay.setCenter(e.toGoogle(this.coordType));
|
|
2150
2150
|
}
|
|
2151
2151
|
getCenter() {
|
|
2152
|
-
return
|
|
2152
|
+
return v.fromGoogle(this.innerOverlay.getCenter(), this.coordType);
|
|
2153
2153
|
}
|
|
2154
2154
|
setRadius(e) {
|
|
2155
2155
|
this.innerOverlay.setRadius(e);
|
|
@@ -2158,27 +2158,27 @@ class qe extends We {
|
|
|
2158
2158
|
return this.innerOverlay.getRadius();
|
|
2159
2159
|
}
|
|
2160
2160
|
}
|
|
2161
|
-
class
|
|
2161
|
+
class Tt {
|
|
2162
2162
|
/**
|
|
2163
2163
|
* `keys`和`values`数组中可以有相同的值, 若存在相同值, 则index越小的优先级越高
|
|
2164
2164
|
*/
|
|
2165
2165
|
constructor(e, t) {
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2166
|
+
d(this, "keyToValue", /* @__PURE__ */ new Map());
|
|
2167
|
+
d(this, "valueToKey", /* @__PURE__ */ new Map());
|
|
2168
|
+
he(e.length === t.length);
|
|
2169
2169
|
for (let r = e.length - 1; r >= 0; r--)
|
|
2170
2170
|
this.keyToValue.set(e[r], t[r]), this.valueToKey.set(t[r], e[r]);
|
|
2171
2171
|
}
|
|
2172
2172
|
toKey(e) {
|
|
2173
|
-
return this.valueToKey.get(e) ??
|
|
2173
|
+
return this.valueToKey.get(e) ?? L();
|
|
2174
2174
|
}
|
|
2175
2175
|
toValue(e) {
|
|
2176
|
-
return this.keyToValue.get(e) ??
|
|
2176
|
+
return this.keyToValue.get(e) ?? L();
|
|
2177
2177
|
}
|
|
2178
2178
|
}
|
|
2179
|
-
class
|
|
2179
|
+
class Ir {
|
|
2180
2180
|
constructor(e, t = 10) {
|
|
2181
|
-
|
|
2181
|
+
d(this, "map", /* @__PURE__ */ new Map());
|
|
2182
2182
|
this.values = e, this.maxSize4Debug = t;
|
|
2183
2183
|
}
|
|
2184
2184
|
/** 获取保存key-value映射的Map */
|
|
@@ -2202,19 +2202,19 @@ class Cr {
|
|
|
2202
2202
|
return this.getValueMap(e).get(t);
|
|
2203
2203
|
}
|
|
2204
2204
|
get(e, t) {
|
|
2205
|
-
return this.getOrNull(e, t) ??
|
|
2205
|
+
return this.getOrNull(e, t) ?? L(`key(${t})不存在与valueMap(${this.getValueMap(e)})中`);
|
|
2206
2206
|
}
|
|
2207
2207
|
}
|
|
2208
|
-
class
|
|
2208
|
+
class Ot {
|
|
2209
2209
|
constructor(e) {
|
|
2210
|
-
|
|
2210
|
+
d(this, "value");
|
|
2211
2211
|
this.creator = e;
|
|
2212
2212
|
}
|
|
2213
2213
|
get() {
|
|
2214
2214
|
return this.value === void 0 && (this.value = this.creator()), this.value;
|
|
2215
2215
|
}
|
|
2216
2216
|
}
|
|
2217
|
-
var
|
|
2217
|
+
var k = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-center", i.TOP_RIGHT = "top-right", i.BOTTOM_LEFT = "bottom-left", i.BOTTOM_CENTER = "bottom-center", i.BOTTOM_RIGHT = "bottom-right", i.LEFT_TOP = "left-top", i.LEFT_CENTER = "left-center", i.LEFT_BOTTOM = "left-bottom", i.RIGHT_TOP = "right-top", i.RIGHT_CENTER = "right-center", i.RIGHT_BOTTOM = "right-bottom", i))(k || {}), B;
|
|
2218
2218
|
((i) => {
|
|
2219
2219
|
let e, t;
|
|
2220
2220
|
const r = [
|
|
@@ -2233,7 +2233,7 @@ var x = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
|
|
|
2233
2233
|
/* RIGHT_BOTTOM */
|
|
2234
2234
|
];
|
|
2235
2235
|
function s() {
|
|
2236
|
-
return e || (e = new
|
|
2236
|
+
return e || (e = new Tt(r, [
|
|
2237
2237
|
/* | @tg/map |名字相同| baidu | */
|
|
2238
2238
|
/* TOP_LEFT = */
|
|
2239
2239
|
BMAP_ANCHOR_TOP_LEFT,
|
|
@@ -2263,7 +2263,7 @@ var x = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
|
|
|
2263
2263
|
}
|
|
2264
2264
|
i.getBaidu = s;
|
|
2265
2265
|
function n() {
|
|
2266
|
-
return t || (t = new
|
|
2266
|
+
return t || (t = new Tt(r, [
|
|
2267
2267
|
google.maps.ControlPosition.TOP_LEFT,
|
|
2268
2268
|
google.maps.ControlPosition.TOP_CENTER,
|
|
2269
2269
|
google.maps.ControlPosition.TOP_RIGHT,
|
|
@@ -2279,17 +2279,17 @@ var x = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
|
|
|
2279
2279
|
])), t;
|
|
2280
2280
|
}
|
|
2281
2281
|
i.getGoogle = n;
|
|
2282
|
-
})(
|
|
2283
|
-
class
|
|
2282
|
+
})(B || (B = {}));
|
|
2283
|
+
class Lr {
|
|
2284
2284
|
constructor(e) {
|
|
2285
2285
|
/** 实际添加到地图中的control对象 */
|
|
2286
|
-
|
|
2286
|
+
d(this, "inner");
|
|
2287
2287
|
this.position = e;
|
|
2288
2288
|
}
|
|
2289
2289
|
}
|
|
2290
|
-
class
|
|
2290
|
+
class Zt {
|
|
2291
2291
|
}
|
|
2292
|
-
class
|
|
2292
|
+
class et extends Zt {
|
|
2293
2293
|
constructor(e, t) {
|
|
2294
2294
|
super(), this.inner = e, this.position = t;
|
|
2295
2295
|
}
|
|
@@ -2300,10 +2300,10 @@ class Xe extends zt {
|
|
|
2300
2300
|
e ? this.inner.show() : this.inner.hide();
|
|
2301
2301
|
}
|
|
2302
2302
|
getPosition() {
|
|
2303
|
-
return this.position ??
|
|
2303
|
+
return this.position ?? B.getBaidu().toKey(this.inner.getAnchor());
|
|
2304
2304
|
}
|
|
2305
2305
|
setPosition(e) {
|
|
2306
|
-
this.position = e, this.inner.setAnchor(
|
|
2306
|
+
this.position = e, this.inner.setAnchor(B.getBaidu().toValue(e));
|
|
2307
2307
|
}
|
|
2308
2308
|
addTo(e) {
|
|
2309
2309
|
e.innerMap.addControl(this.inner);
|
|
@@ -2312,11 +2312,11 @@ class Xe extends zt {
|
|
|
2312
2312
|
e.innerMap.removeControl(this.inner);
|
|
2313
2313
|
}
|
|
2314
2314
|
}
|
|
2315
|
-
class
|
|
2315
|
+
class tt extends Zt {
|
|
2316
2316
|
constructor(t, r) {
|
|
2317
2317
|
super();
|
|
2318
|
-
|
|
2319
|
-
|
|
2318
|
+
d(this, "visible", !1);
|
|
2319
|
+
d(this, "map");
|
|
2320
2320
|
this._type = t, this.position = r;
|
|
2321
2321
|
}
|
|
2322
2322
|
isVisible() {
|
|
@@ -2339,7 +2339,7 @@ class Je extends zt {
|
|
|
2339
2339
|
}
|
|
2340
2340
|
onCreateOptions() {
|
|
2341
2341
|
return {
|
|
2342
|
-
position:
|
|
2342
|
+
position: B.getGoogle().toValue(this.position)
|
|
2343
2343
|
};
|
|
2344
2344
|
}
|
|
2345
2345
|
tryUpdateOptions() {
|
|
@@ -2349,8 +2349,8 @@ class Je extends zt {
|
|
|
2349
2349
|
});
|
|
2350
2350
|
}
|
|
2351
2351
|
}
|
|
2352
|
-
var
|
|
2353
|
-
class
|
|
2352
|
+
var Gt = /* @__PURE__ */ ((i) => (i.normal = "normal", i.satellite = "satellite", i.hybrid = "hybrid", i))(Gt || {});
|
|
2353
|
+
class P {
|
|
2354
2354
|
constructor(e, t, r, s) {
|
|
2355
2355
|
this.id = e, this.baidu = t, this.google = r, this.googleCoordType = s;
|
|
2356
2356
|
}
|
|
@@ -2358,7 +2358,7 @@ class E {
|
|
|
2358
2358
|
return this.id;
|
|
2359
2359
|
}
|
|
2360
2360
|
getBaiduCoordType() {
|
|
2361
|
-
return
|
|
2361
|
+
return X.bd09;
|
|
2362
2362
|
}
|
|
2363
2363
|
asBaiduMapType() {
|
|
2364
2364
|
return this.baidu();
|
|
@@ -2371,13 +2371,13 @@ class E {
|
|
|
2371
2371
|
return this.google();
|
|
2372
2372
|
}
|
|
2373
2373
|
asGoogleMapType() {
|
|
2374
|
-
|
|
2374
|
+
nr("google的内置地图没有对应的实例");
|
|
2375
2375
|
}
|
|
2376
2376
|
}
|
|
2377
|
-
class
|
|
2377
|
+
class Br {
|
|
2378
2378
|
constructor() {
|
|
2379
|
-
|
|
2380
|
-
|
|
2379
|
+
d(this, "baiduCache", new Ot(() => new BMap.TrafficLayer()));
|
|
2380
|
+
d(this, "googleCache", new Ot(() => new google.maps.TrafficLayer()));
|
|
2381
2381
|
}
|
|
2382
2382
|
asBaiduLayer() {
|
|
2383
2383
|
return this.baiduCache.get();
|
|
@@ -2386,21 +2386,21 @@ class xr {
|
|
|
2386
2386
|
return this.googleCache.get();
|
|
2387
2387
|
}
|
|
2388
2388
|
}
|
|
2389
|
-
var
|
|
2389
|
+
var I;
|
|
2390
2390
|
((i) => {
|
|
2391
|
-
i.NORMAL = new
|
|
2391
|
+
i.NORMAL = new P("normal", () => BMAP_NORMAL_MAP, () => google.maps.MapTypeId.ROADMAP, X.gcj02), i.SATELLITE = new P("satellite", () => BMAP_SATELLITE_MAP, () => google.maps.MapTypeId.SATELLITE, X.wgs84), i.HYBRID = new P("hybrid", () => BMAP_HYBRID_MAP, () => google.maps.MapTypeId.HYBRID, X.gcj02), i.TERRAIN = new P("terrain", () => (
|
|
2392
2392
|
/* 三维 */
|
|
2393
2393
|
BMAP_PERSPECTIVE_MAP
|
|
2394
2394
|
), () => (
|
|
2395
2395
|
/* 地形 */
|
|
2396
2396
|
google.maps.MapTypeId.TERRAIN
|
|
2397
|
-
),
|
|
2398
|
-
})(
|
|
2399
|
-
var
|
|
2400
|
-
const
|
|
2401
|
-
class
|
|
2397
|
+
), X.wgs84), i.BUILD_IN_MAP_TYPES = new Ir([i.NORMAL, i.SATELLITE, i.HYBRID, i.TERRAIN]);
|
|
2398
|
+
})(I || (I = {}));
|
|
2399
|
+
var jt = /* @__PURE__ */ ((i) => (i.DEFAULT = "default", i.HORIZONTAL = "horizontal", i.DROPDOWN = "dropdown", i))(jt || {});
|
|
2400
|
+
const Vt = [I.NORMAL, I.SATELLITE, I.HYBRID];
|
|
2401
|
+
class rt extends et {
|
|
2402
2402
|
static create(e) {
|
|
2403
|
-
const t = e.mapTypes ??
|
|
2403
|
+
const t = e.mapTypes ?? Vt, r = {
|
|
2404
2404
|
default: BMAP_MAPTYPE_CONTROL_HORIZONTAL,
|
|
2405
2405
|
horizontal: BMAP_MAPTYPE_CONTROL_HORIZONTAL,
|
|
2406
2406
|
dropdown: BMAP_MAPTYPE_CONTROL_DROPDOWN
|
|
@@ -2408,74 +2408,74 @@ class Qe extends Xe {
|
|
|
2408
2408
|
type: e.type && r[e.type],
|
|
2409
2409
|
mapTypes: t.map((n) => n.asBaiduMapType())
|
|
2410
2410
|
});
|
|
2411
|
-
return e.position && s.setAnchor(
|
|
2411
|
+
return e.position && s.setAnchor(B.getBaidu().toValue(e.position)), new rt(s, e.position);
|
|
2412
2412
|
}
|
|
2413
2413
|
}
|
|
2414
|
-
const
|
|
2415
|
-
constructor(e = "default", t =
|
|
2416
|
-
super("mapType", t), this.type = e, this.mapTypes = r,
|
|
2414
|
+
const ee = class extends tt {
|
|
2415
|
+
constructor(e = "default", t = k.TOP_LEFT, r = Vt) {
|
|
2416
|
+
super("mapType", t), this.type = e, this.mapTypes = r, ee.type2google || (ee.type2google = {
|
|
2417
2417
|
default: google.maps.MapTypeControlStyle.DEFAULT,
|
|
2418
2418
|
horizontal: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
|
|
2419
2419
|
dropdown: google.maps.MapTypeControlStyle.DROPDOWN_MENU
|
|
2420
2420
|
});
|
|
2421
2421
|
}
|
|
2422
2422
|
static create(e) {
|
|
2423
|
-
return new
|
|
2423
|
+
return new ee(e.type, e.position, e.mapTypes);
|
|
2424
2424
|
}
|
|
2425
2425
|
onCreateOptions() {
|
|
2426
2426
|
const e = super.onCreateOptions();
|
|
2427
|
-
return e.style =
|
|
2427
|
+
return e.style = ee.type2google[this.type], e.mapTypeIds = this.mapTypes.map((t) => t instanceof P ? t.getGoogleMapTypeId() : t.id), e;
|
|
2428
2428
|
}
|
|
2429
2429
|
addTo(e) {
|
|
2430
2430
|
super.addTo(e), this.mapTypes.forEach((t) => {
|
|
2431
|
-
t instanceof
|
|
2431
|
+
t instanceof P || e.innerMap.mapTypes.set(t.id, t.asGoogleMapType());
|
|
2432
2432
|
});
|
|
2433
2433
|
}
|
|
2434
2434
|
};
|
|
2435
|
-
let
|
|
2436
|
-
|
|
2437
|
-
class
|
|
2435
|
+
let ve = ee;
|
|
2436
|
+
d(ve, "type2google");
|
|
2437
|
+
class it extends et {
|
|
2438
2438
|
static create(e) {
|
|
2439
2439
|
const t = new BMap.NavigationControl({
|
|
2440
2440
|
type: BMAP_NAVIGATION_CONTROL_ZOOM,
|
|
2441
2441
|
// enableGeolocation: true,
|
|
2442
|
-
anchor: e.position &&
|
|
2442
|
+
anchor: e.position && B.getBaidu().toValue(e.position)
|
|
2443
2443
|
});
|
|
2444
|
-
return new
|
|
2444
|
+
return new it(t, e.position);
|
|
2445
2445
|
}
|
|
2446
2446
|
}
|
|
2447
|
-
class
|
|
2447
|
+
class st extends tt {
|
|
2448
2448
|
static create(e) {
|
|
2449
|
-
return new
|
|
2449
|
+
return new st(e.position);
|
|
2450
2450
|
}
|
|
2451
|
-
constructor(e =
|
|
2451
|
+
constructor(e = k.RIGHT_BOTTOM) {
|
|
2452
2452
|
super("zoom", e);
|
|
2453
2453
|
}
|
|
2454
2454
|
}
|
|
2455
|
-
class
|
|
2455
|
+
class nt extends et {
|
|
2456
2456
|
static create(e) {
|
|
2457
2457
|
const t = new BMap.ScaleControl({
|
|
2458
|
-
anchor: e.position &&
|
|
2458
|
+
anchor: e.position && B.getBaidu().toValue(e.position)
|
|
2459
2459
|
});
|
|
2460
|
-
return new
|
|
2460
|
+
return new nt(t, e.position);
|
|
2461
2461
|
}
|
|
2462
2462
|
}
|
|
2463
|
-
class
|
|
2463
|
+
class ot extends tt {
|
|
2464
2464
|
static create(e) {
|
|
2465
|
-
return new
|
|
2465
|
+
return new ot(e.position);
|
|
2466
2466
|
}
|
|
2467
|
-
constructor(e =
|
|
2467
|
+
constructor(e = k.BOTTOM_RIGHT) {
|
|
2468
2468
|
super("scale", e);
|
|
2469
2469
|
}
|
|
2470
2470
|
}
|
|
2471
|
-
var
|
|
2471
|
+
var Ne;
|
|
2472
2472
|
((i) => {
|
|
2473
2473
|
function e(t) {
|
|
2474
2474
|
return t.scrollWidth > t.clientWidth || t.scrollHeight > t.clientHeight;
|
|
2475
2475
|
}
|
|
2476
2476
|
i.isScrollable = e;
|
|
2477
|
-
})(
|
|
2478
|
-
var
|
|
2477
|
+
})(Ne || (Ne = {}));
|
|
2478
|
+
var ie;
|
|
2479
2479
|
((i) => {
|
|
2480
2480
|
function e(r) {
|
|
2481
2481
|
return {
|
|
@@ -2497,15 +2497,15 @@ var te;
|
|
|
2497
2497
|
});
|
|
2498
2498
|
}
|
|
2499
2499
|
i.toBaidu = t;
|
|
2500
|
-
})(
|
|
2501
|
-
class
|
|
2500
|
+
})(ie || (ie = {}));
|
|
2501
|
+
class ue extends Ee {
|
|
2502
2502
|
constructor(e, t, r, s) {
|
|
2503
2503
|
super(e, t, r), this.state = s;
|
|
2504
2504
|
}
|
|
2505
2505
|
static create(e) {
|
|
2506
2506
|
const t = this.coordType, r = e.icon, s = {
|
|
2507
2507
|
title: e.title,
|
|
2508
|
-
icon: r &&
|
|
2508
|
+
icon: r && ie.toBaidu(r),
|
|
2509
2509
|
enableClicking: e.clickable,
|
|
2510
2510
|
enableDragging: e.draggable,
|
|
2511
2511
|
// baidu的raiseOnDrag属性, 默认为false, 而我们的options.crossOnDrag默认为true, 故这里需要转换下
|
|
@@ -2513,11 +2513,11 @@ class ce extends we {
|
|
|
2513
2513
|
draggingCursor: e.cursor
|
|
2514
2514
|
}, n = new BMap.Marker(e.position.toBaidu(t), s);
|
|
2515
2515
|
e.zIndex !== void 0 && n.setZIndex(e.zIndex);
|
|
2516
|
-
const a = e.clickable === void 0 ? !0 : e.clickable,
|
|
2517
|
-
return new
|
|
2516
|
+
const a = e.clickable === void 0 ? !0 : e.clickable, c = !!e.draggable;
|
|
2517
|
+
return new ue(n, t, this, { clickable: a, draggable: c, zIndex: e.zIndex }).visibleOptionInternal(e.visible);
|
|
2518
2518
|
}
|
|
2519
2519
|
getPosition() {
|
|
2520
|
-
return
|
|
2520
|
+
return v.fromBaidu(this.innerOverlay.getPosition(), this.coordType);
|
|
2521
2521
|
}
|
|
2522
2522
|
setPosition(e) {
|
|
2523
2523
|
var t;
|
|
@@ -2530,7 +2530,7 @@ class ce extends we {
|
|
|
2530
2530
|
return this.innerOverlay.getTitle();
|
|
2531
2531
|
}
|
|
2532
2532
|
setIcon(e) {
|
|
2533
|
-
const t =
|
|
2533
|
+
const t = ie.toBaidu(e);
|
|
2534
2534
|
this.innerOverlay.setIcon(t);
|
|
2535
2535
|
const r = this.getLabel();
|
|
2536
2536
|
r && r.attachIcon(t);
|
|
@@ -2565,13 +2565,13 @@ class ce extends we {
|
|
|
2565
2565
|
return (e = this.innerOverlay.getLabel()) == null ? void 0 : e.__label__;
|
|
2566
2566
|
}
|
|
2567
2567
|
}
|
|
2568
|
-
class
|
|
2568
|
+
class at extends He {
|
|
2569
2569
|
constructor() {
|
|
2570
2570
|
super(...arguments);
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2571
|
+
d(this, "label");
|
|
2572
|
+
d(this, "labelPositionListener");
|
|
2573
|
+
d(this, "labelVisibleListener");
|
|
2574
|
+
d(this, "labelMapChangedListener");
|
|
2575
2575
|
}
|
|
2576
2576
|
static create(t) {
|
|
2577
2577
|
const r = this.coordType, s = t.icon, n = {
|
|
@@ -2579,7 +2579,7 @@ class st extends je {
|
|
|
2579
2579
|
title: t.title,
|
|
2580
2580
|
zIndex: t.zIndex,
|
|
2581
2581
|
visible: t.visible,
|
|
2582
|
-
icon: s &&
|
|
2582
|
+
icon: s && ie.toGoogle(s),
|
|
2583
2583
|
clickable: t.clickable,
|
|
2584
2584
|
draggable: t.draggable,
|
|
2585
2585
|
// google的crossOnDrag和我们的crossOnDrag是匹配的, 不需要转换
|
|
@@ -2588,10 +2588,10 @@ class st extends je {
|
|
|
2588
2588
|
// InfoWindow相对marker的position的偏移量, 若不指定, 则偏移到marker的icon的上部中央
|
|
2589
2589
|
anchorPoint: new google.maps.Point(0, 0)
|
|
2590
2590
|
};
|
|
2591
|
-
return new
|
|
2591
|
+
return new at(new google.maps.Marker(n), r, this);
|
|
2592
2592
|
}
|
|
2593
2593
|
getPosition() {
|
|
2594
|
-
return
|
|
2594
|
+
return v.fromGoogle(this.innerOverlay.getPosition(), this.coordType);
|
|
2595
2595
|
}
|
|
2596
2596
|
setPosition(t) {
|
|
2597
2597
|
this.coordType = this.map.coordType, this.innerOverlay.setPosition(t.toGoogle(this.coordType));
|
|
@@ -2603,7 +2603,7 @@ class st extends je {
|
|
|
2603
2603
|
return this.innerOverlay.getTitle() || "";
|
|
2604
2604
|
}
|
|
2605
2605
|
setIcon(t) {
|
|
2606
|
-
this.innerOverlay.setIcon(
|
|
2606
|
+
this.innerOverlay.setIcon(ie.toGoogle(t));
|
|
2607
2607
|
}
|
|
2608
2608
|
getIcon() {
|
|
2609
2609
|
return this.innerOverlay.getIcon();
|
|
@@ -2641,7 +2641,7 @@ class st extends je {
|
|
|
2641
2641
|
this.label = void 0, this.labelPositionListener = void 0, this.labelVisibleListener = void 0, this.labelMapChangedListener = void 0;
|
|
2642
2642
|
}
|
|
2643
2643
|
}
|
|
2644
|
-
class
|
|
2644
|
+
class lt {
|
|
2645
2645
|
constructor(e) {
|
|
2646
2646
|
this.delegate = e, this.delegate.setTarget(this);
|
|
2647
2647
|
}
|
|
@@ -2652,40 +2652,40 @@ class nt {
|
|
|
2652
2652
|
this.delegate.removeEventListener(e, t);
|
|
2653
2653
|
}
|
|
2654
2654
|
}
|
|
2655
|
-
class
|
|
2655
|
+
class ht extends lt {
|
|
2656
2656
|
constructor(e, t, r) {
|
|
2657
|
-
super(new
|
|
2657
|
+
super(new te(e, t)), this.inner = e, this.map = t, this.state = r;
|
|
2658
2658
|
}
|
|
2659
2659
|
static create(e) {
|
|
2660
|
-
const t = e.position ||
|
|
2660
|
+
const t = e.position || v.ZERO, r = new BMap.InfoWindow(e.content, {
|
|
2661
2661
|
maxWidth: e.maxWidth,
|
|
2662
2662
|
offset: e.offset && new BMap.Size(e.offset.x, e.offset.y),
|
|
2663
2663
|
enableAutoPan: !e.disableAutoPan
|
|
2664
2664
|
});
|
|
2665
|
-
return new
|
|
2665
|
+
return new ht(r, this, { position: t });
|
|
2666
2666
|
}
|
|
2667
2667
|
isOpen() {
|
|
2668
2668
|
return this.inner.isOpen();
|
|
2669
2669
|
}
|
|
2670
2670
|
open(e) {
|
|
2671
|
-
e ? e.innerOverlay.openInfoWindow(this.inner) : this.map.innerMap.openInfoWindow(this.inner, (this.state.position ||
|
|
2671
|
+
e ? e.innerOverlay.openInfoWindow(this.inner) : this.map.innerMap.openInfoWindow(this.inner, (this.state.position || v.ZERO).toBaidu(this.map.coordType)), this.map.setLatestInfoWindowInternal(this);
|
|
2672
2672
|
}
|
|
2673
2673
|
close() {
|
|
2674
2674
|
this.inner.isOpen() && this.map.innerMap.closeInfoWindow();
|
|
2675
2675
|
}
|
|
2676
2676
|
getPosition() {
|
|
2677
2677
|
const e = this.inner.getPosition();
|
|
2678
|
-
return e &&
|
|
2678
|
+
return e && v.fromBaidu(e, this.map.coordType) || this.state.position || v.ZERO;
|
|
2679
2679
|
}
|
|
2680
2680
|
setPosition(e) {
|
|
2681
2681
|
this.state.position = e, this.inner.isOpen() && this.open();
|
|
2682
2682
|
}
|
|
2683
2683
|
}
|
|
2684
|
-
class
|
|
2684
|
+
class ct extends lt {
|
|
2685
2685
|
constructor(t, r) {
|
|
2686
|
-
super(new
|
|
2687
|
-
|
|
2688
|
-
|
|
2686
|
+
super(new J(t, r));
|
|
2687
|
+
d(this, "eventHub", new Pr());
|
|
2688
|
+
d(this, "isOpened", !1);
|
|
2689
2689
|
this.inner = t, this.map = r, t.addListener("closeclick", () => {
|
|
2690
2690
|
this.isOpened = !1, this.eventHub.hasListener("close") && this.eventHub.notify({ type: "close", target: this });
|
|
2691
2691
|
}), t.addListener("map_changed", () => {
|
|
@@ -2694,14 +2694,14 @@ class at extends nt {
|
|
|
2694
2694
|
});
|
|
2695
2695
|
}
|
|
2696
2696
|
static create(t) {
|
|
2697
|
-
const r = t.position ||
|
|
2697
|
+
const r = t.position || v.ZERO, s = new google.maps.InfoWindow({
|
|
2698
2698
|
content: t.content,
|
|
2699
2699
|
maxWidth: t.maxWidth,
|
|
2700
2700
|
pixelOffset: t.offset && new google.maps.Size(t.offset.x, t.offset.y),
|
|
2701
2701
|
position: r.toGoogle(this.coordType),
|
|
2702
2702
|
disableAutoPan: t.disableAutoPan
|
|
2703
2703
|
});
|
|
2704
|
-
return new
|
|
2704
|
+
return new ct(s, this);
|
|
2705
2705
|
}
|
|
2706
2706
|
isOpen() {
|
|
2707
2707
|
return this.isOpened;
|
|
@@ -2733,25 +2733,25 @@ class at extends nt {
|
|
|
2733
2733
|
this.isOpened && (this.isOpened = !1, this.inner.close(), this.eventHub.notify({ type: "close", target: this }));
|
|
2734
2734
|
}
|
|
2735
2735
|
getPosition() {
|
|
2736
|
-
return
|
|
2736
|
+
return v.fromGoogle(this.inner.getPosition(), this.map.coordType);
|
|
2737
2737
|
}
|
|
2738
2738
|
setPosition(t) {
|
|
2739
2739
|
this.inner.setPosition(t.toGoogle(this.map.coordType));
|
|
2740
2740
|
}
|
|
2741
2741
|
}
|
|
2742
|
-
var
|
|
2742
|
+
var ge;
|
|
2743
2743
|
((i) => {
|
|
2744
2744
|
i.ZERO = { x: 0, y: 0 };
|
|
2745
|
-
})(
|
|
2746
|
-
let
|
|
2747
|
-
function
|
|
2748
|
-
return
|
|
2745
|
+
})(ge || (ge = {}));
|
|
2746
|
+
let Le;
|
|
2747
|
+
function Sr(i, e, t, r) {
|
|
2748
|
+
return Le || (Le = Ar()), new Le(i, e, t, r);
|
|
2749
2749
|
}
|
|
2750
|
-
function
|
|
2750
|
+
function Ar() {
|
|
2751
2751
|
return class extends google.maps.OverlayView {
|
|
2752
2752
|
constructor(t, r, s, n) {
|
|
2753
2753
|
super();
|
|
2754
|
-
|
|
2754
|
+
d(this, "container");
|
|
2755
2755
|
this.position = r, this.offset = s, this.zIndex = n, this.container = document.createElement("div"), this.container.className = "label-container", this.container.style.position = "absolute", n && this.setZIndex(n), this.container.addEventListener("click", () => {
|
|
2756
2756
|
google.maps.event.trigger(this, "click");
|
|
2757
2757
|
}), this.setElement(t);
|
|
@@ -2803,7 +2803,7 @@ function kr() {
|
|
|
2803
2803
|
}
|
|
2804
2804
|
};
|
|
2805
2805
|
}
|
|
2806
|
-
var
|
|
2806
|
+
var se;
|
|
2807
2807
|
((i) => {
|
|
2808
2808
|
function e(r) {
|
|
2809
2809
|
return typeof r == "string" ? r : r.outerHTML;
|
|
@@ -2817,18 +2817,18 @@ var re;
|
|
|
2817
2817
|
return r;
|
|
2818
2818
|
}
|
|
2819
2819
|
i.toElement = t;
|
|
2820
|
-
})(
|
|
2821
|
-
class
|
|
2820
|
+
})(se || (se = {}));
|
|
2821
|
+
class dt extends Ee {
|
|
2822
2822
|
constructor(t, r, s, n) {
|
|
2823
2823
|
super(t, r, s);
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2824
|
+
d(this, "icon");
|
|
2825
|
+
d(this, "content", void 0);
|
|
2826
|
+
d(this, "contentObserver");
|
|
2827
2827
|
this.setContentInternal(n, !0);
|
|
2828
2828
|
}
|
|
2829
2829
|
static create(t) {
|
|
2830
2830
|
var a;
|
|
2831
|
-
const r = this.coordType, s = new BMap.Label(
|
|
2831
|
+
const r = this.coordType, s = new BMap.Label(se.toString(t.content), {
|
|
2832
2832
|
position: (a = t.position) == null ? void 0 : a.toBaidu(r),
|
|
2833
2833
|
offset: t.offset && new BMap.Size(t.offset.x, t.offset.y)
|
|
2834
2834
|
});
|
|
@@ -2837,7 +2837,7 @@ class lt extends we {
|
|
|
2837
2837
|
padding: "0px",
|
|
2838
2838
|
backgroundColor: "unset"
|
|
2839
2839
|
});
|
|
2840
|
-
const n = new
|
|
2840
|
+
const n = new dt(s, r, this, t.content);
|
|
2841
2841
|
return s.__label__ = n, n;
|
|
2842
2842
|
}
|
|
2843
2843
|
setContentInternal(t, r = !1) {
|
|
@@ -2848,13 +2848,13 @@ class lt extends we {
|
|
|
2848
2848
|
characterData: !0,
|
|
2849
2849
|
childList: !0,
|
|
2850
2850
|
subtree: !0
|
|
2851
|
-
})), r || this.innerOverlay.setContent(
|
|
2851
|
+
})), r || this.innerOverlay.setContent(se.toString(t)), this.content = t);
|
|
2852
2852
|
}
|
|
2853
2853
|
setZIndex(t) {
|
|
2854
2854
|
this.innerOverlay.setZIndex(t);
|
|
2855
2855
|
}
|
|
2856
2856
|
getPosition() {
|
|
2857
|
-
return
|
|
2857
|
+
return v.fromBaidu(this.innerOverlay.getPosition(), this.coordType);
|
|
2858
2858
|
}
|
|
2859
2859
|
setPosition(t) {
|
|
2860
2860
|
this.coordType = this.map.coordType, this.innerOverlay.setPosition(t.toBaidu(this.coordType));
|
|
@@ -2881,63 +2881,63 @@ class lt extends we {
|
|
|
2881
2881
|
this.icon && (s -= this.icon.anchor.width, n -= this.icon.anchor.height), t && (s += t.anchor.width, n += t.anchor.height), this.innerOverlay.setOffset(new BMap.Size(s, n)), this.icon = t;
|
|
2882
2882
|
}
|
|
2883
2883
|
}
|
|
2884
|
-
class
|
|
2884
|
+
class pt extends He {
|
|
2885
2885
|
static create(e) {
|
|
2886
2886
|
var s;
|
|
2887
|
-
const t = this.coordType, r =
|
|
2888
|
-
|
|
2887
|
+
const t = this.coordType, r = Sr(
|
|
2888
|
+
se.toElement(e.content),
|
|
2889
2889
|
(s = e.position) == null ? void 0 : s.toGoogle(t),
|
|
2890
2890
|
e.offset,
|
|
2891
2891
|
e.zIndex
|
|
2892
2892
|
);
|
|
2893
|
-
return new
|
|
2893
|
+
return new pt(r, t, this);
|
|
2894
2894
|
}
|
|
2895
2895
|
setZIndex(e) {
|
|
2896
2896
|
this.innerOverlay.setZIndex(e);
|
|
2897
2897
|
}
|
|
2898
2898
|
setContent(e) {
|
|
2899
|
-
this.innerOverlay.setElement(
|
|
2899
|
+
this.innerOverlay.setElement(se.toElement(e));
|
|
2900
2900
|
}
|
|
2901
2901
|
getPosition() {
|
|
2902
2902
|
const e = this.innerOverlay.getPosition();
|
|
2903
|
-
return e ?
|
|
2903
|
+
return e ? v.fromGoogle(e, this.coordType) : v.ZERO;
|
|
2904
2904
|
}
|
|
2905
2905
|
setPosition(e) {
|
|
2906
2906
|
this.coordType = this.map.coordType, this.innerOverlay.setPosition(e.toGoogle(this.coordType));
|
|
2907
2907
|
}
|
|
2908
2908
|
getOffset() {
|
|
2909
|
-
return this.innerOverlay.getOffset() ??
|
|
2909
|
+
return this.innerOverlay.getOffset() ?? ge.ZERO;
|
|
2910
2910
|
}
|
|
2911
2911
|
setOffset(e) {
|
|
2912
2912
|
this.innerOverlay.setOffset(e);
|
|
2913
2913
|
}
|
|
2914
2914
|
}
|
|
2915
|
-
function
|
|
2915
|
+
function Wt() {
|
|
2916
2916
|
BMap.OverlayV3 || (BMap.OverlayV3 = BMap.Overlay);
|
|
2917
2917
|
}
|
|
2918
|
-
let
|
|
2919
|
-
function
|
|
2920
|
-
return
|
|
2918
|
+
let Be;
|
|
2919
|
+
function $r(i, e, t, r, s, n) {
|
|
2920
|
+
return Be || (Be = zr()), new Be(i, e, t, r, s, n);
|
|
2921
2921
|
}
|
|
2922
|
-
function
|
|
2923
|
-
|
|
2922
|
+
function zr() {
|
|
2923
|
+
Wt();
|
|
2924
2924
|
const i = new BMap.Point(0, 0);
|
|
2925
2925
|
return class extends BMap.OverlayV3 {
|
|
2926
|
-
constructor(r, s = i, n =
|
|
2926
|
+
constructor(r, s = i, n = ge.ZERO, a, c = 654, o = "") {
|
|
2927
2927
|
super();
|
|
2928
2928
|
// 类表达式不能有私有成员, 故改成public
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2929
|
+
d(this, "container");
|
|
2930
|
+
d(this, "border");
|
|
2931
|
+
d(this, "inner");
|
|
2932
|
+
d(this, "map");
|
|
2933
|
+
d(this, "marker");
|
|
2934
2934
|
this.content = r, this.position = s, this.offset = n;
|
|
2935
2935
|
const l = "baidu-info-box-container";
|
|
2936
2936
|
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";
|
|
2937
|
-
const
|
|
2938
|
-
|
|
2937
|
+
const h = document.createElement("img");
|
|
2938
|
+
h.className = l + "__close", h.src = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22%23000000%22%3E%0A%20%20%20%20%3Cpath%20d%3D%22M19%206.41L17.59%205%2012%2010.59%206.41%205%205%206.41%2010.59%2012%205%2017.59%206.41%2019%2012%2013.41%2017.59%2019%2019%2017.59%2013.41%2012z%22%2F%3E%0A%20%20%20%20%3Cpath%20d%3D%22M0%200h24v24H0z%22%20fill%3D%22none%22%2F%3E%0A%3C%2Fsvg%3E%0A", h.addEventListener("click", () => {
|
|
2939
2939
|
this.close(), this.dispatchEvent({ type: "onclickclose" });
|
|
2940
|
-
}), this.inner.appendChild(r), this.border.appendChild(this.inner), this.border.appendChild(
|
|
2940
|
+
}), this.inner.appendChild(r), this.border.appendChild(this.inner), this.border.appendChild(h), this.container.appendChild(this.border), a && this.setZIndex(a), this.setMaxWidth(c), this.onMarkerPositionChanged = this.onMarkerPositionChanged.bind(this);
|
|
2941
2941
|
}
|
|
2942
2942
|
/** @override */
|
|
2943
2943
|
initialize(r) {
|
|
@@ -2988,13 +2988,13 @@ function Ir() {
|
|
|
2988
2988
|
}
|
|
2989
2989
|
};
|
|
2990
2990
|
}
|
|
2991
|
-
class
|
|
2991
|
+
class ut extends Ee {
|
|
2992
2992
|
constructor(e, t, r) {
|
|
2993
2993
|
super(e, t, r), this.baiduMap = r;
|
|
2994
2994
|
}
|
|
2995
2995
|
static create(e) {
|
|
2996
2996
|
var s;
|
|
2997
|
-
const t = this.coordType, r =
|
|
2997
|
+
const t = this.coordType, r = $r(
|
|
2998
2998
|
e.content,
|
|
2999
2999
|
(s = e.position) == null ? void 0 : s.toBaidu(t),
|
|
3000
3000
|
e.offset,
|
|
@@ -3002,7 +3002,7 @@ class ct extends we {
|
|
|
3002
3002
|
e.maxWidth,
|
|
3003
3003
|
e.borderClass
|
|
3004
3004
|
);
|
|
3005
|
-
return new
|
|
3005
|
+
return new ut(r, t, this);
|
|
3006
3006
|
}
|
|
3007
3007
|
open(e) {
|
|
3008
3008
|
this.innerOverlay.open(this.baiduMap.innerMap, e == null ? void 0 : e.innerOverlay);
|
|
@@ -3011,7 +3011,7 @@ class ct extends we {
|
|
|
3011
3011
|
this.innerOverlay.close();
|
|
3012
3012
|
}
|
|
3013
3013
|
getPosition() {
|
|
3014
|
-
return
|
|
3014
|
+
return v.fromBaidu(this.innerOverlay.getPosition(), this.coordType);
|
|
3015
3015
|
}
|
|
3016
3016
|
setPosition(e) {
|
|
3017
3017
|
this.coordType = this.map.coordType, this.innerOverlay.setPosition(e.toBaidu(this.coordType));
|
|
@@ -3023,9 +3023,9 @@ class ct extends we {
|
|
|
3023
3023
|
this.innerOverlay.setZIndex(e);
|
|
3024
3024
|
}
|
|
3025
3025
|
}
|
|
3026
|
-
class
|
|
3026
|
+
class gt extends lt {
|
|
3027
3027
|
constructor(e, t, r) {
|
|
3028
|
-
super(new
|
|
3028
|
+
super(new J(e, r)), this.inner = e, this.coordType = t, this.map = r;
|
|
3029
3029
|
}
|
|
3030
3030
|
static create(e) {
|
|
3031
3031
|
var n;
|
|
@@ -3037,10 +3037,10 @@ class dt extends nt {
|
|
|
3037
3037
|
maxWidth: e.maxWidth
|
|
3038
3038
|
}), s = e.borderClass;
|
|
3039
3039
|
return s && r.addListener("domready", () => {
|
|
3040
|
-
var
|
|
3041
|
-
const a = (
|
|
3040
|
+
var c;
|
|
3041
|
+
const a = (c = e.content.parentElement) == null ? void 0 : c.parentElement;
|
|
3042
3042
|
a && a.className.includes("gm-style-iw-c") && !a.className.includes(s) && (a.className += ` ${s}`);
|
|
3043
|
-
}), new
|
|
3043
|
+
}), new gt(r, t, this);
|
|
3044
3044
|
}
|
|
3045
3045
|
open(e) {
|
|
3046
3046
|
this.inner.open(this.map.innerMap, e == null ? void 0 : e.innerOverlay);
|
|
@@ -3049,7 +3049,7 @@ class dt extends nt {
|
|
|
3049
3049
|
this.inner.close();
|
|
3050
3050
|
}
|
|
3051
3051
|
getPosition() {
|
|
3052
|
-
return
|
|
3052
|
+
return v.fromGoogle(this.inner.getPosition(), this.coordType);
|
|
3053
3053
|
}
|
|
3054
3054
|
setPosition(e) {
|
|
3055
3055
|
this.coordType = this.map.coordType, this.inner.setPosition(e.toGoogle(this.coordType));
|
|
@@ -3068,30 +3068,30 @@ class dt extends nt {
|
|
|
3068
3068
|
this.inner.setZIndex(e);
|
|
3069
3069
|
}
|
|
3070
3070
|
}
|
|
3071
|
-
class
|
|
3071
|
+
class Nr extends Ve {
|
|
3072
3072
|
constructor(t, r) {
|
|
3073
3073
|
var s;
|
|
3074
3074
|
super(t);
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
this.buildInMapTypeId2BIMT =
|
|
3075
|
+
d(this, "buildInMapTypeId2BIMT");
|
|
3076
|
+
d(this, "baiduMapType2BIMT");
|
|
3077
|
+
d(this, "map");
|
|
3078
|
+
d(this, "createLabel", dt.create);
|
|
3079
|
+
d(this, "createCircle", Je.create);
|
|
3080
|
+
d(this, "createPolygon", Ke.create);
|
|
3081
|
+
d(this, "createPolyline", Ye.create);
|
|
3082
|
+
d(this, "createInfoWindow", ht.create);
|
|
3083
|
+
d(this, "createInfoBox", ut.create);
|
|
3084
|
+
d(this, "createMarker", ue.create);
|
|
3085
|
+
d(this, "createMapTypeControl", rt.create);
|
|
3086
|
+
d(this, "createZoomControl", it.create);
|
|
3087
|
+
d(this, "createScaleControl", nt.create);
|
|
3088
|
+
this.buildInMapTypeId2BIMT = I.BUILD_IN_MAP_TYPES.getValueMap(P.prototype.getId), this.baiduMapType2BIMT = I.BUILD_IN_MAP_TYPES.getValueMap(P.prototype.asBaiduMapType), this.map = new BMap.Map(t, {
|
|
3089
3089
|
minZoom: r.minZoom,
|
|
3090
3090
|
maxZoom: r.maxZoom,
|
|
3091
3091
|
mapType: r.buildInMapTypeId && ((s = this.buildInMapTypeId2BIMT.get(r.buildInMapTypeId)) == null ? void 0 : s.asBaiduMapType()),
|
|
3092
3092
|
enableMapClick: !1
|
|
3093
3093
|
// 关闭底图点击功能
|
|
3094
|
-
}), this.map.centerAndZoom(r.center.toBaidu(this.coordType), r.zoom), this.setGestureHandling(r.gestureHandling), r.infoWindowMode === "multi" && console.warn("baidu不支持多个InfoWindow, 可能会出现未知问题"), r.mapStyle && this.map.setMapStyleV2(r.mapStyle.toBaidu()), this.setEventTargetDelegate(new
|
|
3094
|
+
}), this.map.centerAndZoom(r.center.toBaidu(this.coordType), r.zoom), this.setGestureHandling(r.gestureHandling), r.infoWindowMode === "multi" && console.warn("baidu不支持多个InfoWindow, 可能会出现未知问题"), r.mapStyle && this.map.setMapStyleV2(r.mapStyle.toBaidu()), this.setEventTargetDelegate(new te(this.map, this)), this.map.addEventListener("addoverlay", (n) => {
|
|
3095
3095
|
const a = n.target.__info_box__;
|
|
3096
3096
|
a && (console.debug("add:info-box", a), this.map.addOverlay(a));
|
|
3097
3097
|
}), this.map.addEventListener("removeoverlay", (n) => {
|
|
@@ -3102,15 +3102,15 @@ class Lr extends Ze {
|
|
|
3102
3102
|
setDefaultCursor(t) {
|
|
3103
3103
|
this.innerMap.setDefaultCursor(t);
|
|
3104
3104
|
}
|
|
3105
|
-
setGestureHandling(t =
|
|
3106
|
-
switch (t ===
|
|
3107
|
-
case
|
|
3105
|
+
setGestureHandling(t = D.auto) {
|
|
3106
|
+
switch (t === D.auto && (t = this.element.parentElement && Ne.isScrollable(this.element.parentElement) ? D.cooperative : D.greedy), t) {
|
|
3107
|
+
case D.cooperative:
|
|
3108
3108
|
this.map.disableScrollWheelZoom(), this.map.enableDragging(), this.map.enableDoubleClickZoom();
|
|
3109
3109
|
break;
|
|
3110
|
-
case
|
|
3110
|
+
case D.greedy:
|
|
3111
3111
|
this.map.enableScrollWheelZoom(), this.map.enableDragging(), this.map.enableDoubleClickZoom();
|
|
3112
3112
|
break;
|
|
3113
|
-
case
|
|
3113
|
+
case D.none:
|
|
3114
3114
|
this.map.disableDragging(), this.map.disableScrollWheelZoom(), this.map.disableDoubleClickZoom();
|
|
3115
3115
|
break;
|
|
3116
3116
|
}
|
|
@@ -3136,7 +3136,7 @@ class Lr extends Ze {
|
|
|
3136
3136
|
super.removeEventListener(t, r);
|
|
3137
3137
|
}
|
|
3138
3138
|
fromContainerPointToLatLng(t) {
|
|
3139
|
-
return
|
|
3139
|
+
return v.fromBaidu(this.innerMap.pixelToPoint(new BMap.Pixel(t.x, t.y)), this.coordType);
|
|
3140
3140
|
}
|
|
3141
3141
|
fromLatLngToContainerPoint(t) {
|
|
3142
3142
|
return this.innerMap.pointToPixel(t.toBaidu(this.coordType));
|
|
@@ -3148,7 +3148,7 @@ class Lr extends Ze {
|
|
|
3148
3148
|
t ? this.map.enableDoubleClickZoom() : this.map.disableDoubleClickZoom();
|
|
3149
3149
|
}
|
|
3150
3150
|
getCenter() {
|
|
3151
|
-
return
|
|
3151
|
+
return v.fromBaidu(this.map.getCenter(), this.coordType);
|
|
3152
3152
|
}
|
|
3153
3153
|
setCenter(t) {
|
|
3154
3154
|
this.map.setCenter(t.toBaidu(this.coordType));
|
|
@@ -3165,14 +3165,14 @@ class Lr extends Ze {
|
|
|
3165
3165
|
setBuildInMapTypeId(t) {
|
|
3166
3166
|
var s;
|
|
3167
3167
|
const r = (s = this.buildInMapTypeId2BIMT.get(t)) == null ? void 0 : s.asBaiduMapType();
|
|
3168
|
-
this.map.setMapType(r ??
|
|
3168
|
+
this.map.setMapType(r ?? L("理论上来说不可能为空"));
|
|
3169
3169
|
}
|
|
3170
3170
|
setMapType(t) {
|
|
3171
3171
|
this.map.setMapType(t.asBaiduMapType());
|
|
3172
3172
|
}
|
|
3173
3173
|
getMapType() {
|
|
3174
3174
|
const t = this.map.getMapType(), r = this.baiduMapType2BIMT.get(t);
|
|
3175
|
-
return r || (t.__baidu_map_type__ ??
|
|
3175
|
+
return r || (t.__baidu_map_type__ ?? L("实现asBaiduMapType()时, 忘了给实例设置__baidu_map_type__?"));
|
|
3176
3176
|
}
|
|
3177
3177
|
addLayer(t) {
|
|
3178
3178
|
this.map.addTileLayer(t.asBaiduLayer());
|
|
@@ -3193,7 +3193,7 @@ class Lr extends Ze {
|
|
|
3193
3193
|
});
|
|
3194
3194
|
}
|
|
3195
3195
|
getBounds() {
|
|
3196
|
-
return
|
|
3196
|
+
return F.fromBaidu(this.map.getBounds(), this.coordType);
|
|
3197
3197
|
}
|
|
3198
3198
|
addElementOverlay(t) {
|
|
3199
3199
|
this.map.addOverlay(t.asBaidu());
|
|
@@ -3212,8 +3212,8 @@ class Lr extends Ze {
|
|
|
3212
3212
|
const r = class extends BMap.Control {
|
|
3213
3213
|
constructor() {
|
|
3214
3214
|
super(...arguments);
|
|
3215
|
-
|
|
3216
|
-
|
|
3215
|
+
d(this, "defaultAnchor", B.getBaidu().toValue(t.position));
|
|
3216
|
+
d(this, "defaultOffset", new BMap.Size(0, 0));
|
|
3217
3217
|
}
|
|
3218
3218
|
initialize(n) {
|
|
3219
3219
|
const a = t.onCreateElement();
|
|
@@ -3224,33 +3224,33 @@ class Lr extends Ze {
|
|
|
3224
3224
|
}
|
|
3225
3225
|
}
|
|
3226
3226
|
removeCustomControl(t) {
|
|
3227
|
-
t.inner && (
|
|
3227
|
+
t.inner && (he(t.inner instanceof BMap.Control, `control.inner(${t.inner})需要是BMap.Control`), this.map.removeControl(t.inner));
|
|
3228
3228
|
}
|
|
3229
3229
|
createMarkerClusterer(t) {
|
|
3230
|
-
return new
|
|
3230
|
+
return new Er(this, t);
|
|
3231
3231
|
}
|
|
3232
3232
|
}
|
|
3233
|
-
class
|
|
3233
|
+
class Rr extends Ve {
|
|
3234
3234
|
constructor(t, r) {
|
|
3235
3235
|
var n;
|
|
3236
3236
|
super(t);
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
this.mapOptions = r, this.buildInMapTypeId2BIMT =
|
|
3237
|
+
d(this, "buildInMapTypeId2BIMT");
|
|
3238
|
+
d(this, "googleMapTypeId2BIMT");
|
|
3239
|
+
d(this, "map");
|
|
3240
|
+
d(this, "createLabel", pt.create);
|
|
3241
|
+
d(this, "createCircle", Qe.create);
|
|
3242
|
+
d(this, "createPolygon", Xe.create);
|
|
3243
|
+
d(this, "createPolyline", qe.create);
|
|
3244
|
+
d(this, "createInfoWindow", ct.create);
|
|
3245
|
+
d(this, "createInfoBox", gt.create);
|
|
3246
|
+
d(this, "createMarker", at.create);
|
|
3247
|
+
d(this, "createMapTypeControl", ve.create);
|
|
3248
|
+
d(this, "createZoomControl", st.create);
|
|
3249
|
+
d(this, "createScaleControl", ot.create);
|
|
3250
|
+
this.mapOptions = r, this.buildInMapTypeId2BIMT = I.BUILD_IN_MAP_TYPES.getValueMap(P.prototype.getId), this.googleMapTypeId2BIMT = I.BUILD_IN_MAP_TYPES.getValueMap(P.prototype.getGoogleMapTypeId);
|
|
3251
3251
|
const s = r.buildInMapTypeId && this.buildInMapTypeId2BIMT.get(r.buildInMapTypeId);
|
|
3252
3252
|
this.map = new google.maps.Map(t, {
|
|
3253
|
-
center: r.center.toGoogle((s ??
|
|
3253
|
+
center: r.center.toGoogle((s ?? I.NORMAL).getGoogleCoordType()),
|
|
3254
3254
|
zoom: r.zoom,
|
|
3255
3255
|
disableDefaultUI: !0,
|
|
3256
3256
|
streetViewControl: !0,
|
|
@@ -3259,7 +3259,7 @@ class Br extends Ze {
|
|
|
3259
3259
|
maxZoom: r.maxZoom,
|
|
3260
3260
|
styles: (n = r.mapStyle) == null ? void 0 : n.toGoogle(),
|
|
3261
3261
|
mapTypeId: s == null ? void 0 : s.getGoogleMapTypeId()
|
|
3262
|
-
}), this.setEventTargetDelegate(new
|
|
3262
|
+
}), this.setEventTargetDelegate(new J(this.map, this));
|
|
3263
3263
|
}
|
|
3264
3264
|
setDefaultCursor(t) {
|
|
3265
3265
|
this.innerMap.setOptions({ draggableCursor: t });
|
|
@@ -3278,16 +3278,16 @@ class Br extends Ze {
|
|
|
3278
3278
|
fromContainerPointToLatLng(t) {
|
|
3279
3279
|
const r = this.innerMap.getProjection(), s = this.innerMap.getBounds();
|
|
3280
3280
|
if (r == null || s == null)
|
|
3281
|
-
return
|
|
3282
|
-
const n = r.fromLatLngToPoint(s.getSouthWest()), a = r.fromLatLngToPoint(s.getNorthEast()),
|
|
3283
|
-
return
|
|
3281
|
+
return v.ZERO;
|
|
3282
|
+
const n = r.fromLatLngToPoint(s.getSouthWest()), a = r.fromLatLngToPoint(s.getNorthEast()), c = Math.pow(2, this.innerMap.getZoom()), o = new google.maps.Point(t.x / c + n.x, t.y / c + a.y);
|
|
3283
|
+
return v.fromGoogle(r.fromPointToLatLng(o), this.coordType);
|
|
3284
3284
|
}
|
|
3285
3285
|
fromLatLngToContainerPoint(t) {
|
|
3286
3286
|
const r = this.innerMap.getProjection(), s = this.innerMap.getBounds();
|
|
3287
3287
|
if (r == null || s == null)
|
|
3288
|
-
return
|
|
3289
|
-
const n = r.fromLatLngToPoint(s.getSouthWest()), a = r.fromLatLngToPoint(s.getNorthEast()),
|
|
3290
|
-
return { x: (o.x - n.x) *
|
|
3288
|
+
return ge.ZERO;
|
|
3289
|
+
const n = r.fromLatLngToPoint(s.getSouthWest()), a = r.fromLatLngToPoint(s.getNorthEast()), c = Math.pow(2, this.innerMap.getZoom()), o = r.fromLatLngToPoint(t.toGoogle(this.coordType));
|
|
3290
|
+
return { x: (o.x - n.x) * c, y: (o.y - a.y) * c };
|
|
3291
3291
|
}
|
|
3292
3292
|
setDraggable(t) {
|
|
3293
3293
|
this.innerMap.setOptions({ draggable: t });
|
|
@@ -3296,7 +3296,7 @@ class Br extends Ze {
|
|
|
3296
3296
|
this.map.setOptions({ disableDoubleClickZoom: t });
|
|
3297
3297
|
}
|
|
3298
3298
|
getCenter() {
|
|
3299
|
-
return
|
|
3299
|
+
return v.fromGoogle(this.map.getCenter(), this.coordType);
|
|
3300
3300
|
}
|
|
3301
3301
|
setCenter(t) {
|
|
3302
3302
|
this.map.setCenter(t.toGoogle(this.coordType));
|
|
@@ -3313,20 +3313,20 @@ class Br extends Ze {
|
|
|
3313
3313
|
setBuildInMapTypeId(t) {
|
|
3314
3314
|
var s;
|
|
3315
3315
|
const r = (s = this.buildInMapTypeId2BIMT.get(t)) == null ? void 0 : s.getGoogleMapTypeId();
|
|
3316
|
-
this.map.setMapTypeId(r ??
|
|
3316
|
+
this.map.setMapTypeId(r ?? L("理论上来说不可能为空"));
|
|
3317
3317
|
}
|
|
3318
3318
|
setMapType(t) {
|
|
3319
|
-
t instanceof
|
|
3319
|
+
t instanceof P ? this.map.setMapTypeId(t.getGoogleMapTypeId()) : (this.map.mapTypes.set(t.id, t.asGoogleMapType()), this.map.setMapTypeId(t.id));
|
|
3320
3320
|
}
|
|
3321
3321
|
getMapType() {
|
|
3322
3322
|
const t = this.map.getMapTypeId(), r = this.googleMapTypeId2BIMT.get(t);
|
|
3323
|
-
return r || (this.map.mapTypes.get(t).__google_map_type__ ??
|
|
3323
|
+
return r || (this.map.mapTypes.get(t).__google_map_type__ ?? L(`实现${t}的asGoogleMapType()时, 忘了给实例设置__google_map_type__?`));
|
|
3324
3324
|
}
|
|
3325
3325
|
addOverlayMapType(t) {
|
|
3326
3326
|
this.map.overlayMapTypes.push(t.asGoogleMapType());
|
|
3327
3327
|
}
|
|
3328
3328
|
removeOverlayMapType(t) {
|
|
3329
|
-
|
|
3329
|
+
we.remove(this.map.overlayMapTypes, t.asGoogleMapType());
|
|
3330
3330
|
}
|
|
3331
3331
|
addLayer(t) {
|
|
3332
3332
|
t.asGoogleLayer().setMap(this.map);
|
|
@@ -3345,7 +3345,7 @@ class Br extends Ze {
|
|
|
3345
3345
|
}
|
|
3346
3346
|
getBounds() {
|
|
3347
3347
|
const t = this.map.getBounds();
|
|
3348
|
-
return t ?
|
|
3348
|
+
return t ? F.fromGoogle(t, this.coordType) : F.EMPTY;
|
|
3349
3349
|
}
|
|
3350
3350
|
addElementOverlay(t) {
|
|
3351
3351
|
t.asGoogle().setMap(this.map);
|
|
@@ -3360,27 +3360,27 @@ class Br extends Ze {
|
|
|
3360
3360
|
t.innerOverlay.setMap(null);
|
|
3361
3361
|
}
|
|
3362
3362
|
addCustomControl(t) {
|
|
3363
|
-
t.inner || (t.inner = t.onCreateElement(), this.map.controls[
|
|
3363
|
+
t.inner || (t.inner = t.onCreateElement(), this.map.controls[B.getGoogle().toValue(t.position)].push(t.inner));
|
|
3364
3364
|
}
|
|
3365
3365
|
removeCustomControl(t) {
|
|
3366
3366
|
if (t.inner) {
|
|
3367
|
-
const r = this.map.controls[
|
|
3368
|
-
|
|
3367
|
+
const r = this.map.controls[B.getGoogle().toValue(t.position)];
|
|
3368
|
+
we.remove(r, t.inner);
|
|
3369
3369
|
}
|
|
3370
3370
|
}
|
|
3371
3371
|
createMarkerClusterer(t) {
|
|
3372
|
-
return new
|
|
3372
|
+
return new kr(this, t);
|
|
3373
3373
|
}
|
|
3374
3374
|
}
|
|
3375
|
-
class
|
|
3375
|
+
class Dr extends Ve {
|
|
3376
3376
|
constructor(t, r) {
|
|
3377
3377
|
var a;
|
|
3378
3378
|
super(t);
|
|
3379
|
-
|
|
3380
|
-
|
|
3379
|
+
d(this, "map");
|
|
3380
|
+
d(this, "defaultLayers");
|
|
3381
3381
|
this.mapOptions = r;
|
|
3382
|
-
const s =
|
|
3383
|
-
|
|
3382
|
+
const s = Lt().here;
|
|
3383
|
+
be.includes(s.version) || L(`不支持${s.version}, HereMap当前只支持如下版本: ${be}`);
|
|
3384
3384
|
const n = new H.service.Platform({
|
|
3385
3385
|
app_id: s.key.split(",")[0],
|
|
3386
3386
|
app_code: s.key.split(",")[1]
|
|
@@ -3397,10 +3397,10 @@ class Sr extends Ze {
|
|
|
3397
3397
|
return this.map;
|
|
3398
3398
|
}
|
|
3399
3399
|
get coordType() {
|
|
3400
|
-
return
|
|
3400
|
+
return X.wgs84;
|
|
3401
3401
|
}
|
|
3402
3402
|
getCenter() {
|
|
3403
|
-
return
|
|
3403
|
+
return v.fromHere(this.map.getCenter(), this.coordType);
|
|
3404
3404
|
}
|
|
3405
3405
|
setCenter(t) {
|
|
3406
3406
|
this.map.setCenter(t.toHere(this.coordType));
|
|
@@ -3509,44 +3509,44 @@ class Sr extends Ze {
|
|
|
3509
3509
|
throw new Error("Method not implemented.");
|
|
3510
3510
|
}
|
|
3511
3511
|
}
|
|
3512
|
-
var $ = /* @__PURE__ */ ((i) => (i.google = "google", i.baidu = "baidu", i.here = "here", i))($ || {}),
|
|
3512
|
+
var $ = /* @__PURE__ */ ((i) => (i.google = "google", i.baidu = "baidu", i.here = "here", i))($ || {}), Re;
|
|
3513
3513
|
((i) => {
|
|
3514
3514
|
function e(t, r, s) {
|
|
3515
|
-
const n =
|
|
3515
|
+
const n = $e.create(s);
|
|
3516
3516
|
switch (t) {
|
|
3517
3517
|
case "google":
|
|
3518
|
-
return new
|
|
3518
|
+
return new Rr(r, n);
|
|
3519
3519
|
case "baidu":
|
|
3520
|
-
return new
|
|
3520
|
+
return new Nr(r, n);
|
|
3521
3521
|
case "here":
|
|
3522
|
-
return new
|
|
3522
|
+
return new Dr(r, n);
|
|
3523
3523
|
}
|
|
3524
3524
|
}
|
|
3525
3525
|
i.createMap = e;
|
|
3526
|
-
})(
|
|
3527
|
-
function
|
|
3528
|
-
const t = window, r =
|
|
3526
|
+
})(Re || (Re = {}));
|
|
3527
|
+
function Zr(i, e) {
|
|
3528
|
+
const t = window, r = Gr(i);
|
|
3529
3529
|
if (t[r])
|
|
3530
3530
|
return Promise.resolve();
|
|
3531
|
-
switch (i !== $.here && !e.key &&
|
|
3531
|
+
switch (i !== $.here && !e.key && L(`请先配置${i}地图的key`), i) {
|
|
3532
3532
|
case $.google:
|
|
3533
|
-
return
|
|
3533
|
+
return wt(`https://maps.googleapis.com/maps/api/js?key=${e.key}&language=${e.language}`);
|
|
3534
3534
|
case $.baidu:
|
|
3535
|
-
return
|
|
3535
|
+
return wt(`https://api.map.baidu.com/api?v=${e.version}&ak=${e.key}`);
|
|
3536
3536
|
case $.here:
|
|
3537
|
-
return
|
|
3537
|
+
return ae(oe("core", e.version)).then(() => Promise.all([
|
|
3538
3538
|
// 其他大多数模块都可以同时载入
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3539
|
+
ae(oe("service", e.version)),
|
|
3540
|
+
ae(oe("mapevents", e.version)),
|
|
3541
|
+
ae(oe("clustering", e.version)),
|
|
3542
|
+
ae(oe("ui", e.version))
|
|
3543
3543
|
])).catch((s) => (delete t[r], Promise.reject(s)));
|
|
3544
3544
|
}
|
|
3545
3545
|
}
|
|
3546
|
-
function
|
|
3546
|
+
function oe(i, e = be[0]) {
|
|
3547
3547
|
return `https://js.api.here.com/v3/${e}/mapsjs-${i}.js`;
|
|
3548
3548
|
}
|
|
3549
|
-
function
|
|
3549
|
+
function Gr(i) {
|
|
3550
3550
|
switch (i) {
|
|
3551
3551
|
case $.google:
|
|
3552
3552
|
return "google";
|
|
@@ -3556,22 +3556,22 @@ function Ar(i) {
|
|
|
3556
3556
|
return "H";
|
|
3557
3557
|
}
|
|
3558
3558
|
}
|
|
3559
|
-
let
|
|
3560
|
-
function
|
|
3559
|
+
let jr = 0;
|
|
3560
|
+
function wt(i, e = "callback") {
|
|
3561
3561
|
return new Promise((t, r) => {
|
|
3562
|
-
const s = `__callback${
|
|
3562
|
+
const s = `__callback${jr++}`;
|
|
3563
3563
|
window[s] = t;
|
|
3564
3564
|
const n = document.createElement("script");
|
|
3565
3565
|
n.src = `${i}&${e}=${s}`, n.onerror = r, document.body.appendChild(n);
|
|
3566
3566
|
});
|
|
3567
3567
|
}
|
|
3568
|
-
function
|
|
3568
|
+
function ae(i) {
|
|
3569
3569
|
return new Promise((e, t) => {
|
|
3570
3570
|
const r = document.createElement("script");
|
|
3571
3571
|
r.src = i, r.onload = e, r.onerror = t, document.body.appendChild(r);
|
|
3572
3572
|
});
|
|
3573
3573
|
}
|
|
3574
|
-
var
|
|
3574
|
+
var Ce;
|
|
3575
3575
|
((i) => {
|
|
3576
3576
|
function e(s, n) {
|
|
3577
3577
|
if (s !== void 0)
|
|
@@ -3585,44 +3585,44 @@ var Oe;
|
|
|
3585
3585
|
}
|
|
3586
3586
|
i.trimIndent = t;
|
|
3587
3587
|
function r(s) {
|
|
3588
|
-
return s.replace(/([^A-Z]?)([A-Z])/g, (n, a,
|
|
3588
|
+
return s.replace(/([^A-Z]?)([A-Z])/g, (n, a, c) => a ? `${a}-${c.toLowerCase()}` : c.toLowerCase());
|
|
3589
3589
|
}
|
|
3590
3590
|
i.pascal2kebab = r;
|
|
3591
|
-
})(
|
|
3592
|
-
const
|
|
3591
|
+
})(Ce || (Ce = {}));
|
|
3592
|
+
const Vr = {
|
|
3593
3593
|
/** @see https://nodejs.org/docs/v10.3.0/api/path.html#path_path_basename_path_ext */
|
|
3594
3594
|
basename(i, e) {
|
|
3595
3595
|
const t = i.endsWith("/") ? i.slice(0, -1) : i, r = t.lastIndexOf("/"), s = r >= 0 ? t.substring(r + 1) : t;
|
|
3596
3596
|
return e && s.endsWith(e) ? s.slice(0, -e.length) : s;
|
|
3597
3597
|
}
|
|
3598
3598
|
};
|
|
3599
|
-
function
|
|
3599
|
+
function Z(i, e) {
|
|
3600
3600
|
return {
|
|
3601
3601
|
type: String,
|
|
3602
3602
|
default: e,
|
|
3603
3603
|
validator: (t) => Object.values(i).includes(t)
|
|
3604
3604
|
};
|
|
3605
3605
|
}
|
|
3606
|
-
function
|
|
3606
|
+
function Wr(i, e) {
|
|
3607
3607
|
return {
|
|
3608
3608
|
type: String,
|
|
3609
3609
|
default: e,
|
|
3610
3610
|
validator: (t) => i.includes(t)
|
|
3611
3611
|
};
|
|
3612
3612
|
}
|
|
3613
|
-
function
|
|
3613
|
+
function N(i) {
|
|
3614
3614
|
return {
|
|
3615
3615
|
type: i,
|
|
3616
3616
|
required: !0
|
|
3617
3617
|
};
|
|
3618
3618
|
}
|
|
3619
|
-
function
|
|
3619
|
+
function f(i, e) {
|
|
3620
3620
|
return {
|
|
3621
3621
|
type: i,
|
|
3622
3622
|
default: e
|
|
3623
3623
|
};
|
|
3624
3624
|
}
|
|
3625
|
-
function
|
|
3625
|
+
function Ai(i) {
|
|
3626
3626
|
const e = {};
|
|
3627
3627
|
return Object.entries(i).forEach(([t, r]) => {
|
|
3628
3628
|
const s = `__${t}`;
|
|
@@ -3639,37 +3639,37 @@ function Ci(i) {
|
|
|
3639
3639
|
};
|
|
3640
3640
|
}), e;
|
|
3641
3641
|
}
|
|
3642
|
-
const
|
|
3642
|
+
const le = {
|
|
3643
3643
|
enumerable: !0,
|
|
3644
3644
|
configurable: !0,
|
|
3645
|
-
get:
|
|
3646
|
-
set:
|
|
3645
|
+
get: Me,
|
|
3646
|
+
set: Me
|
|
3647
3647
|
};
|
|
3648
|
-
function
|
|
3648
|
+
function Hr(i) {
|
|
3649
3649
|
return Object.keys(i).forEach((e) => {
|
|
3650
3650
|
const t = i[e];
|
|
3651
3651
|
let r = !1;
|
|
3652
|
-
typeof t == "function" ? (
|
|
3652
|
+
typeof t == "function" ? (le.get = t, le.set = Me, r = !0) : typeof t == "object" && typeof t.get == "function" && (le.get = t.get, le.set = t.set, r = !0), r && (i[e] = Object.defineProperty(i, e, le));
|
|
3653
3653
|
}), i;
|
|
3654
3654
|
}
|
|
3655
|
-
function
|
|
3656
|
-
return
|
|
3655
|
+
function $i(i) {
|
|
3656
|
+
return Hr(i);
|
|
3657
3657
|
}
|
|
3658
|
-
function
|
|
3659
|
-
return
|
|
3658
|
+
function Fr() {
|
|
3659
|
+
return Se();
|
|
3660
3660
|
}
|
|
3661
|
-
function
|
|
3661
|
+
function ye(i, e) {
|
|
3662
3662
|
const t = i.$options[e];
|
|
3663
3663
|
if (t)
|
|
3664
3664
|
for (const r of t)
|
|
3665
3665
|
r.call(i);
|
|
3666
3666
|
}
|
|
3667
|
-
function
|
|
3667
|
+
function zi(i, e) {
|
|
3668
3668
|
for (const t of i)
|
|
3669
3669
|
if (t.$options.name === e.name)
|
|
3670
3670
|
return t;
|
|
3671
3671
|
}
|
|
3672
|
-
function
|
|
3672
|
+
function Ni(i, e) {
|
|
3673
3673
|
if (!i.default)
|
|
3674
3674
|
return;
|
|
3675
3675
|
const t = i.default();
|
|
@@ -3677,12 +3677,12 @@ function Ei(i, e) {
|
|
|
3677
3677
|
if ((r == null ? void 0 : r.type).name === e.name)
|
|
3678
3678
|
return r;
|
|
3679
3679
|
}
|
|
3680
|
-
function
|
|
3680
|
+
function Ur(i, e) {
|
|
3681
3681
|
const t = {}, r = {}, s = {};
|
|
3682
3682
|
return Object.keys(i).forEach((n) => {
|
|
3683
|
-
n.startsWith("on") ? t[
|
|
3683
|
+
n.startsWith("on") ? t[Ce.pascal2kebab(n.substring(2))] = i[n] : r[n] = i[n];
|
|
3684
3684
|
}), e && Object.keys(e).forEach((n) => {
|
|
3685
|
-
n.startsWith("on") && (s[
|
|
3685
|
+
n.startsWith("on") && (s[Ce.pascal2kebab(n.substring(2))] = e[n]);
|
|
3686
3686
|
}), {
|
|
3687
3687
|
/** class/style/未声明的属性 等 */
|
|
3688
3688
|
binds: r,
|
|
@@ -3692,13 +3692,13 @@ function Gr(i, e) {
|
|
|
3692
3692
|
listenerProps: s
|
|
3693
3693
|
};
|
|
3694
3694
|
}
|
|
3695
|
-
function
|
|
3696
|
-
return
|
|
3695
|
+
function Y(i, e) {
|
|
3696
|
+
return xt(() => Ur(i, e));
|
|
3697
3697
|
}
|
|
3698
|
-
function
|
|
3698
|
+
function R() {
|
|
3699
3699
|
return Function;
|
|
3700
3700
|
}
|
|
3701
|
-
const
|
|
3701
|
+
const Ri = {
|
|
3702
3702
|
/**
|
|
3703
3703
|
* @event 一般来说传{@link Tg.Event}对象, 但传其他对象也不会报错
|
|
3704
3704
|
*/
|
|
@@ -3709,33 +3709,33 @@ const ki = {
|
|
|
3709
3709
|
eventLogLess(i) {
|
|
3710
3710
|
((i && i.type) !== this.$_prev_type || Date.now() - (this.$_prev_time ?? 0) > 1e3) && this.eventLog(i);
|
|
3711
3711
|
}
|
|
3712
|
-
},
|
|
3713
|
-
inject: [
|
|
3712
|
+
}, Ht = "$map", De = "onCreate", Ze = "onDestroy", E = C({
|
|
3713
|
+
inject: [Ht],
|
|
3714
3714
|
mounted() {
|
|
3715
|
-
|
|
3715
|
+
ye(this, De);
|
|
3716
3716
|
},
|
|
3717
3717
|
beforeUnmount() {
|
|
3718
|
-
|
|
3718
|
+
ye(this, Ze);
|
|
3719
3719
|
},
|
|
3720
3720
|
methods: {
|
|
3721
3721
|
recreate() {
|
|
3722
|
-
|
|
3722
|
+
ye(this, Ze), ye(this, De);
|
|
3723
3723
|
}
|
|
3724
3724
|
},
|
|
3725
3725
|
render() {
|
|
3726
|
-
return
|
|
3726
|
+
return Fr();
|
|
3727
3727
|
}
|
|
3728
|
-
}),
|
|
3728
|
+
}), Yr = C({
|
|
3729
3729
|
name: "tg-map",
|
|
3730
3730
|
provide() {
|
|
3731
3731
|
return {
|
|
3732
|
-
[
|
|
3732
|
+
[Ht]: xt(() => this.map)
|
|
3733
3733
|
};
|
|
3734
3734
|
},
|
|
3735
3735
|
inheritAttrs: !1,
|
|
3736
3736
|
props: {
|
|
3737
3737
|
/** type没做响应式, 但外部可以把type作为tg-map的key, 让type修改时完全重建tg-map */
|
|
3738
|
-
type:
|
|
3738
|
+
type: Z($, $.google),
|
|
3739
3739
|
/**
|
|
3740
3740
|
* 当对该属性使用双向绑定时, 改变center将触发update:center又反过来触发center改变, 最终导致无限循环...
|
|
3741
3741
|
* 当前通过setCenter()时判断center是否有改变来避免该问题, 但为了避免可能存在的问题, 另外设计了如下机制:
|
|
@@ -3744,58 +3744,58 @@ const ki = {
|
|
|
3744
3744
|
* - :last-center.sync="center": 获取tg-map销毁时的最后的center的值, 使用这种方式可以做到type切换时保留中心点位置
|
|
3745
3745
|
* @see AbstractMapEventMap.center-changed
|
|
3746
3746
|
* */
|
|
3747
|
-
center:
|
|
3747
|
+
center: N(v),
|
|
3748
3748
|
/**
|
|
3749
3749
|
* 同步center的延时
|
|
3750
3750
|
* @default 300
|
|
3751
3751
|
* @see center
|
|
3752
3752
|
*/
|
|
3753
|
-
centerSyncDelay:
|
|
3753
|
+
centerSyncDelay: f(Number, 300),
|
|
3754
3754
|
/**
|
|
3755
3755
|
* 仅用来获取center的值, 需要设置center的值请使用`center`属性
|
|
3756
3756
|
* @see center
|
|
3757
3757
|
* */
|
|
3758
|
-
currentCenter:
|
|
3758
|
+
currentCenter: f(v),
|
|
3759
3759
|
/**
|
|
3760
3760
|
* 仅用于获取tg-map销毁时的最后的center的值
|
|
3761
3761
|
* @see center
|
|
3762
3762
|
*/
|
|
3763
|
-
lastCenter:
|
|
3764
|
-
zoom:
|
|
3765
|
-
infoWindowMode:
|
|
3766
|
-
gestureHandling: D
|
|
3767
|
-
minZoom:
|
|
3768
|
-
maxZoom:
|
|
3769
|
-
mapStyle:
|
|
3770
|
-
mapTypeId:
|
|
3763
|
+
lastCenter: f(v),
|
|
3764
|
+
zoom: N(Number),
|
|
3765
|
+
infoWindowMode: Wr(Tr),
|
|
3766
|
+
gestureHandling: Z(D),
|
|
3767
|
+
minZoom: f(Number),
|
|
3768
|
+
maxZoom: f(Number),
|
|
3769
|
+
mapStyle: f(Object),
|
|
3770
|
+
mapTypeId: Z(Gt),
|
|
3771
3771
|
/** 地图类型对象, 优先级比mapTypeId高 */
|
|
3772
|
-
mapType:
|
|
3773
|
-
onLoad:
|
|
3774
|
-
"onUpdate:center":
|
|
3775
|
-
"onUpdate:current-center":
|
|
3776
|
-
"onUpdate:last-center":
|
|
3777
|
-
"onUpdate:map-type":
|
|
3778
|
-
"onUpdate:map-type-id":
|
|
3779
|
-
"onUpdate:zoom":
|
|
3780
|
-
onError:
|
|
3772
|
+
mapType: f(Object),
|
|
3773
|
+
onLoad: R(),
|
|
3774
|
+
"onUpdate:center": R(),
|
|
3775
|
+
"onUpdate:current-center": R(),
|
|
3776
|
+
"onUpdate:last-center": R(),
|
|
3777
|
+
"onUpdate:map-type": R(),
|
|
3778
|
+
"onUpdate:map-type-id": R(),
|
|
3779
|
+
"onUpdate:zoom": R(),
|
|
3780
|
+
onError: R()
|
|
3781
3781
|
},
|
|
3782
3782
|
/** 声明事件的类型信息, 详见: {@link splitAttrs} */
|
|
3783
3783
|
emits: void 0,
|
|
3784
3784
|
setup(i, { attrs: e }) {
|
|
3785
3785
|
return {
|
|
3786
|
-
attrs:
|
|
3786
|
+
attrs: Y(e, i),
|
|
3787
3787
|
centerSyncTimeoutId: 0
|
|
3788
3788
|
};
|
|
3789
3789
|
},
|
|
3790
3790
|
data() {
|
|
3791
3791
|
return {
|
|
3792
|
-
map:
|
|
3792
|
+
map: Ae(),
|
|
3793
3793
|
isDestroyed: !1
|
|
3794
3794
|
};
|
|
3795
3795
|
},
|
|
3796
3796
|
computed: {
|
|
3797
3797
|
propsJson() {
|
|
3798
|
-
return
|
|
3798
|
+
return pe.toJsonSafely(this.$props);
|
|
3799
3799
|
}
|
|
3800
3800
|
},
|
|
3801
3801
|
watch: {
|
|
@@ -3828,13 +3828,13 @@ const ki = {
|
|
|
3828
3828
|
},
|
|
3829
3829
|
mapType(i) {
|
|
3830
3830
|
var e;
|
|
3831
|
-
(e = this.map) == null || e.setMapType(i ??
|
|
3831
|
+
(e = this.map) == null || e.setMapType(i ?? I.NORMAL);
|
|
3832
3832
|
}
|
|
3833
3833
|
},
|
|
3834
3834
|
async mounted() {
|
|
3835
3835
|
const i = this.type;
|
|
3836
3836
|
try {
|
|
3837
|
-
await
|
|
3837
|
+
await Zr(i, Lt()[i]);
|
|
3838
3838
|
} catch (s) {
|
|
3839
3839
|
this.$emit("error", s);
|
|
3840
3840
|
return;
|
|
@@ -3843,7 +3843,7 @@ const ki = {
|
|
|
3843
3843
|
console.warn(`tg-map(type=${i})已销毁, 不需要继续执行`);
|
|
3844
3844
|
return;
|
|
3845
3845
|
}
|
|
3846
|
-
const e =
|
|
3846
|
+
const e = Re.createMap(
|
|
3847
3847
|
i,
|
|
3848
3848
|
this.$refs.map,
|
|
3849
3849
|
/* options: */
|
|
@@ -3858,7 +3858,7 @@ const ki = {
|
|
|
3858
3858
|
buildInMapTypeId: this.mapTypeId
|
|
3859
3859
|
}
|
|
3860
3860
|
);
|
|
3861
|
-
if (this.map =
|
|
3861
|
+
if (this.map = Xt(e), this.mapType && e.setMapType(this.mapType), "ready" in this.attrs.listeners && console.error("地图载入完成的事件已经从ready改为了load, 请手动修改"), U(
|
|
3862
3862
|
this.attrs.listeners,
|
|
3863
3863
|
e,
|
|
3864
3864
|
/* excludes: */
|
|
@@ -3885,25 +3885,25 @@ const ki = {
|
|
|
3885
3885
|
},
|
|
3886
3886
|
methods: {}
|
|
3887
3887
|
});
|
|
3888
|
-
const
|
|
3888
|
+
const V = (i, e) => {
|
|
3889
3889
|
const t = i.__vccOpts || i;
|
|
3890
3890
|
for (const [r, s] of e)
|
|
3891
3891
|
t[r] = s;
|
|
3892
3892
|
return t;
|
|
3893
|
-
},
|
|
3893
|
+
}, qr = {
|
|
3894
3894
|
ref: "map",
|
|
3895
3895
|
class: "tg-map__map"
|
|
3896
3896
|
};
|
|
3897
|
-
function
|
|
3898
|
-
return
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
i.map ?
|
|
3902
|
-
|
|
3897
|
+
function Kr(i, e, t, r, s, n) {
|
|
3898
|
+
return G(), j("div", ne({ class: "tg-map" }, i.attrs.binds), [
|
|
3899
|
+
Jt("div", qr, null, 512),
|
|
3900
|
+
Se("", !0),
|
|
3901
|
+
i.map ? z(i.$slots, "default", { key: 1 }) : Se("", !0),
|
|
3902
|
+
z(i.$slots, "overlay")
|
|
3903
3903
|
], 16);
|
|
3904
3904
|
}
|
|
3905
|
-
const
|
|
3906
|
-
function
|
|
3905
|
+
const Xr = /* @__PURE__ */ V(Yr, [["render", Kr]]);
|
|
3906
|
+
function Jr(i) {
|
|
3907
3907
|
if (i == null)
|
|
3908
3908
|
return;
|
|
3909
3909
|
let e;
|
|
@@ -3914,7 +3914,7 @@ function Fr(i) {
|
|
|
3914
3914
|
e = i;
|
|
3915
3915
|
return `${e}px`;
|
|
3916
3916
|
}
|
|
3917
|
-
const
|
|
3917
|
+
const Qr = C({
|
|
3918
3918
|
name: "tg-map-widget",
|
|
3919
3919
|
props: {
|
|
3920
3920
|
left: {
|
|
@@ -3940,22 +3940,22 @@ const Ur = C({
|
|
|
3940
3940
|
}
|
|
3941
3941
|
},
|
|
3942
3942
|
methods: {
|
|
3943
|
-
dimen:
|
|
3943
|
+
dimen: Jr
|
|
3944
3944
|
}
|
|
3945
3945
|
});
|
|
3946
|
-
function
|
|
3947
|
-
return
|
|
3948
|
-
class:
|
|
3949
|
-
style:
|
|
3946
|
+
function ei(i, e, t, r, s, n) {
|
|
3947
|
+
return G(), j("div", {
|
|
3948
|
+
class: je(i.$options.name),
|
|
3949
|
+
style: Qt({ left: i.dimen(i.left), top: i.dimen(i.topValue), right: i.dimen(i.right), bottom: i.dimen(i.bottom) })
|
|
3950
3950
|
}, [
|
|
3951
|
-
|
|
3951
|
+
z(i.$slots, "default")
|
|
3952
3952
|
], 6);
|
|
3953
3953
|
}
|
|
3954
|
-
const
|
|
3954
|
+
const Di = /* @__PURE__ */ V(Qr, [["render", ei]]), ti = C({
|
|
3955
3955
|
name: "tg-custom-control",
|
|
3956
|
-
mixins: [
|
|
3956
|
+
mixins: [E],
|
|
3957
3957
|
props: {
|
|
3958
|
-
position:
|
|
3958
|
+
position: Z(k, k.RIGHT_BOTTOM)
|
|
3959
3959
|
},
|
|
3960
3960
|
setup() {
|
|
3961
3961
|
return {
|
|
@@ -3968,8 +3968,8 @@ const Pi = /* @__PURE__ */ j(Ur, [["render", Yr]]), Kr = C({
|
|
|
3968
3968
|
}
|
|
3969
3969
|
},
|
|
3970
3970
|
onCreate() {
|
|
3971
|
-
|
|
3972
|
-
const { $el: i } = this, e = class extends
|
|
3971
|
+
me(this.$parent, Xr) || console.warn("请将tg-custom-control放到tg-map中");
|
|
3972
|
+
const { $el: i } = this, e = class extends Lr {
|
|
3973
3973
|
onCreateElement() {
|
|
3974
3974
|
return i;
|
|
3975
3975
|
}
|
|
@@ -3980,20 +3980,20 @@ const Pi = /* @__PURE__ */ j(Ur, [["render", Yr]]), Kr = C({
|
|
|
3980
3980
|
this.$map.removeCustomControl(this.control);
|
|
3981
3981
|
}
|
|
3982
3982
|
});
|
|
3983
|
-
function
|
|
3984
|
-
return
|
|
3985
|
-
class:
|
|
3983
|
+
function ri(i, e, t, r, s, n) {
|
|
3984
|
+
return G(), j("div", {
|
|
3985
|
+
class: je(i.$options.name)
|
|
3986
3986
|
}, [
|
|
3987
|
-
|
|
3987
|
+
z(i.$slots, "default")
|
|
3988
3988
|
], 2);
|
|
3989
3989
|
}
|
|
3990
|
-
const
|
|
3990
|
+
const Zi = /* @__PURE__ */ V(ti, [["render", ri]]), Gi = C({
|
|
3991
3991
|
name: "tg-map-type-control",
|
|
3992
|
-
mixins: [
|
|
3992
|
+
mixins: [E],
|
|
3993
3993
|
props: {
|
|
3994
|
-
position:
|
|
3995
|
-
type:
|
|
3996
|
-
mapTypes:
|
|
3994
|
+
position: Z(k, k.TOP_LEFT),
|
|
3995
|
+
type: Z(jt),
|
|
3996
|
+
mapTypes: f(Array)
|
|
3997
3997
|
},
|
|
3998
3998
|
setup() {
|
|
3999
3999
|
return {
|
|
@@ -4020,11 +4020,11 @@ const Ii = /* @__PURE__ */ j(Kr, [["render", qr]]), Li = C({
|
|
|
4020
4020
|
onDestroy() {
|
|
4021
4021
|
this.$map.removeControl(this.control);
|
|
4022
4022
|
}
|
|
4023
|
-
}),
|
|
4023
|
+
}), ji = C({
|
|
4024
4024
|
name: "tg-scale-control",
|
|
4025
|
-
mixins: [
|
|
4025
|
+
mixins: [E],
|
|
4026
4026
|
props: {
|
|
4027
|
-
position:
|
|
4027
|
+
position: Z(k, k.BOTTOM_RIGHT)
|
|
4028
4028
|
},
|
|
4029
4029
|
setup() {
|
|
4030
4030
|
return {
|
|
@@ -4042,11 +4042,11 @@ const Ii = /* @__PURE__ */ j(Kr, [["render", qr]]), Li = C({
|
|
|
4042
4042
|
onDestroy() {
|
|
4043
4043
|
this.$map.removeControl(this.control);
|
|
4044
4044
|
}
|
|
4045
|
-
}),
|
|
4045
|
+
}), Vi = C({
|
|
4046
4046
|
name: "tg-zoom-control",
|
|
4047
|
-
mixins: [
|
|
4047
|
+
mixins: [E],
|
|
4048
4048
|
props: {
|
|
4049
|
-
position:
|
|
4049
|
+
position: Z(k, k.RIGHT_BOTTOM)
|
|
4050
4050
|
},
|
|
4051
4051
|
setup() {
|
|
4052
4052
|
return {
|
|
@@ -4064,18 +4064,18 @@ const Ii = /* @__PURE__ */ j(Kr, [["render", qr]]), Li = C({
|
|
|
4064
4064
|
onDestroy() {
|
|
4065
4065
|
this.$map.removeControl(this.control);
|
|
4066
4066
|
}
|
|
4067
|
-
}),
|
|
4067
|
+
}), ii = C({
|
|
4068
4068
|
name: "tg-marker-clusterer",
|
|
4069
|
-
mixins: [
|
|
4069
|
+
mixins: [E],
|
|
4070
4070
|
// markers从this.$children中读取, 故需要省略(Omit)
|
|
4071
4071
|
props: {
|
|
4072
|
-
gridSize:
|
|
4073
|
-
maxZoom:
|
|
4074
|
-
minClusterSize:
|
|
4075
|
-
averageCenter:
|
|
4076
|
-
styles:
|
|
4077
|
-
stylesIndexCalculator:
|
|
4078
|
-
zIndex:
|
|
4072
|
+
gridSize: f(Number),
|
|
4073
|
+
maxZoom: f(Number),
|
|
4074
|
+
minClusterSize: f(Number),
|
|
4075
|
+
averageCenter: f(Boolean),
|
|
4076
|
+
styles: f(Array),
|
|
4077
|
+
stylesIndexCalculator: f(Function),
|
|
4078
|
+
zIndex: f(Number)
|
|
4079
4079
|
},
|
|
4080
4080
|
setup() {
|
|
4081
4081
|
return {
|
|
@@ -4124,20 +4124,20 @@ const Ii = /* @__PURE__ */ j(Kr, [["render", qr]]), Li = C({
|
|
|
4124
4124
|
this.markers.push(i), this.isInitiated() && this.clusterer.addMarker(i);
|
|
4125
4125
|
},
|
|
4126
4126
|
onRemoveMarker(i) {
|
|
4127
|
-
this.isInitiated() && this.clusterer.removeMarker(i),
|
|
4127
|
+
this.isInitiated() && this.clusterer.removeMarker(i), Oe.remove(this.markers, i);
|
|
4128
4128
|
}
|
|
4129
4129
|
}
|
|
4130
4130
|
});
|
|
4131
|
-
function
|
|
4132
|
-
return
|
|
4133
|
-
class:
|
|
4131
|
+
function si(i, e, t, r, s, n) {
|
|
4132
|
+
return G(), j("div", {
|
|
4133
|
+
class: je(i.$options.name)
|
|
4134
4134
|
}, [
|
|
4135
|
-
|
|
4135
|
+
z(i.$slots, "default")
|
|
4136
4136
|
], 2);
|
|
4137
4137
|
}
|
|
4138
|
-
const
|
|
4138
|
+
const ni = /* @__PURE__ */ V(ii, [["render", si]]), Wi = C({
|
|
4139
4139
|
name: "tg-traffic-layer",
|
|
4140
|
-
mixins: [
|
|
4140
|
+
mixins: [E],
|
|
4141
4141
|
// 请直接使用v-if来控制它的显隐
|
|
4142
4142
|
// 没有属性时, 写`{}`类型推断会有问题, 故注释掉
|
|
4143
4143
|
// props: {} satisfies Props<{}>,
|
|
@@ -4148,30 +4148,30 @@ const Qr = /* @__PURE__ */ j(Xr, [["render", Jr]]), $i = C({
|
|
|
4148
4148
|
},
|
|
4149
4149
|
watch: {},
|
|
4150
4150
|
onCreate() {
|
|
4151
|
-
this.layer = new
|
|
4151
|
+
this.layer = new Br(), this.$map.addLayer(this.layer);
|
|
4152
4152
|
},
|
|
4153
4153
|
onDestroy() {
|
|
4154
4154
|
this.$map.removeLayer(this.layer);
|
|
4155
4155
|
}
|
|
4156
|
-
}),
|
|
4156
|
+
}), Hi = C({
|
|
4157
4157
|
name: "tg-circle",
|
|
4158
|
-
mixins: [
|
|
4158
|
+
mixins: [E],
|
|
4159
4159
|
inheritAttrs: !1,
|
|
4160
4160
|
props: {
|
|
4161
|
-
center:
|
|
4162
|
-
radius:
|
|
4163
|
-
clickable:
|
|
4164
|
-
editable:
|
|
4165
|
-
strokeColor:
|
|
4166
|
-
strokeOpacity:
|
|
4167
|
-
strokeWeight:
|
|
4168
|
-
visible:
|
|
4169
|
-
fillColor:
|
|
4170
|
-
fillOpacity:
|
|
4161
|
+
center: N(v),
|
|
4162
|
+
radius: N(Number),
|
|
4163
|
+
clickable: f(Boolean),
|
|
4164
|
+
editable: f(Boolean),
|
|
4165
|
+
strokeColor: f(String),
|
|
4166
|
+
strokeOpacity: f(Number),
|
|
4167
|
+
strokeWeight: f(Number),
|
|
4168
|
+
visible: f(Boolean),
|
|
4169
|
+
fillColor: f(String),
|
|
4170
|
+
fillOpacity: f(Number)
|
|
4171
4171
|
},
|
|
4172
4172
|
setup(i, { attrs: e }) {
|
|
4173
4173
|
return {
|
|
4174
|
-
attrs:
|
|
4174
|
+
attrs: Y(e),
|
|
4175
4175
|
overlay: void 0
|
|
4176
4176
|
};
|
|
4177
4177
|
},
|
|
@@ -4208,20 +4208,20 @@ const Qr = /* @__PURE__ */ j(Xr, [["render", Jr]]), $i = C({
|
|
|
4208
4208
|
}
|
|
4209
4209
|
},
|
|
4210
4210
|
onCreate() {
|
|
4211
|
-
this.overlay = this.$map.createCircle(this), this.$map.addOverlay(this.overlay),
|
|
4211
|
+
this.overlay = this.$map.createCircle(this), this.$map.addOverlay(this.overlay), U(this.attrs.listeners, this.overlay);
|
|
4212
4212
|
},
|
|
4213
4213
|
onDestroy() {
|
|
4214
4214
|
this.$map.removeOverlay(this.overlay);
|
|
4215
4215
|
}
|
|
4216
4216
|
});
|
|
4217
|
-
var
|
|
4218
|
-
class
|
|
4217
|
+
var Ge = /* @__PURE__ */ ((i) => (i.map = "map", i.overlay = "overlay", i.overlayMouseTarget = "overlayMouseTarget", i.float = "float", i))(Ge || {});
|
|
4218
|
+
class oi {
|
|
4219
4219
|
constructor(e, t) {
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4220
|
+
d(this, "baidu");
|
|
4221
|
+
d(this, "google");
|
|
4222
|
+
d(this, "projection");
|
|
4223
|
+
d(this, "element", void 0);
|
|
4224
|
+
d(this, "mapPane");
|
|
4225
4225
|
this.map = e, this.mapPane = t.mapPane;
|
|
4226
4226
|
}
|
|
4227
4227
|
create() {
|
|
@@ -4236,26 +4236,26 @@ class ei {
|
|
|
4236
4236
|
asBaidu() {
|
|
4237
4237
|
if (!this.baidu) {
|
|
4238
4238
|
const e = this;
|
|
4239
|
-
|
|
4239
|
+
Wt();
|
|
4240
4240
|
class t extends BMap.OverlayV3 {
|
|
4241
4241
|
initialize(n) {
|
|
4242
|
-
const a = e.create(),
|
|
4242
|
+
const a = e.create(), c = n.getPanes();
|
|
4243
4243
|
let o;
|
|
4244
4244
|
switch (e.mapPane) {
|
|
4245
4245
|
case "float":
|
|
4246
|
-
o =
|
|
4246
|
+
o = c.floatPane;
|
|
4247
4247
|
break;
|
|
4248
4248
|
case "overlayMouseTarget":
|
|
4249
|
-
o =
|
|
4249
|
+
o = c.markerMouseTarget;
|
|
4250
4250
|
break;
|
|
4251
4251
|
case "overlay":
|
|
4252
|
-
o =
|
|
4252
|
+
o = c.markerPane;
|
|
4253
4253
|
break;
|
|
4254
4254
|
case "map":
|
|
4255
|
-
o =
|
|
4255
|
+
o = c.mapPane;
|
|
4256
4256
|
break;
|
|
4257
4257
|
default:
|
|
4258
|
-
|
|
4258
|
+
vt(e.mapPane);
|
|
4259
4259
|
break;
|
|
4260
4260
|
}
|
|
4261
4261
|
return o == null || o.appendChild(a), a;
|
|
@@ -4271,7 +4271,7 @@ class ei {
|
|
|
4271
4271
|
return r.pointToOverlayPixel(s.toBaidu(e.map.coordType));
|
|
4272
4272
|
},
|
|
4273
4273
|
fromOverlayPointToLatLng(s) {
|
|
4274
|
-
return
|
|
4274
|
+
return v.fromBaidu(r.overlayPixelToPoint(new BMap.Pixel(s.x, s.y)), e.map.coordType);
|
|
4275
4275
|
}
|
|
4276
4276
|
};
|
|
4277
4277
|
}
|
|
@@ -4298,7 +4298,7 @@ class ei {
|
|
|
4298
4298
|
a = n.mapPane;
|
|
4299
4299
|
break;
|
|
4300
4300
|
default:
|
|
4301
|
-
|
|
4301
|
+
vt(e.mapPane);
|
|
4302
4302
|
break;
|
|
4303
4303
|
}
|
|
4304
4304
|
a.appendChild(s);
|
|
@@ -4316,14 +4316,14 @@ class ei {
|
|
|
4316
4316
|
return e.google.getProjection().fromLatLngToDivPixel(r.toGoogle(e.map.coordType));
|
|
4317
4317
|
},
|
|
4318
4318
|
fromOverlayPointToLatLng(r) {
|
|
4319
|
-
return
|
|
4319
|
+
return v.fromGoogle(e.google.getProjection().fromDivPixelToLatLng(new google.maps.Point(r.x, r.y)), e.map.coordType);
|
|
4320
4320
|
}
|
|
4321
4321
|
};
|
|
4322
4322
|
}
|
|
4323
4323
|
return this.google;
|
|
4324
4324
|
}
|
|
4325
4325
|
}
|
|
4326
|
-
class
|
|
4326
|
+
class ai extends oi {
|
|
4327
4327
|
constructor(e, t, r, s) {
|
|
4328
4328
|
super(e, t), this.content = r, this.position = s;
|
|
4329
4329
|
}
|
|
@@ -4338,12 +4338,12 @@ class ti extends ei {
|
|
|
4338
4338
|
this.position = e, this.draw();
|
|
4339
4339
|
}
|
|
4340
4340
|
}
|
|
4341
|
-
const
|
|
4341
|
+
const li = C({
|
|
4342
4342
|
name: "tg-element-overlay",
|
|
4343
|
-
mixins: [
|
|
4343
|
+
mixins: [E],
|
|
4344
4344
|
props: {
|
|
4345
|
-
mapPane:
|
|
4346
|
-
position:
|
|
4345
|
+
mapPane: Z(Ge, Ge.overlayMouseTarget),
|
|
4346
|
+
position: N(v)
|
|
4347
4347
|
},
|
|
4348
4348
|
setup() {
|
|
4349
4349
|
return {
|
|
@@ -4364,40 +4364,40 @@ const ri = C({
|
|
|
4364
4364
|
}
|
|
4365
4365
|
},
|
|
4366
4366
|
onCreate() {
|
|
4367
|
-
this.overlay = new
|
|
4367
|
+
this.overlay = new ai(this.$map, this, this.content(), this.position), this.$map.addElementOverlay(this.overlay);
|
|
4368
4368
|
},
|
|
4369
4369
|
onDestroy() {
|
|
4370
4370
|
this.$map.removeElementOverlay(this.overlay);
|
|
4371
4371
|
}
|
|
4372
4372
|
});
|
|
4373
|
-
function
|
|
4374
|
-
return
|
|
4373
|
+
function hi(i, e, t, r, s, n) {
|
|
4374
|
+
return G(), j("div", ne({
|
|
4375
4375
|
class: i.$options.name
|
|
4376
4376
|
}, i.$attrs), [
|
|
4377
|
-
|
|
4377
|
+
z(i.$slots, "default")
|
|
4378
4378
|
], 16);
|
|
4379
4379
|
}
|
|
4380
|
-
const
|
|
4380
|
+
const Fi = /* @__PURE__ */ V(li, [["render", hi]]), ci = C({
|
|
4381
4381
|
name: "tg-marker",
|
|
4382
|
-
mixins: [
|
|
4382
|
+
mixins: [E],
|
|
4383
4383
|
inheritAttrs: !1,
|
|
4384
4384
|
props: {
|
|
4385
|
-
position:
|
|
4386
|
-
title:
|
|
4387
|
-
icon:
|
|
4388
|
-
clickable:
|
|
4389
|
-
draggable:
|
|
4390
|
-
crossOnDrag:
|
|
4391
|
-
cursor:
|
|
4392
|
-
zIndex:
|
|
4393
|
-
visible:
|
|
4385
|
+
position: N(v),
|
|
4386
|
+
title: f(String),
|
|
4387
|
+
icon: f(Object),
|
|
4388
|
+
clickable: f(Boolean),
|
|
4389
|
+
draggable: f(Boolean),
|
|
4390
|
+
crossOnDrag: f(Boolean),
|
|
4391
|
+
cursor: f(String),
|
|
4392
|
+
zIndex: f(Number),
|
|
4393
|
+
visible: f(Boolean)
|
|
4394
4394
|
},
|
|
4395
4395
|
setup(i, { attrs: e }) {
|
|
4396
4396
|
return {
|
|
4397
|
-
attrs:
|
|
4397
|
+
attrs: Y(e),
|
|
4398
4398
|
marker: void 0,
|
|
4399
|
-
label:
|
|
4400
|
-
info:
|
|
4399
|
+
label: Ae(),
|
|
4400
|
+
info: Ae()
|
|
4401
4401
|
};
|
|
4402
4402
|
},
|
|
4403
4403
|
watch: {
|
|
@@ -4411,7 +4411,7 @@ const zi = /* @__PURE__ */ j(ri, [["render", ii]]), si = C({
|
|
|
4411
4411
|
i ? this.marker.setIcon(i) : this.recreate();
|
|
4412
4412
|
},
|
|
4413
4413
|
clickable(i) {
|
|
4414
|
-
this.marker instanceof
|
|
4414
|
+
this.marker instanceof ue ? this.recreate() : this.marker.setClickable(i);
|
|
4415
4415
|
},
|
|
4416
4416
|
draggable(i) {
|
|
4417
4417
|
this.marker.setDraggable(i);
|
|
@@ -4423,21 +4423,21 @@ const zi = /* @__PURE__ */ j(ri, [["render", ii]]), si = C({
|
|
|
4423
4423
|
this.recreate();
|
|
4424
4424
|
},
|
|
4425
4425
|
zIndex(i) {
|
|
4426
|
-
this.marker instanceof
|
|
4426
|
+
this.marker instanceof ue ? this.recreate() : this.marker.setZIndex(i);
|
|
4427
4427
|
},
|
|
4428
4428
|
visible(i) {
|
|
4429
4429
|
this.marker.setVisible(i);
|
|
4430
4430
|
}
|
|
4431
4431
|
},
|
|
4432
4432
|
onCreate() {
|
|
4433
|
-
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),
|
|
4433
|
+
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);
|
|
4434
4434
|
},
|
|
4435
4435
|
onDestroy() {
|
|
4436
4436
|
this.$clusterer() ? this.$clusterer().onRemoveMarker(this.marker) : this.$map.removeOverlay(this.marker);
|
|
4437
4437
|
},
|
|
4438
4438
|
methods: {
|
|
4439
4439
|
$clusterer() {
|
|
4440
|
-
return
|
|
4440
|
+
return me(this.$parent, ni);
|
|
4441
4441
|
},
|
|
4442
4442
|
onAddLabel(i) {
|
|
4443
4443
|
this.label = i, this.marker && this.marker.setLabel(i.overlay);
|
|
@@ -4456,30 +4456,30 @@ const zi = /* @__PURE__ */ j(ri, [["render", ii]]), si = C({
|
|
|
4456
4456
|
}
|
|
4457
4457
|
}
|
|
4458
4458
|
});
|
|
4459
|
-
function
|
|
4460
|
-
return
|
|
4459
|
+
function di(i, e, t, r, s, n) {
|
|
4460
|
+
return G(), j("div", ne({
|
|
4461
4461
|
class: i.$options.name
|
|
4462
4462
|
}, i.attrs.binds), [
|
|
4463
|
-
|
|
4463
|
+
z(i.$slots, "default")
|
|
4464
4464
|
], 16);
|
|
4465
4465
|
}
|
|
4466
|
-
const
|
|
4466
|
+
const mt = /* @__PURE__ */ V(ci, [["render", di]]), pi = C({
|
|
4467
4467
|
name: "tg-info-box",
|
|
4468
|
-
mixins: [
|
|
4468
|
+
mixins: [E],
|
|
4469
4469
|
inheritAttrs: !1,
|
|
4470
4470
|
props: {
|
|
4471
|
-
show:
|
|
4472
|
-
position:
|
|
4473
|
-
offset:
|
|
4474
|
-
maxWidth:
|
|
4475
|
-
borderClass:
|
|
4476
|
-
zIndex:
|
|
4477
|
-
"onUpdate:show":
|
|
4471
|
+
show: N(Boolean),
|
|
4472
|
+
position: f(v),
|
|
4473
|
+
offset: f(Object),
|
|
4474
|
+
maxWidth: f(Number),
|
|
4475
|
+
borderClass: f(String),
|
|
4476
|
+
zIndex: f(Number),
|
|
4477
|
+
"onUpdate:show": R()
|
|
4478
4478
|
},
|
|
4479
4479
|
emits: void 0,
|
|
4480
4480
|
setup(i, { attrs: e }) {
|
|
4481
4481
|
return {
|
|
4482
|
-
attrs:
|
|
4482
|
+
attrs: Y(e, i),
|
|
4483
4483
|
overlay: void 0
|
|
4484
4484
|
};
|
|
4485
4485
|
},
|
|
@@ -4506,7 +4506,7 @@ const pt = /* @__PURE__ */ j(si, [["render", ni]]), oi = C({
|
|
|
4506
4506
|
onCreate() {
|
|
4507
4507
|
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", () => {
|
|
4508
4508
|
this.$emit("update:show", !1);
|
|
4509
|
-
}),
|
|
4509
|
+
}), U(this.attrs.listeners, this.overlay);
|
|
4510
4510
|
},
|
|
4511
4511
|
onDestroy() {
|
|
4512
4512
|
this.$marker() ? this.$marker().onRemoveInfo(this) : this.overlay.close();
|
|
@@ -4526,7 +4526,7 @@ const pt = /* @__PURE__ */ j(si, [["render", ni]]), oi = C({
|
|
|
4526
4526
|
return this.$el;
|
|
4527
4527
|
},
|
|
4528
4528
|
$marker() {
|
|
4529
|
-
return
|
|
4529
|
+
return me(this.$parent, mt);
|
|
4530
4530
|
},
|
|
4531
4531
|
open(i) {
|
|
4532
4532
|
this.overlay.open(i);
|
|
@@ -4536,27 +4536,27 @@ const pt = /* @__PURE__ */ j(si, [["render", ni]]), oi = C({
|
|
|
4536
4536
|
}
|
|
4537
4537
|
}
|
|
4538
4538
|
});
|
|
4539
|
-
function
|
|
4540
|
-
return
|
|
4539
|
+
function ui(i, e, t, r, s, n) {
|
|
4540
|
+
return G(), j("div", ne({
|
|
4541
4541
|
class: i.$options.name
|
|
4542
4542
|
}, i.attrs.binds), [
|
|
4543
|
-
|
|
4543
|
+
z(i.$slots, "default")
|
|
4544
4544
|
], 16);
|
|
4545
4545
|
}
|
|
4546
|
-
const
|
|
4546
|
+
const Ui = /* @__PURE__ */ V(pi, [["render", ui]]), gi = C({
|
|
4547
4547
|
name: "tg-info-window",
|
|
4548
|
-
mixins: [
|
|
4548
|
+
mixins: [E],
|
|
4549
4549
|
inheritAttrs: !1,
|
|
4550
4550
|
props: {
|
|
4551
|
-
show:
|
|
4552
|
-
position:
|
|
4553
|
-
maxWidth:
|
|
4554
|
-
offset:
|
|
4555
|
-
disableAutoPan:
|
|
4551
|
+
show: N(Boolean),
|
|
4552
|
+
position: f(v),
|
|
4553
|
+
maxWidth: f(Number),
|
|
4554
|
+
offset: f(Object),
|
|
4555
|
+
disableAutoPan: f(Boolean)
|
|
4556
4556
|
},
|
|
4557
4557
|
setup(i, { attrs: e }) {
|
|
4558
4558
|
return {
|
|
4559
|
-
attrs:
|
|
4559
|
+
attrs: Y(e),
|
|
4560
4560
|
overlay: void 0
|
|
4561
4561
|
};
|
|
4562
4562
|
},
|
|
@@ -4582,7 +4582,7 @@ const Ni = /* @__PURE__ */ j(oi, [["render", ai]]), li = C({
|
|
|
4582
4582
|
return this.$el;
|
|
4583
4583
|
},
|
|
4584
4584
|
$marker() {
|
|
4585
|
-
return
|
|
4585
|
+
return me(this.$parent, mt);
|
|
4586
4586
|
},
|
|
4587
4587
|
getOptions() {
|
|
4588
4588
|
return {
|
|
@@ -4599,33 +4599,33 @@ const Ni = /* @__PURE__ */ j(oi, [["render", ai]]), li = C({
|
|
|
4599
4599
|
this.$emit("update:show", !0);
|
|
4600
4600
|
}), this.overlay.addEventListener("close", () => {
|
|
4601
4601
|
this.$emit("update:show", !1);
|
|
4602
|
-
}),
|
|
4602
|
+
}), U(this.attrs.listeners, this.overlay);
|
|
4603
4603
|
},
|
|
4604
4604
|
onDestroy() {
|
|
4605
4605
|
this.$marker() ? this.$marker().onRemoveInfo(this) : this.overlay.close();
|
|
4606
4606
|
}
|
|
4607
4607
|
});
|
|
4608
|
-
function
|
|
4609
|
-
return
|
|
4608
|
+
function mi(i, e, t, r, s, n) {
|
|
4609
|
+
return er((G(), j("div", ne({
|
|
4610
4610
|
class: i.$options.name
|
|
4611
4611
|
}, i.attrs.binds), [
|
|
4612
|
-
|
|
4612
|
+
z(i.$slots, "default")
|
|
4613
4613
|
], 16)), [
|
|
4614
|
-
[
|
|
4614
|
+
[tr, i.show]
|
|
4615
4615
|
]);
|
|
4616
4616
|
}
|
|
4617
|
-
const
|
|
4617
|
+
const Yi = /* @__PURE__ */ V(gi, [["render", mi]]), fi = C({
|
|
4618
4618
|
name: "tg-label",
|
|
4619
|
-
mixins: [
|
|
4619
|
+
mixins: [E],
|
|
4620
4620
|
inheritAttrs: !1,
|
|
4621
4621
|
props: {
|
|
4622
|
-
position:
|
|
4623
|
-
offset:
|
|
4624
|
-
zIndex:
|
|
4622
|
+
position: f(v),
|
|
4623
|
+
offset: f(Object),
|
|
4624
|
+
zIndex: f(Number)
|
|
4625
4625
|
},
|
|
4626
4626
|
setup(i, { attrs: e }) {
|
|
4627
4627
|
return {
|
|
4628
|
-
attrs:
|
|
4628
|
+
attrs: Y(e),
|
|
4629
4629
|
overlay: void 0
|
|
4630
4630
|
};
|
|
4631
4631
|
},
|
|
@@ -4652,7 +4652,7 @@ const Ri = /* @__PURE__ */ j(li, [["render", hi]]), ci = C({
|
|
|
4652
4652
|
return (i = this.$marker()) == null ? void 0 : i.marker;
|
|
4653
4653
|
},
|
|
4654
4654
|
$marker() {
|
|
4655
|
-
return
|
|
4655
|
+
return me(this.$parent, mt);
|
|
4656
4656
|
},
|
|
4657
4657
|
getOptions() {
|
|
4658
4658
|
return {
|
|
@@ -4664,37 +4664,37 @@ const Ri = /* @__PURE__ */ j(li, [["render", hi]]), ci = C({
|
|
|
4664
4664
|
}
|
|
4665
4665
|
},
|
|
4666
4666
|
onCreate() {
|
|
4667
|
-
this.overlay = this.$map.createLabel(this.getOptions()), this.$marker() ? this.$marker().onAddLabel(this) : this.$map.addOverlay(this.overlay),
|
|
4667
|
+
this.overlay = this.$map.createLabel(this.getOptions()), this.$marker() ? this.$marker().onAddLabel(this) : this.$map.addOverlay(this.overlay), U(this.attrs.listeners, this.overlay);
|
|
4668
4668
|
},
|
|
4669
4669
|
onDestroy() {
|
|
4670
4670
|
this.$marker() ? this.$marker().onRemoveLabel(this) : this.$map.removeOverlay(this.overlay);
|
|
4671
4671
|
}
|
|
4672
4672
|
});
|
|
4673
|
-
function
|
|
4674
|
-
return
|
|
4673
|
+
function yi(i, e, t, r, s, n) {
|
|
4674
|
+
return G(), j("div", ne({
|
|
4675
4675
|
class: i.$options.name
|
|
4676
4676
|
}, i.attrs.binds), [
|
|
4677
|
-
|
|
4677
|
+
z(i.$slots, "default")
|
|
4678
4678
|
], 16);
|
|
4679
4679
|
}
|
|
4680
|
-
const
|
|
4680
|
+
const qi = /* @__PURE__ */ V(fi, [["render", yi]]), Ki = C({
|
|
4681
4681
|
name: "tg-polygon",
|
|
4682
|
-
mixins: [
|
|
4682
|
+
mixins: [E],
|
|
4683
4683
|
inheritAttrs: !1,
|
|
4684
4684
|
props: {
|
|
4685
|
-
paths:
|
|
4686
|
-
clickable:
|
|
4687
|
-
editable:
|
|
4688
|
-
strokeColor:
|
|
4689
|
-
strokeOpacity:
|
|
4690
|
-
strokeWeight:
|
|
4691
|
-
visible:
|
|
4692
|
-
fillColor:
|
|
4693
|
-
fillOpacity:
|
|
4685
|
+
paths: N(Array),
|
|
4686
|
+
clickable: f(Boolean),
|
|
4687
|
+
editable: f(Boolean),
|
|
4688
|
+
strokeColor: f(String),
|
|
4689
|
+
strokeOpacity: f(Number),
|
|
4690
|
+
strokeWeight: f(Number),
|
|
4691
|
+
visible: f(Boolean),
|
|
4692
|
+
fillColor: f(String),
|
|
4693
|
+
fillOpacity: f(Number)
|
|
4694
4694
|
},
|
|
4695
4695
|
setup(i, { attrs: e }) {
|
|
4696
4696
|
return {
|
|
4697
|
-
attrs:
|
|
4697
|
+
attrs: Y(e),
|
|
4698
4698
|
polygon: void 0
|
|
4699
4699
|
};
|
|
4700
4700
|
},
|
|
@@ -4731,27 +4731,27 @@ const Di = /* @__PURE__ */ j(ci, [["render", di]]), Zi = C({
|
|
|
4731
4731
|
}
|
|
4732
4732
|
},
|
|
4733
4733
|
onCreate() {
|
|
4734
|
-
this.polygon = this.$map.createPolygon(this), this.$map.addOverlay(this.polygon),
|
|
4734
|
+
this.polygon = this.$map.createPolygon(this), this.$map.addOverlay(this.polygon), U(this.attrs.listeners, this.polygon);
|
|
4735
4735
|
},
|
|
4736
4736
|
onDestroy() {
|
|
4737
4737
|
this.$map.removeOverlay(this.polygon);
|
|
4738
4738
|
}
|
|
4739
|
-
}),
|
|
4739
|
+
}), Xi = C({
|
|
4740
4740
|
name: "tg-polyline",
|
|
4741
|
-
mixins: [
|
|
4741
|
+
mixins: [E],
|
|
4742
4742
|
inheritAttrs: !1,
|
|
4743
4743
|
props: {
|
|
4744
|
-
path:
|
|
4745
|
-
clickable:
|
|
4746
|
-
editable:
|
|
4747
|
-
strokeColor:
|
|
4748
|
-
strokeOpacity:
|
|
4749
|
-
strokeWeight:
|
|
4750
|
-
visible:
|
|
4744
|
+
path: N(Array),
|
|
4745
|
+
clickable: f(Boolean),
|
|
4746
|
+
editable: f(Boolean),
|
|
4747
|
+
strokeColor: f(String),
|
|
4748
|
+
strokeOpacity: f(Number),
|
|
4749
|
+
strokeWeight: f(Number),
|
|
4750
|
+
visible: f(Boolean)
|
|
4751
4751
|
},
|
|
4752
4752
|
setup(i, { attrs: e }) {
|
|
4753
4753
|
return {
|
|
4754
|
-
attrs:
|
|
4754
|
+
attrs: Y(e),
|
|
4755
4755
|
polyline: void 0
|
|
4756
4756
|
};
|
|
4757
4757
|
},
|
|
@@ -4782,25 +4782,25 @@ const Di = /* @__PURE__ */ j(ci, [["render", di]]), Zi = C({
|
|
|
4782
4782
|
}
|
|
4783
4783
|
},
|
|
4784
4784
|
onCreate() {
|
|
4785
|
-
this.polyline = this.$map.createPolyline(this), this.$map.addOverlay(this.polyline),
|
|
4785
|
+
this.polyline = this.$map.createPolyline(this), this.$map.addOverlay(this.polyline), U(this.attrs.listeners, this.polyline);
|
|
4786
4786
|
},
|
|
4787
4787
|
onDestroy() {
|
|
4788
4788
|
this.$map.removeOverlay(this.polyline);
|
|
4789
4789
|
}
|
|
4790
|
-
}),
|
|
4790
|
+
}), vi = ["beforeUpdate", "updated"], Ji = {
|
|
4791
4791
|
install(i, e = {}) {
|
|
4792
4792
|
if (e.enable !== !1) {
|
|
4793
4793
|
const t = C({
|
|
4794
4794
|
beforeCreate() {
|
|
4795
|
-
var a,
|
|
4796
|
-
let r = this.$options.name || ((a =
|
|
4795
|
+
var a, c;
|
|
4796
|
+
let r = this.$options.name || ((a = yt()) == null ? void 0 : a.type.__name) || "";
|
|
4797
4797
|
if (!r) {
|
|
4798
|
-
const o = (
|
|
4799
|
-
o && (r =
|
|
4798
|
+
const o = (c = yt()) == null ? void 0 : c.type.__file;
|
|
4799
|
+
o && (r = Vr.basename(o, ".vue"));
|
|
4800
4800
|
}
|
|
4801
4801
|
const n = (e.nameRegex || /^[A-Z]/).test(r) ? (o) => {
|
|
4802
|
-
e.hookNames ? e.hookNames.includes(o) && console.debug("[lifecycle]", r, o) :
|
|
4803
|
-
} :
|
|
4802
|
+
e.hookNames ? e.hookNames.includes(o) && console.debug("[lifecycle]", r, o) : vi.includes(o) || console.debug("[lifecycle]", r, o);
|
|
4803
|
+
} : Me;
|
|
4804
4804
|
n("beforeCreate"), this.__life_impl = n;
|
|
4805
4805
|
},
|
|
4806
4806
|
created() {
|
|
@@ -4839,112 +4839,148 @@ const Di = /* @__PURE__ */ j(ci, [["render", di]]), Zi = C({
|
|
|
4839
4839
|
i.mixin(t);
|
|
4840
4840
|
}
|
|
4841
4841
|
}
|
|
4842
|
-
},
|
|
4842
|
+
}, _i = 6378137;
|
|
4843
|
+
function ce(i) {
|
|
4844
|
+
return i * Math.PI / 180;
|
|
4845
|
+
}
|
|
4846
|
+
function Ct(i) {
|
|
4847
|
+
return i * 180 / Math.PI;
|
|
4848
|
+
}
|
|
4849
|
+
function Mi(i, e) {
|
|
4850
|
+
if (i.lat === e.lat && i.lng === e.lng)
|
|
4851
|
+
return 0;
|
|
4852
|
+
const t = ce((i.lat + e.lat) / 2), r = ce((i.lat - e.lat) / 2), s = ce((i.lng - e.lng) / 2);
|
|
4853
|
+
let n = Math.sin(r), a = Math.sin(s), c = Math.sin(t);
|
|
4854
|
+
const o = _i, l = 1 / 298.257;
|
|
4855
|
+
n = n * n, a = a * a, c = c * c;
|
|
4856
|
+
const h = n * (1 - a) + (1 - c) * a, u = (1 - n) * (1 - a) + c * a, p = Math.atan(Math.sqrt(h / u)), b = Math.sqrt(h * u) / p, _ = 2 * p * o, M = (3 * b - 1) / 2 / u, g = (3 * b + 1) / 2 / h;
|
|
4857
|
+
return _ * (1 + l * (M * c * (1 - n) - g * (1 - c) * n));
|
|
4858
|
+
}
|
|
4859
|
+
function bi(i, e, t) {
|
|
4860
|
+
const s = 63567523142e-4, n = 1 / 298.257223563, a = ce(e), c = Math.sin(a), o = Math.cos(a), l = (1 - n) * Math.tan(ce(i.lat)), h = 1 / Math.sqrt(1 + l * l), u = l * h, p = Math.atan2(l, o), b = h * c, _ = 1 - b * b, M = _ * (6378137 * 6378137 - s * s) / (s * s), g = 1 + M / 16384 * (4096 + M * (-768 + M * (320 - 175 * M))), m = M / 1024 * (256 + M * (-128 + M * (74 - 47 * M)));
|
|
4861
|
+
let y = 0, O = 0, x = 0, w = t / (s * g), q = 2 * Math.PI;
|
|
4862
|
+
for (; Math.abs(w - q) > 1e-12; ) {
|
|
4863
|
+
y = Math.cos(2 * p + w), O = Math.sin(w), x = Math.cos(w);
|
|
4864
|
+
const Yt = m * O * (y + m / 4 * (x * (-1 + 2 * y * y) - m / 6 * y * (-3 + 4 * O * O) * (-3 + 4 * y * y)));
|
|
4865
|
+
q = w, w = t / (s * g) + Yt;
|
|
4866
|
+
}
|
|
4867
|
+
const Q = u * O - h * x * o, ke = Math.atan2(
|
|
4868
|
+
u * x + h * O * o,
|
|
4869
|
+
(1 - n) * Math.sqrt(b * b + Q * Q)
|
|
4870
|
+
), Ft = Math.atan2(O * c, h * x - u * O * o), Pe = n / 16 * _ * (4 + n * (4 - 3 * _)), Ut = Ft - (1 - Pe) * n * b * (w + Pe * O * (y + Pe * x * (-1 + 2 * y * y)));
|
|
4871
|
+
return { lng: i.lng + Ct(Ut), lat: Ct(ke) };
|
|
4872
|
+
}
|
|
4873
|
+
const Qi = {
|
|
4874
|
+
getDistance: Mi,
|
|
4875
|
+
getDestination: bi
|
|
4876
|
+
}, es = {
|
|
4843
4877
|
install(i, e) {
|
|
4844
|
-
|
|
4878
|
+
Mr(e), i.config.unwrapInjectedRef = !0;
|
|
4845
4879
|
const t = i.config.optionMergeStrategies;
|
|
4846
|
-
t[
|
|
4880
|
+
t[De] = t[Ze] = (r, s) => r ? [...new Set([].concat(r, s))] : Array.isArray(s) ? s : [s];
|
|
4847
4881
|
}
|
|
4848
4882
|
};
|
|
4849
4883
|
export {
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4884
|
-
|
|
4885
|
-
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4884
|
+
Zt as AbstractControl,
|
|
4885
|
+
Ve as AbstractMap,
|
|
4886
|
+
Oe as Arrays,
|
|
4887
|
+
Je as BaiduCircle,
|
|
4888
|
+
et as BaiduControl,
|
|
4889
|
+
ut as BaiduInfoBoxOverlay,
|
|
4890
|
+
ht as BaiduInfoWindow,
|
|
4891
|
+
rt as BaiduMapTypeControl,
|
|
4892
|
+
ue as BaiduMarker,
|
|
4893
|
+
Er as BaiduMarkerClusterer,
|
|
4894
|
+
Ee as BaiduOverlay,
|
|
4895
|
+
Ke as BaiduPolygon,
|
|
4896
|
+
Ye as BaiduPolyline,
|
|
4897
|
+
nt as BaiduScaleControl,
|
|
4898
|
+
it as BaiduZoomControl,
|
|
4899
|
+
Ot as CachedValue,
|
|
4900
|
+
k as ControlPosition,
|
|
4901
|
+
B as ControlPositionConverter,
|
|
4902
|
+
X as CoordType,
|
|
4903
|
+
Lr as CustomControl,
|
|
4904
|
+
Ir as FastFindValues,
|
|
4905
|
+
Qe as GoogleCircle,
|
|
4906
|
+
tt as GoogleControl,
|
|
4907
|
+
gt as GoogleInfoBoxOverlay,
|
|
4908
|
+
ct as GoogleInfoWindow,
|
|
4909
|
+
ve as GoogleMapTypeControl,
|
|
4910
|
+
at as GoogleMarker,
|
|
4911
|
+
kr as GoogleMarkerClusterer,
|
|
4912
|
+
He as GoogleOverlay,
|
|
4913
|
+
Xe as GooglePolygon,
|
|
4914
|
+
qe as GooglePolyline,
|
|
4915
|
+
ot as GoogleScaleControl,
|
|
4916
|
+
st as GoogleZoomControl,
|
|
4917
|
+
ie as Icon,
|
|
4918
|
+
lt as InfoWindow,
|
|
4919
|
+
Tt as KeyValue,
|
|
4920
|
+
v as LatLng,
|
|
4921
|
+
F as LatLngBounds,
|
|
4922
|
+
Ji as LifecycleLogPlugin,
|
|
4923
|
+
De as MIXIN_HOOK_CREATE,
|
|
4924
|
+
Ze as MIXIN_HOOK_DESTROY,
|
|
4925
|
+
Ht as MIXIN_MAP_NAME,
|
|
4926
|
+
we as MVCArrays,
|
|
4927
|
+
E as MapMixin,
|
|
4928
|
+
jt as MapTypeControlType,
|
|
4929
|
+
Nt as MarkerClusterer,
|
|
4930
|
+
pe as Objects,
|
|
4931
|
+
Dt as Overlay,
|
|
4932
|
+
ge as Point,
|
|
4933
|
+
Qi as SphericalUtils,
|
|
4934
|
+
Ce as Strings,
|
|
4935
|
+
Hi as TgCircle,
|
|
4936
|
+
Zi as TgCustomControl,
|
|
4937
|
+
Fi as TgElementOverlay,
|
|
4938
|
+
Ui as TgInfoBox,
|
|
4939
|
+
Yi as TgInfoWindow,
|
|
4940
|
+
qi as TgLabel,
|
|
4941
|
+
Xr as TgMap,
|
|
4942
|
+
Re as TgMapFactory,
|
|
4908
4943
|
$ as TgMapType,
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4944
|
+
Gi as TgMapTypeControl,
|
|
4945
|
+
Di as TgMapWidget,
|
|
4946
|
+
mt as TgMarker,
|
|
4947
|
+
ni as TgMarkerClusterer,
|
|
4948
|
+
Ki as TgPolygon,
|
|
4949
|
+
Xi as TgPolyline,
|
|
4950
|
+
ji as TgScaleControl,
|
|
4951
|
+
Wi as TgTrafficLayer,
|
|
4952
|
+
Vi as TgZoomControl,
|
|
4953
|
+
ye as callHook,
|
|
4954
|
+
Ai as computedSaveOnThis,
|
|
4955
|
+
Fr as createEmptyVNode,
|
|
4956
|
+
Hr as createPropertyObject,
|
|
4957
|
+
$i as createPropertyObjectTyped,
|
|
4958
|
+
xi as debug,
|
|
4959
|
+
es as default,
|
|
4960
|
+
Ri as eventLogMethods,
|
|
4961
|
+
R as eventProp,
|
|
4962
|
+
Ni as extractVNodeFromSlotsByComponent,
|
|
4963
|
+
zi as findByComponentType,
|
|
4964
|
+
bi as getDestination,
|
|
4965
|
+
Lt as getTgMapConfig,
|
|
4966
|
+
Ei as isDef,
|
|
4967
|
+
Pi as isInstanceOf,
|
|
4968
|
+
ki as lateinit,
|
|
4969
|
+
Me as noop,
|
|
4970
|
+
f as optionalProp,
|
|
4971
|
+
Vr as path,
|
|
4972
|
+
N as requiredProp,
|
|
4973
|
+
Ii as safeAs,
|
|
4974
|
+
me as safeAsComponent,
|
|
4975
|
+
Mr as setTgMapConfig,
|
|
4976
|
+
Ur as splitAttrs,
|
|
4977
|
+
Z as stringEnumProp,
|
|
4978
|
+
Wr as stringUnionPropFromValues,
|
|
4979
|
+
L as throwError,
|
|
4980
|
+
nr as throwUnsupported,
|
|
4981
|
+
Ci as todo,
|
|
4982
|
+
Ae as typed,
|
|
4983
|
+
Li as unwrapStringEnumValue,
|
|
4984
|
+
Y as useSplittedAttrs
|
|
4949
4985
|
};
|
|
4950
4986
|
//# sourceMappingURL=tg-map.js.map
|