tg-map-vue3 3.8.2 → 3.8.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/CHANGELOG.md +1 -0
- package/dist/tg-map.js +825 -821
- package/dist/tg-map.js.map +1 -1
- package/dist/tg-map.umd.cjs +6 -6
- package/dist/tg-map.umd.cjs.map +1 -1
- package/package.json +2 -2
package/dist/tg-map.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
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;cursor:auto;-webkit-user-select:auto!important;user-select:auto!important}.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;-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%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/%3E%3Cpath%20d%3D%22M0%200h24v24H0z%22%20fill%3D%22none%22/%3E%3C/svg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%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/%3E%3Cpath%20d%3D%22M0%200h24v24H0z%22%20fill%3D%22none%22/%3E%3C/svg%3E);background-color:#000}.baidu-info-box-container__close:hover{opacity:1}.baidu-info-box-container:after{position:absolute;background-color:#fff;content:"";width:15px;height:15px;left:0;top:0;box-shadow:-2px 2px 2px #b2b2b266;transform:translate(-50%,-50%) rotate(-45deg)}.element-overlay{position:absolute}.tg-map{height:100%;position:relative}.tg-map__map{width:100%;height:100%}.tg-map__map--hide-logo-google .gm-style a[target=_blank]:has(>div>img){display:none!important}.tg-map__map--hide-logo-google .gm-style>div:last-child>div:last-child>div{display:none}.tg-map__map--hide-logo-baidu div.anchorBL>a[target=_blank]>img{display:none}.tg-map__map--hide-logo-baidu div.BMap_cpyCtrl{display:none}.tg-map-widget{position:absolute}.tg-map>.tg-custom-control{display:none}.tg-map .tg-element-overlay{display:none}.tg-map__map .tg-element-overlay{display:block}.tg-map .tg-info-box{display:none}.tg-map__map .tg-info-box{display:block}.tg-map .tg-label{display:none}.tg-map__map .tg-label{display:block}')),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
2
|
var Yr = Object.defineProperty;
|
|
3
3
|
var qr = (i, t, e) => t in i ? Yr(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
4
|
-
var
|
|
5
|
-
import { createCommentVNode as ft, computed as fr, defineComponent as P, markRaw as Kr, watch as
|
|
6
|
-
function
|
|
4
|
+
var m = (i, t, e) => (qr(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
5
|
+
import { createCommentVNode as ft, computed as fr, defineComponent as P, markRaw as Kr, watch as Ae, openBlock as he, createElementBlock as ce, mergeProps as He, createElementVNode as Xr, normalizeClass as it, renderSlot as K, normalizeStyle as Jr, getCurrentInstance as Qr, inject as ei, onMounted as ti, onBeforeUnmount as ri, toRaw as st, withDirectives as ii, vShow as si } from "vue";
|
|
6
|
+
function re(i, t, e) {
|
|
7
7
|
Object.keys(i).forEach((r) => {
|
|
8
8
|
r.startsWith("update:") || e != null && e.includes(r) || t.addEventListener(r, i[r]);
|
|
9
9
|
});
|
|
@@ -25,11 +25,11 @@ var vr = { exports: {} };
|
|
|
25
25
|
i.exports ? i.exports = e() : t.coordtransform = e();
|
|
26
26
|
})(xt, function() {
|
|
27
27
|
var t = 52.35987755982988, e = 3.141592653589793, r = 6378245, s = 0.006693421622965943;
|
|
28
|
-
function n(
|
|
29
|
-
this.west = Math.min(
|
|
28
|
+
function n(l, u, v, y) {
|
|
29
|
+
this.west = Math.min(l, v), this.north = Math.max(u, y), this.east = Math.max(l, v), this.south = Math.min(u, y);
|
|
30
30
|
}
|
|
31
|
-
n.prototype.contain = function(
|
|
32
|
-
return this.west <=
|
|
31
|
+
n.prototype.contain = function(l, u) {
|
|
32
|
+
return this.west <= l && this.east >= l && this.north >= u && this.south <= u;
|
|
33
33
|
};
|
|
34
34
|
var a = [
|
|
35
35
|
new n(79.4462, 49.2204, 96.33, 42.8899),
|
|
@@ -45,75 +45,83 @@ var vr = { exports: {} };
|
|
|
45
45
|
new n(109.0323, 55.8175, 119.127, 50.3257),
|
|
46
46
|
new n(127.4568, 55.8175, 137.0227, 49.5574),
|
|
47
47
|
new n(131.2662, 44.8922, 137.0227, 42.5692),
|
|
48
|
-
new n(73.1246, 35.398637, 77.948114, 29.5297)
|
|
48
|
+
new n(73.1246, 35.398637, 77.948114, 29.5297)
|
|
49
|
+
], o = [
|
|
49
50
|
new n(114.505238, 22.138258, 113.845, 22.428903),
|
|
50
51
|
new n(113.97, 22.507833, 114.45, 22.428903)
|
|
51
52
|
];
|
|
52
|
-
function
|
|
53
|
-
for (var
|
|
54
|
-
if (a[
|
|
55
|
-
for (var
|
|
56
|
-
if (c[
|
|
53
|
+
function h(l, u, v = !0) {
|
|
54
|
+
for (var y = 0; y < a.length; y++)
|
|
55
|
+
if (a[y].contain(l, u)) {
|
|
56
|
+
for (var C = 0; C < c.length; C++)
|
|
57
|
+
if (c[C].contain(l, u))
|
|
57
58
|
return !1;
|
|
59
|
+
if (v) {
|
|
60
|
+
for (var C = 0; C < o.length; C++)
|
|
61
|
+
if (o[C].contain(l, u))
|
|
62
|
+
return !1;
|
|
63
|
+
}
|
|
58
64
|
return !0;
|
|
59
65
|
}
|
|
60
66
|
return !1;
|
|
61
67
|
}
|
|
62
|
-
function l
|
|
63
|
-
var
|
|
64
|
-
return [
|
|
68
|
+
function d(l, u) {
|
|
69
|
+
var v = l - 65e-4, y = u - 6e-3, C = Math.sqrt(v * v + y * y) - 2e-5 * Math.sin(y * t), w = Math.atan2(y, v) - 3e-6 * Math.cos(v * t), E = C * Math.cos(w), S = C * Math.sin(w);
|
|
70
|
+
return [E, S];
|
|
65
71
|
}
|
|
66
|
-
function
|
|
67
|
-
var
|
|
68
|
-
return [
|
|
72
|
+
function p(l, u) {
|
|
73
|
+
var v = Math.sqrt(l * l + u * u) + 2e-5 * Math.sin(u * t), y = Math.atan2(u, l) + 3e-6 * Math.cos(l * t), C = v * Math.cos(y) + 65e-4, w = v * Math.sin(y) + 6e-3;
|
|
74
|
+
return [C, w];
|
|
69
75
|
}
|
|
70
|
-
function
|
|
71
|
-
return
|
|
76
|
+
function g(l, u) {
|
|
77
|
+
return T(l, u);
|
|
72
78
|
}
|
|
73
|
-
function
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
var f = v(m, h);
|
|
77
|
-
return [m * 2 - f[0], h * 2 - f[1]];
|
|
79
|
+
function f(l, u) {
|
|
80
|
+
var v = T(l, u);
|
|
81
|
+
return [l * 2 - v[0], u * 2 - v[1]];
|
|
78
82
|
}
|
|
79
|
-
function
|
|
80
|
-
var
|
|
81
|
-
|
|
82
|
-
var
|
|
83
|
-
|
|
84
|
-
var
|
|
85
|
-
return [
|
|
83
|
+
function T(l, u) {
|
|
84
|
+
var v = _(l - 105, u - 35), y = M(l - 105, u - 35), C = u / 180 * e, w = Math.sin(C);
|
|
85
|
+
w = 1 - s * w * w;
|
|
86
|
+
var E = Math.sqrt(w);
|
|
87
|
+
v = v * 180 / (r * (1 - s) / (w * E) * e), y = y * 180 / (r / E * Math.cos(C) * e);
|
|
88
|
+
var S = u + v, z = l + y;
|
|
89
|
+
return [z, S];
|
|
86
90
|
}
|
|
87
|
-
function
|
|
88
|
-
var
|
|
89
|
-
return
|
|
91
|
+
function _(l, u) {
|
|
92
|
+
var v = -100 + 2 * l + 3 * u + 0.2 * u * u + 0.1 * l * u + 0.2 * Math.sqrt(Math.abs(l));
|
|
93
|
+
return v += (20 * Math.sin(6 * l * e) + 20 * Math.sin(2 * l * e)) * 2 / 3, v += (20 * Math.sin(u * e) + 40 * Math.sin(u / 3 * e)) * 2 / 3, v += (160 * Math.sin(u / 12 * e) + 320 * Math.sin(u * e / 30)) * 2 / 3, v;
|
|
90
94
|
}
|
|
91
|
-
function
|
|
92
|
-
var
|
|
93
|
-
return
|
|
95
|
+
function M(l, u) {
|
|
96
|
+
var v = 300 + l + 2 * u + 0.1 * l * l + 0.1 * l * u + 0.1 * Math.sqrt(Math.abs(l));
|
|
97
|
+
return v += (20 * Math.sin(6 * l * e) + 20 * Math.sin(2 * l * e)) * 2 / 3, v += (20 * Math.sin(l * e) + 40 * Math.sin(l / 3 * e)) * 2 / 3, v += (150 * Math.sin(l / 12 * e) + 300 * Math.sin(l / 30 * e)) * 2 / 3, v;
|
|
94
98
|
}
|
|
95
99
|
return {
|
|
96
|
-
//
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
//
|
|
102
|
-
bd09ToGcj02:
|
|
103
|
-
gcj02ToBd09:
|
|
104
|
-
wgs84ToGcj02: u
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
100
|
+
// 原始的转换方法
|
|
101
|
+
rawBd09ToGcj02: d,
|
|
102
|
+
rawGcj02ToBd09: p,
|
|
103
|
+
rawWgs84ToGcj02: g,
|
|
104
|
+
rawGcj02ToWgs84: f,
|
|
105
|
+
// 判断了中国范围的转换方法
|
|
106
|
+
bd09ToGcj02: d,
|
|
107
|
+
gcj02ToBd09: p,
|
|
108
|
+
wgs84ToGcj02: function(l, u) {
|
|
109
|
+
return h(l, u) ? g(l, u) : [l, u];
|
|
110
|
+
},
|
|
111
|
+
gcj02ToWgs84: function(l, u) {
|
|
112
|
+
return h(l, u) ? f(l, u) : [l, u];
|
|
113
|
+
},
|
|
114
|
+
bd09ToWgs84: function(l, u) {
|
|
115
|
+
if (!h(l, u, !1))
|
|
116
|
+
return [l, u];
|
|
117
|
+
var v = d(l, u);
|
|
118
|
+
return f(v[0], v[1]);
|
|
111
119
|
},
|
|
112
|
-
wgs84ToBd09: function(
|
|
113
|
-
if (!
|
|
114
|
-
return [
|
|
115
|
-
var
|
|
116
|
-
return
|
|
120
|
+
wgs84ToBd09: function(l, u) {
|
|
121
|
+
if (!h(l, u, !1))
|
|
122
|
+
return [l, u];
|
|
123
|
+
var v = g(l, u);
|
|
124
|
+
return p(v[0], v[1]);
|
|
117
125
|
}
|
|
118
126
|
};
|
|
119
127
|
});
|
|
@@ -123,30 +131,30 @@ const pe = /* @__PURE__ */ nt(ai);
|
|
|
123
131
|
var fe;
|
|
124
132
|
((i) => {
|
|
125
133
|
function t(c, o) {
|
|
126
|
-
return c.length === o.length && c.every((
|
|
134
|
+
return c.length === o.length && c.every((h, d) => h === o[d]);
|
|
127
135
|
}
|
|
128
136
|
i.equals = t;
|
|
129
137
|
function e(c, o) {
|
|
130
|
-
const
|
|
131
|
-
if (
|
|
132
|
-
return c.splice(
|
|
138
|
+
const h = c.indexOf(o);
|
|
139
|
+
if (h !== -1)
|
|
140
|
+
return c.splice(h, 1)[0];
|
|
133
141
|
}
|
|
134
142
|
i.remove = e;
|
|
135
143
|
function r(c, o) {
|
|
136
|
-
for (const
|
|
137
|
-
if (
|
|
138
|
-
return
|
|
144
|
+
for (const h of c)
|
|
145
|
+
if (h instanceof o)
|
|
146
|
+
return h;
|
|
139
147
|
}
|
|
140
148
|
i.findByType = r;
|
|
141
149
|
function s(c, o) {
|
|
142
150
|
return c.includes(o);
|
|
143
151
|
}
|
|
144
152
|
i.includesTyped = s;
|
|
145
|
-
function n(c, o,
|
|
153
|
+
function n(c, o, h) {
|
|
146
154
|
const d = o >= 0 ? o : c.length + o;
|
|
147
|
-
if (
|
|
155
|
+
if (h === void 0)
|
|
148
156
|
return c[d];
|
|
149
|
-
c[d] =
|
|
157
|
+
c[d] = h;
|
|
150
158
|
}
|
|
151
159
|
i.at = n;
|
|
152
160
|
function a(c) {
|
|
@@ -229,7 +237,7 @@ function un(i) {
|
|
|
229
237
|
function pn(i) {
|
|
230
238
|
return i;
|
|
231
239
|
}
|
|
232
|
-
function
|
|
240
|
+
function De(...i) {
|
|
233
241
|
}
|
|
234
242
|
function gn(i) {
|
|
235
243
|
return i != null;
|
|
@@ -241,7 +249,7 @@ function hi(i) {
|
|
|
241
249
|
let t = null;
|
|
242
250
|
return () => t ?? (t = i().catch((e) => (t = null, Promise.reject(e))));
|
|
243
251
|
}
|
|
244
|
-
var
|
|
252
|
+
var D = /* @__PURE__ */ ((i) => (i.wgs84 = "wgs84", i.gcj02 = "gcj02", i.bd09 = "bd09", i))(D || {});
|
|
245
253
|
const ut = "wgs84", R = class R {
|
|
246
254
|
constructor(t, e, r) {
|
|
247
255
|
this.lat = t, this.lng = e, this.coord = r;
|
|
@@ -347,16 +355,16 @@ const ut = "wgs84", R = class R {
|
|
|
347
355
|
return JSON.stringify(this);
|
|
348
356
|
}
|
|
349
357
|
};
|
|
350
|
-
|
|
358
|
+
m(R, "ZERO", R.create(0, 0));
|
|
351
359
|
let O = R;
|
|
352
|
-
const
|
|
360
|
+
const ne = class ne {
|
|
353
361
|
/**
|
|
354
362
|
* 不推荐直接创建LatLngBounds, sw和ne的大小关系可能没法保证, 推荐用LatLngBounds.Builder或者LatLngBounds.from等静态方法来创建
|
|
355
363
|
* @param sw 西南, lat/lng更小
|
|
356
364
|
* @param ne 东北, lat/lng更大
|
|
357
365
|
*/
|
|
358
366
|
constructor(t, e) {
|
|
359
|
-
|
|
367
|
+
m(this, "coord");
|
|
360
368
|
this.sw = t, this.ne = e, me(t.coord === e.coord, "sw和ne的coord应该相同"), me(Number.isFinite(t.lat) && Number.isFinite(t.lng) && Number.isFinite(e.lat) && Number.isFinite(e.lng), `sw(${t})和ne(${e})不能包含NaN或Infinite`), me(t.lat <= e.lat, `sw.lat(${t.lat})应该比ne.lat(${e.lat})小`), this.coord = t.coord;
|
|
361
369
|
}
|
|
362
370
|
static isBetweenLng(t, e, r) {
|
|
@@ -365,7 +373,7 @@ const ae = class ae {
|
|
|
365
373
|
static fromArray(t) {
|
|
366
374
|
if (t.length === 0)
|
|
367
375
|
return;
|
|
368
|
-
const e = new
|
|
376
|
+
const e = new ne.Builder(t[0]);
|
|
369
377
|
for (let r = 1; r < t.length; r++)
|
|
370
378
|
e.include(t[r]);
|
|
371
379
|
return e.build();
|
|
@@ -374,13 +382,13 @@ const ae = class ae {
|
|
|
374
382
|
return this.fromArray(t) ?? B("positions中没有点");
|
|
375
383
|
}
|
|
376
384
|
static fromGoogle(t, e) {
|
|
377
|
-
return new
|
|
385
|
+
return new ne(
|
|
378
386
|
O.fromGoogle(t.getSouthWest(), e),
|
|
379
387
|
O.fromGoogle(t.getNorthEast(), e)
|
|
380
388
|
);
|
|
381
389
|
}
|
|
382
390
|
static fromBaidu(t, e) {
|
|
383
|
-
return new
|
|
391
|
+
return new ne(
|
|
384
392
|
O.fromBaidu(t.getSouthWest(), e),
|
|
385
393
|
O.fromBaidu(t.getNorthEast(), e)
|
|
386
394
|
);
|
|
@@ -393,7 +401,7 @@ const ae = class ae {
|
|
|
393
401
|
}
|
|
394
402
|
contains(t) {
|
|
395
403
|
const { lat: e, lng: r } = t.to(this.coord);
|
|
396
|
-
return this.sw.lat <= e && e <= this.ne.lat &&
|
|
404
|
+
return this.sw.lat <= e && e <= this.ne.lat && ne.isBetweenLng(this.sw.lng, this.ne.lng, r);
|
|
397
405
|
}
|
|
398
406
|
getCenter() {
|
|
399
407
|
if (this.sw.equals(this.ne))
|
|
@@ -430,16 +438,16 @@ const ae = class ae {
|
|
|
430
438
|
return [this.sw.toBaidu(t), this.ne.toBaidu(t)];
|
|
431
439
|
}
|
|
432
440
|
};
|
|
433
|
-
|
|
434
|
-
let X =
|
|
441
|
+
m(ne, "EMPTY", new ne(O.ZERO, O.ZERO));
|
|
442
|
+
let X = ne;
|
|
435
443
|
((i) => {
|
|
436
444
|
class t {
|
|
437
445
|
constructor(r) {
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
446
|
+
m(this, "coord");
|
|
447
|
+
m(this, "minLat");
|
|
448
|
+
m(this, "minLng");
|
|
449
|
+
m(this, "maxLat");
|
|
450
|
+
m(this, "maxLng");
|
|
443
451
|
this.coord = r.coord, this.minLat = this.maxLat = r.lat, this.minLng = this.maxLng = r.lng;
|
|
444
452
|
}
|
|
445
453
|
build() {
|
|
@@ -497,8 +505,8 @@ function or(i, t, e) {
|
|
|
497
505
|
}
|
|
498
506
|
class br {
|
|
499
507
|
constructor(t, e) {
|
|
500
|
-
|
|
501
|
-
|
|
508
|
+
m(this, "eventMap", /* @__PURE__ */ new Map());
|
|
509
|
+
m(this, "target", void 0);
|
|
502
510
|
this.inner = t, this.coordTypeSupplier = e, this.addEventListener = this.addEventListener.bind(this), this.removeEventListener = this.removeEventListener.bind(this);
|
|
503
511
|
}
|
|
504
512
|
setTarget(t) {
|
|
@@ -507,7 +515,7 @@ class br {
|
|
|
507
515
|
}
|
|
508
516
|
class ot {
|
|
509
517
|
constructor(t, e) {
|
|
510
|
-
|
|
518
|
+
m(this, "eventHub", new Tr());
|
|
511
519
|
this.delegate = t, this.options = e;
|
|
512
520
|
}
|
|
513
521
|
notify(t) {
|
|
@@ -557,7 +565,7 @@ const rt = class rt extends br {
|
|
|
557
565
|
}
|
|
558
566
|
};
|
|
559
567
|
// 事件类型映射: tg => google
|
|
560
|
-
|
|
568
|
+
m(rt, "EVENT_TYPE_MAP", {
|
|
561
569
|
"center-changed": "center_changed",
|
|
562
570
|
"zoom-changed": "zoom_changed",
|
|
563
571
|
"radius-changed": "radius_changed",
|
|
@@ -574,7 +582,7 @@ g(rt, "EVENT_TYPE_MAP", {
|
|
|
574
582
|
"map-dblclick": "dblclick"
|
|
575
583
|
});
|
|
576
584
|
let ye = rt;
|
|
577
|
-
const
|
|
585
|
+
const Ie = class Ie extends br {
|
|
578
586
|
addEventListener(t, e) {
|
|
579
587
|
const r = Ye(t, e);
|
|
580
588
|
if (this.eventMap.get(r)) {
|
|
@@ -589,16 +597,16 @@ const Se = class Se extends br {
|
|
|
589
597
|
};
|
|
590
598
|
n.point && (a.position = O.fromBaidu(n.point, this.coordTypeSupplier.coordType)), e.call(this.target, a);
|
|
591
599
|
};
|
|
592
|
-
this.inner.addEventListener(
|
|
600
|
+
this.inner.addEventListener(Ie.EVENT_TYPE_MAP[t] || t, s), this.eventMap.set(r, s);
|
|
593
601
|
}
|
|
594
602
|
removeEventListener(t, e) {
|
|
595
603
|
const r = Ye(t, e), s = this.eventMap.get(r);
|
|
596
|
-
s ? (this.inner.removeEventListener(
|
|
604
|
+
s ? (this.inner.removeEventListener(Ie.EVENT_TYPE_MAP[t] || t, s), this.eventMap.delete(r)) : console.warn("移除失败, 不存在该listener", r, e);
|
|
597
605
|
}
|
|
598
606
|
};
|
|
599
607
|
// cSpell:words clickclose
|
|
600
608
|
// 事件类型映射, tg => baidu
|
|
601
|
-
|
|
609
|
+
m(Ie, "EVENT_TYPE_MAP", {
|
|
602
610
|
drag: "dragging",
|
|
603
611
|
closeclick: "clickclose",
|
|
604
612
|
// baidu不支持contextmenu事件, 将其映射为rightclick
|
|
@@ -606,10 +614,10 @@ g(Se, "EVENT_TYPE_MAP", {
|
|
|
606
614
|
"zoom-changed": "zoomend",
|
|
607
615
|
"map-type-changed": "maptypechange"
|
|
608
616
|
});
|
|
609
|
-
let
|
|
617
|
+
let Re = Ie;
|
|
610
618
|
class Tr {
|
|
611
619
|
constructor() {
|
|
612
|
-
|
|
620
|
+
m(this, "typeMap", /* @__PURE__ */ new Map());
|
|
613
621
|
}
|
|
614
622
|
addEventListener(t, e) {
|
|
615
623
|
let r = this.typeMap.get(t);
|
|
@@ -633,8 +641,8 @@ class ar {
|
|
|
633
641
|
* `keys`和`values`数组中可以有相同的值, 若存在相同值, 则index越小的优先级越高
|
|
634
642
|
*/
|
|
635
643
|
constructor(t, e) {
|
|
636
|
-
|
|
637
|
-
|
|
644
|
+
m(this, "keyToValue", /* @__PURE__ */ new Map());
|
|
645
|
+
m(this, "valueToKey", /* @__PURE__ */ new Map());
|
|
638
646
|
me(t.length === e.length);
|
|
639
647
|
for (let r = t.length - 1; r >= 0; r--)
|
|
640
648
|
this.keyToValue.set(t[r], e[r]), this.valueToKey.set(e[r], t[r]);
|
|
@@ -648,7 +656,7 @@ class ar {
|
|
|
648
656
|
}
|
|
649
657
|
class ui {
|
|
650
658
|
constructor(t, e = 10) {
|
|
651
|
-
|
|
659
|
+
m(this, "map", /* @__PURE__ */ new Map());
|
|
652
660
|
this.values = t, this.maxSize4Debug = e;
|
|
653
661
|
}
|
|
654
662
|
/** 获取保存key-value映射的Map */
|
|
@@ -675,16 +683,16 @@ class ui {
|
|
|
675
683
|
return this.getOrNull(t, e) ?? B(`key(${e})不存在与valueMap(${this.getValueMap(t)})中`);
|
|
676
684
|
}
|
|
677
685
|
}
|
|
678
|
-
class
|
|
686
|
+
class Pe {
|
|
679
687
|
constructor(t) {
|
|
680
|
-
|
|
688
|
+
m(this, "value");
|
|
681
689
|
this.creator = t;
|
|
682
690
|
}
|
|
683
691
|
get() {
|
|
684
692
|
return this.value === void 0 && (this.value = this.creator()), this.value;
|
|
685
693
|
}
|
|
686
694
|
}
|
|
687
|
-
var
|
|
695
|
+
var A = /* @__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))(A || {}), U;
|
|
688
696
|
((i) => {
|
|
689
697
|
let t, e;
|
|
690
698
|
const r = [
|
|
@@ -753,7 +761,7 @@ var k = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
|
|
|
753
761
|
class pi {
|
|
754
762
|
constructor(t) {
|
|
755
763
|
/** 实际添加到地图中的control对象 */
|
|
756
|
-
|
|
764
|
+
m(this, "inner");
|
|
757
765
|
this.position = t;
|
|
758
766
|
}
|
|
759
767
|
}
|
|
@@ -806,8 +814,8 @@ class Bt extends Lt {
|
|
|
806
814
|
class at extends Lt {
|
|
807
815
|
constructor(e, r) {
|
|
808
816
|
super();
|
|
809
|
-
|
|
810
|
-
|
|
817
|
+
m(this, "visible", !1);
|
|
818
|
+
m(this, "map");
|
|
811
819
|
this._type = e, this.position = r;
|
|
812
820
|
}
|
|
813
821
|
isVisible() {
|
|
@@ -849,7 +857,7 @@ class W {
|
|
|
849
857
|
return this.id;
|
|
850
858
|
}
|
|
851
859
|
getBaiduCoordType() {
|
|
852
|
-
return
|
|
860
|
+
return D.bd09;
|
|
853
861
|
}
|
|
854
862
|
asBaiduMapType() {
|
|
855
863
|
return this.baidu();
|
|
@@ -867,14 +875,14 @@ class W {
|
|
|
867
875
|
}
|
|
868
876
|
class mn {
|
|
869
877
|
constructor(t, e) {
|
|
870
|
-
|
|
878
|
+
m(this, "baiduLayerCached", new Pe(() => {
|
|
871
879
|
const t = new BMap.TileLayer({});
|
|
872
880
|
return t.getTilesUrl = (e, r) => {
|
|
873
881
|
const s = Math.pow(2, r - 1), n = e.x + s, a = s - 1 - e.y;
|
|
874
882
|
return this.options.getTileUrl({ x: n, y: a }, r);
|
|
875
883
|
}, t;
|
|
876
884
|
}));
|
|
877
|
-
|
|
885
|
+
m(this, "baiduMapTypeCached", new Pe(() => {
|
|
878
886
|
const t = new BMap.MapType(this.options.name, this.baiduLayerCached.get(), {
|
|
879
887
|
maxZoom: this.options.maxZoom,
|
|
880
888
|
minZoom: this.options.minZoom,
|
|
@@ -882,7 +890,7 @@ class mn {
|
|
|
882
890
|
});
|
|
883
891
|
return t.__baidu_map_type__ = this, t;
|
|
884
892
|
}));
|
|
885
|
-
|
|
893
|
+
m(this, "googleCached", new Pe(() => {
|
|
886
894
|
const t = new google.maps.ImageMapType({
|
|
887
895
|
getTileUrl: (e, r) => this.options.getTileUrl(e, r),
|
|
888
896
|
tileSize: new google.maps.Size(256, 256),
|
|
@@ -919,8 +927,8 @@ class mn {
|
|
|
919
927
|
}
|
|
920
928
|
class mi {
|
|
921
929
|
constructor() {
|
|
922
|
-
|
|
923
|
-
|
|
930
|
+
m(this, "baiduCache", new Pe(() => new BMap.TrafficLayer()));
|
|
931
|
+
m(this, "googleCache", new Pe(() => new google.maps.TrafficLayer()));
|
|
924
932
|
}
|
|
925
933
|
asBaiduLayer() {
|
|
926
934
|
return this.baiduCache.get();
|
|
@@ -931,13 +939,13 @@ class mi {
|
|
|
931
939
|
}
|
|
932
940
|
var V;
|
|
933
941
|
((i) => {
|
|
934
|
-
i.NORMAL = new W("normal", () => BMAP_NORMAL_MAP, () => google.maps.MapTypeId.ROADMAP,
|
|
942
|
+
i.NORMAL = new W("normal", () => BMAP_NORMAL_MAP, () => google.maps.MapTypeId.ROADMAP, D.gcj02), i.SATELLITE = new W("satellite", () => BMAP_SATELLITE_MAP, () => google.maps.MapTypeId.SATELLITE, D.wgs84), i.HYBRID = new W("hybrid", () => BMAP_HYBRID_MAP, () => google.maps.MapTypeId.HYBRID, D.gcj02), i.TERRAIN = new W("terrain", () => (
|
|
935
943
|
/* 三维 */
|
|
936
944
|
BMAP_PERSPECTIVE_MAP
|
|
937
945
|
), () => (
|
|
938
946
|
/* 地形 */
|
|
939
947
|
google.maps.MapTypeId.TERRAIN
|
|
940
|
-
),
|
|
948
|
+
), D.wgs84), i.BUILD_IN_MAP_TYPES = new ui([i.NORMAL, i.SATELLITE, i.HYBRID, i.TERRAIN]);
|
|
941
949
|
})(V || (V = {}));
|
|
942
950
|
var Or = /* @__PURE__ */ ((i) => (i.DEFAULT = "default", i.HORIZONTAL = "horizontal", i.DROPDOWN = "dropdown", i))(Or || {});
|
|
943
951
|
const Cr = [V.NORMAL, V.SATELLITE, V.HYBRID];
|
|
@@ -955,7 +963,7 @@ class It extends Bt {
|
|
|
955
963
|
}
|
|
956
964
|
}
|
|
957
965
|
const ue = class ue extends at {
|
|
958
|
-
constructor(t = "default", e =
|
|
966
|
+
constructor(t = "default", e = A.TOP_LEFT, r = Cr) {
|
|
959
967
|
super("mapType", e), this.type = t, this.mapTypes = r, ue.type2google || (ue.type2google = {
|
|
960
968
|
default: google.maps.MapTypeControlStyle.DEFAULT,
|
|
961
969
|
horizontal: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
|
|
@@ -975,7 +983,7 @@ const ue = class ue extends at {
|
|
|
975
983
|
});
|
|
976
984
|
}
|
|
977
985
|
};
|
|
978
|
-
|
|
986
|
+
m(ue, "type2google");
|
|
979
987
|
let Tt = ue;
|
|
980
988
|
class St extends Bt {
|
|
981
989
|
static create(t) {
|
|
@@ -989,20 +997,20 @@ class kt extends at {
|
|
|
989
997
|
static create(t) {
|
|
990
998
|
return new kt(t.position);
|
|
991
999
|
}
|
|
992
|
-
constructor(t =
|
|
1000
|
+
constructor(t = A.BOTTOM_RIGHT) {
|
|
993
1001
|
super("scale", t);
|
|
994
1002
|
}
|
|
995
1003
|
}
|
|
996
1004
|
class At extends gi {
|
|
997
1005
|
static create(t) {
|
|
998
|
-
return new At(!0, t.position ??
|
|
1006
|
+
return new At(!0, t.position ?? A.RIGHT_BOTTOM);
|
|
999
1007
|
}
|
|
1000
1008
|
}
|
|
1001
1009
|
class Dt extends at {
|
|
1002
1010
|
static create(t) {
|
|
1003
1011
|
return new Dt(t.position);
|
|
1004
1012
|
}
|
|
1005
|
-
constructor(t =
|
|
1013
|
+
constructor(t = A.RIGHT_BOTTOM) {
|
|
1006
1014
|
super("streetView", t);
|
|
1007
1015
|
}
|
|
1008
1016
|
}
|
|
@@ -1020,23 +1028,23 @@ class $t extends at {
|
|
|
1020
1028
|
static create(t) {
|
|
1021
1029
|
return new $t(t.position);
|
|
1022
1030
|
}
|
|
1023
|
-
constructor(t =
|
|
1031
|
+
constructor(t = A.RIGHT_BOTTOM) {
|
|
1024
1032
|
super("zoom", t);
|
|
1025
1033
|
}
|
|
1026
1034
|
}
|
|
1027
1035
|
function fi(i) {
|
|
1028
1036
|
let t, e, r;
|
|
1029
|
-
const s = "The Google Maps JavaScript API", n = "google", a = "importLibrary", c = "__ib__", o = document,
|
|
1030
|
-
var
|
|
1031
|
-
await (e = o.createElement("script")),
|
|
1037
|
+
const s = "The Google Maps JavaScript API", n = "google", a = "importLibrary", c = "__ib__", o = document, h = window, d = h[n] || (h[n] = {}), p = d.maps || (d.maps = {}), g = /* @__PURE__ */ new Set(), f = new URLSearchParams(), T = () => t || (t = new Promise(async (_, M) => {
|
|
1038
|
+
var l;
|
|
1039
|
+
await (e = o.createElement("script")), f.set("libraries", [...g] + "");
|
|
1032
1040
|
for (r in i)
|
|
1033
|
-
|
|
1034
|
-
|
|
1041
|
+
f.set(r.replace(/[A-Z]/g, (u) => "_" + u[0].toLowerCase()), i[r]);
|
|
1042
|
+
f.set("callback", n + ".maps." + c), e.src = `https://maps.${n}apis.com/maps/api/js?` + f, p[c] = _, e.onerror = () => t = M(Error(s + " could not load.")), e.nonce = ((l = o.querySelector("script[nonce]")) == null ? void 0 : l.nonce) || "", o.head.append(e);
|
|
1035
1043
|
}));
|
|
1036
|
-
|
|
1044
|
+
p[a] ? console.warn(s + " only loads once. Ignoring:", i) : p[a] = (_, ...M) => g.add(_) && T().then(() => p[a](_, ...M));
|
|
1037
1045
|
}
|
|
1038
1046
|
let vi, yi;
|
|
1039
|
-
const
|
|
1047
|
+
const ae = {
|
|
1040
1048
|
/** Google的坐标0点 */
|
|
1041
1049
|
get LATLNG_ZERO() {
|
|
1042
1050
|
return vi ?? (vi = new google.maps.LatLng({ lat: 0, lng: 0 }));
|
|
@@ -1079,7 +1087,7 @@ function xr(i, t) {
|
|
|
1079
1087
|
city: (e == null ? void 0 : e.city) ?? "",
|
|
1080
1088
|
id: i.place_id ?? "",
|
|
1081
1089
|
address: i.formatted_address ?? "",
|
|
1082
|
-
position: O.fromGoogle(((r = i.geometry) == null ? void 0 : r.location) ??
|
|
1090
|
+
position: O.fromGoogle(((r = i.geometry) == null ? void 0 : r.location) ?? ae.LATLNG_ZERO, t.coordType),
|
|
1083
1091
|
title: i.name ?? ""
|
|
1084
1092
|
};
|
|
1085
1093
|
}
|
|
@@ -1088,7 +1096,7 @@ class Er {
|
|
|
1088
1096
|
class _i extends Er {
|
|
1089
1097
|
constructor(e, r) {
|
|
1090
1098
|
super();
|
|
1091
|
-
|
|
1099
|
+
m(this, "inner");
|
|
1092
1100
|
this.map = e, this.inner = new google.maps.places.Autocomplete(r.input, {
|
|
1093
1101
|
fields: [
|
|
1094
1102
|
"address_components",
|
|
@@ -1118,10 +1126,10 @@ class _i extends Er {
|
|
|
1118
1126
|
class bi extends Er {
|
|
1119
1127
|
constructor(e, r) {
|
|
1120
1128
|
super();
|
|
1121
|
-
|
|
1122
|
-
|
|
1129
|
+
m(this, "inner");
|
|
1130
|
+
m(this, "input");
|
|
1123
1131
|
// TODO: 要不要添加个移除监听的方法?
|
|
1124
|
-
|
|
1132
|
+
m(this, "removeableArray", []);
|
|
1125
1133
|
if (this.map = e, this.input = r.input, this.inner = new BMap.Autocomplete({
|
|
1126
1134
|
input: r.input,
|
|
1127
1135
|
location: r.bindToMap ? e.innerMap : void 0
|
|
@@ -1178,36 +1186,36 @@ var Pr = { exports: {} };
|
|
|
1178
1186
|
defaultValueField: "value",
|
|
1179
1187
|
plugins: {}
|
|
1180
1188
|
}, a = function() {
|
|
1181
|
-
var
|
|
1182
|
-
this._coordinator = {}, this._data = [], this._radi = [], this._min = 0, this._max = 1, this._xField =
|
|
1183
|
-
},
|
|
1184
|
-
return
|
|
1189
|
+
var f = function(M) {
|
|
1190
|
+
this._coordinator = {}, this._data = [], this._radi = [], this._min = 0, this._max = 1, this._xField = M.xField || M.defaultXField, this._yField = M.yField || M.defaultYField, this._valueField = M.valueField || M.defaultValueField, M.radius && (this._cfgRadius = M.radius);
|
|
1191
|
+
}, T = n.defaultRadius;
|
|
1192
|
+
return f.prototype = {
|
|
1185
1193
|
// when forceRender = false -> called from setData, omits renderall event
|
|
1186
|
-
_organiseData: function(
|
|
1187
|
-
var
|
|
1188
|
-
return
|
|
1189
|
-
x:
|
|
1190
|
-
y:
|
|
1194
|
+
_organiseData: function(_, M) {
|
|
1195
|
+
var l = _[this._xField], u = _[this._yField], v = this._radi, y = this._data, C = this._max, w = this._min, E = _[this._valueField] || 1, S = _.radius || this._cfgRadius || T;
|
|
1196
|
+
return y[l] || (y[l] = [], v[l] = []), y[l][u] ? y[l][u] += E : (y[l][u] = E, v[l][u] = S), y[l][u] > C ? (M ? this.setDataMax(y[l][u]) : this._max = y[l][u], !1) : {
|
|
1197
|
+
x: l,
|
|
1198
|
+
y: u,
|
|
1191
1199
|
value: E,
|
|
1192
|
-
radius:
|
|
1200
|
+
radius: S,
|
|
1193
1201
|
min: w,
|
|
1194
1202
|
max: C
|
|
1195
1203
|
};
|
|
1196
1204
|
},
|
|
1197
1205
|
_unOrganizeData: function() {
|
|
1198
|
-
var
|
|
1199
|
-
for (var
|
|
1200
|
-
for (var
|
|
1201
|
-
|
|
1202
|
-
x:
|
|
1203
|
-
y:
|
|
1204
|
-
radius:
|
|
1205
|
-
value:
|
|
1206
|
+
var _ = [], M = this._data, l = this._radi;
|
|
1207
|
+
for (var u in M)
|
|
1208
|
+
for (var v in M[u])
|
|
1209
|
+
_.push({
|
|
1210
|
+
x: u,
|
|
1211
|
+
y: v,
|
|
1212
|
+
radius: l[u][v],
|
|
1213
|
+
value: M[u][v]
|
|
1206
1214
|
});
|
|
1207
1215
|
return {
|
|
1208
1216
|
min: this._min,
|
|
1209
1217
|
max: this._max,
|
|
1210
|
-
data:
|
|
1218
|
+
data: _
|
|
1211
1219
|
};
|
|
1212
1220
|
},
|
|
1213
1221
|
_onExtremaChange: function() {
|
|
@@ -1218,35 +1226,35 @@ var Pr = { exports: {} };
|
|
|
1218
1226
|
},
|
|
1219
1227
|
addData: function() {
|
|
1220
1228
|
if (arguments[0].length > 0)
|
|
1221
|
-
for (var
|
|
1222
|
-
this.addData.call(this,
|
|
1229
|
+
for (var _ = arguments[0], M = _.length; M--; )
|
|
1230
|
+
this.addData.call(this, _[M]);
|
|
1223
1231
|
else {
|
|
1224
|
-
var
|
|
1225
|
-
|
|
1232
|
+
var l = this._organiseData(arguments[0], !0);
|
|
1233
|
+
l && this._coordinator.emit("renderpartial", {
|
|
1226
1234
|
min: this._min,
|
|
1227
1235
|
max: this._max,
|
|
1228
|
-
data: [
|
|
1236
|
+
data: [l]
|
|
1229
1237
|
});
|
|
1230
1238
|
}
|
|
1231
1239
|
return this;
|
|
1232
1240
|
},
|
|
1233
|
-
setData: function(
|
|
1234
|
-
var
|
|
1241
|
+
setData: function(_) {
|
|
1242
|
+
var M = _.data, l = M.length;
|
|
1235
1243
|
this._data = [], this._radi = [];
|
|
1236
|
-
for (var
|
|
1237
|
-
this._organiseData(
|
|
1238
|
-
return this._max =
|
|
1244
|
+
for (var u = 0; u < l; u++)
|
|
1245
|
+
this._organiseData(M[u], !1);
|
|
1246
|
+
return this._max = _.max, this._min = _.min || 0, this._onExtremaChange(), this._coordinator.emit("renderall", this._getInternalData()), this;
|
|
1239
1247
|
},
|
|
1240
1248
|
removeData: function() {
|
|
1241
1249
|
},
|
|
1242
|
-
setDataMax: function(
|
|
1243
|
-
return this._max =
|
|
1250
|
+
setDataMax: function(_) {
|
|
1251
|
+
return this._max = _, this._onExtremaChange(), this._coordinator.emit("renderall", this._getInternalData()), this;
|
|
1244
1252
|
},
|
|
1245
|
-
setDataMin: function(
|
|
1246
|
-
return this._min =
|
|
1253
|
+
setDataMin: function(_) {
|
|
1254
|
+
return this._min = _, this._onExtremaChange(), this._coordinator.emit("renderall", this._getInternalData()), this;
|
|
1247
1255
|
},
|
|
1248
|
-
setCoordinator: function(
|
|
1249
|
-
this._coordinator =
|
|
1256
|
+
setCoordinator: function(_) {
|
|
1257
|
+
this._coordinator = _;
|
|
1250
1258
|
},
|
|
1251
1259
|
_getInternalData: function() {
|
|
1252
1260
|
return {
|
|
@@ -1297,152 +1305,152 @@ var Pr = { exports: {} };
|
|
|
1297
1305
|
}
|
|
1298
1306
|
return false;
|
|
1299
1307
|
}*/
|
|
1300
|
-
},
|
|
1308
|
+
}, f;
|
|
1301
1309
|
}(), c = function() {
|
|
1302
|
-
var
|
|
1303
|
-
var
|
|
1304
|
-
|
|
1305
|
-
var C =
|
|
1306
|
-
for (var w in
|
|
1307
|
-
C.addColorStop(w,
|
|
1308
|
-
return
|
|
1309
|
-
},
|
|
1310
|
-
var
|
|
1311
|
-
if (
|
|
1312
|
-
|
|
1310
|
+
var f = function(l) {
|
|
1311
|
+
var u = l.gradient || l.defaultGradient, v = document.createElement("canvas"), y = v.getContext("2d");
|
|
1312
|
+
v.width = 256, v.height = 1;
|
|
1313
|
+
var C = y.createLinearGradient(0, 0, 256, 1);
|
|
1314
|
+
for (var w in u)
|
|
1315
|
+
C.addColorStop(w, u[w]);
|
|
1316
|
+
return y.fillStyle = C, y.fillRect(0, 0, 256, 1), y.getImageData(0, 0, 256, 1).data;
|
|
1317
|
+
}, T = function(l, u) {
|
|
1318
|
+
var v = document.createElement("canvas"), y = v.getContext("2d"), C = l, w = l;
|
|
1319
|
+
if (v.width = v.height = l * 2, u == 1)
|
|
1320
|
+
y.beginPath(), y.arc(C, w, l, 0, 2 * Math.PI, !1), y.fillStyle = "rgba(0,0,0,1)", y.fill();
|
|
1313
1321
|
else {
|
|
1314
|
-
var E =
|
|
1315
|
-
E.addColorStop(0, "rgba(0,0,0,1)"), E.addColorStop(1, "rgba(0,0,0,0)"),
|
|
1322
|
+
var E = y.createRadialGradient(C, w, l * u, C, w, l);
|
|
1323
|
+
E.addColorStop(0, "rgba(0,0,0,1)"), E.addColorStop(1, "rgba(0,0,0,0)"), y.fillStyle = E, y.fillRect(0, 0, 2 * l, 2 * l);
|
|
1316
1324
|
}
|
|
1317
|
-
return
|
|
1318
|
-
},
|
|
1319
|
-
for (var
|
|
1320
|
-
for (var
|
|
1321
|
-
var I = L[J], G = w[
|
|
1322
|
-
|
|
1323
|
-
x:
|
|
1325
|
+
return v;
|
|
1326
|
+
}, _ = function(w) {
|
|
1327
|
+
for (var u = [], v = w.min, y = w.max, C = w.radi, w = w.data, E = Object.keys(w), S = E.length; S--; )
|
|
1328
|
+
for (var z = E[S], L = Object.keys(w[z]), J = L.length; J--; ) {
|
|
1329
|
+
var I = L[J], G = w[z][I], Q = C[z][I];
|
|
1330
|
+
u.push({
|
|
1331
|
+
x: z,
|
|
1324
1332
|
y: I,
|
|
1325
1333
|
value: G,
|
|
1326
1334
|
radius: Q
|
|
1327
1335
|
});
|
|
1328
1336
|
}
|
|
1329
1337
|
return {
|
|
1330
|
-
min:
|
|
1331
|
-
max:
|
|
1332
|
-
data:
|
|
1338
|
+
min: v,
|
|
1339
|
+
max: y,
|
|
1340
|
+
data: u
|
|
1333
1341
|
};
|
|
1334
1342
|
};
|
|
1335
|
-
function
|
|
1336
|
-
var
|
|
1343
|
+
function M(l) {
|
|
1344
|
+
var u = l.element, v = this.shadowCanvas = document.createElement("canvas"), y = this.canvas = l.canvas || document.createElement("canvas");
|
|
1337
1345
|
this._renderBoundaries = [1e4, 1e4, 0, 0];
|
|
1338
|
-
var C = getComputedStyle(
|
|
1339
|
-
|
|
1346
|
+
var C = getComputedStyle(l.element) || {};
|
|
1347
|
+
y.className = "heatmap-canvas", this._width = y.width = v.width = +C.width.replace(/px/, ""), this._height = y.height = v.height = +C.height.replace(/px/, ""), this.shadowCtx = v.getContext("2d"), this.ctx = y.getContext("2d"), y.style.cssText = v.style.cssText = "position:absolute;left:0;top:0;", u.style.position = "relative", u.appendChild(y), this._palette = f(l), this._templates = {}, this._setStyles(l);
|
|
1340
1348
|
}
|
|
1341
|
-
return
|
|
1342
|
-
renderPartial: function(
|
|
1343
|
-
this._drawAlpha(
|
|
1349
|
+
return M.prototype = {
|
|
1350
|
+
renderPartial: function(l) {
|
|
1351
|
+
this._drawAlpha(l), this._colorize();
|
|
1344
1352
|
},
|
|
1345
|
-
renderAll: function(
|
|
1346
|
-
this._clear(), this._drawAlpha(
|
|
1353
|
+
renderAll: function(l) {
|
|
1354
|
+
this._clear(), this._drawAlpha(_(l)), this._colorize();
|
|
1347
1355
|
},
|
|
1348
|
-
_updateGradient: function(
|
|
1349
|
-
this._palette =
|
|
1356
|
+
_updateGradient: function(l) {
|
|
1357
|
+
this._palette = f(l);
|
|
1350
1358
|
},
|
|
1351
|
-
updateConfig: function(
|
|
1352
|
-
|
|
1359
|
+
updateConfig: function(l, u) {
|
|
1360
|
+
l.gradient !== u.gradient && this._updateGradient(l), this._setStyles(l);
|
|
1353
1361
|
},
|
|
1354
|
-
setDimensions: function(
|
|
1355
|
-
this._width =
|
|
1362
|
+
setDimensions: function(l, u) {
|
|
1363
|
+
this._width = l, this._height = u, this.canvas.width = this.shadowCanvas.width = l, this.canvas.height = this.shadowCanvas.height = u;
|
|
1356
1364
|
},
|
|
1357
1365
|
_clear: function() {
|
|
1358
1366
|
this.shadowCtx.clearRect(0, 0, this._width, this._height), this.ctx.clearRect(0, 0, this._width, this._height);
|
|
1359
1367
|
},
|
|
1360
|
-
_setStyles: function(
|
|
1361
|
-
this._blur =
|
|
1368
|
+
_setStyles: function(l) {
|
|
1369
|
+
this._blur = l.blur == 0 ? 0 : l.blur || l.defaultBlur, l.backgroundColor && (this.canvas.style.backgroundColor = l.backgroundColor), this._opacity = (l.opacity || 0) * 255, this._maxOpacity = (l.maxOpacity || l.defaultMaxOpacity) * 255, this._minOpacity = (l.minOpacity || l.defaultMinOpacity) * 255, this._useGradientOpacity = !!l.useGradientOpacity;
|
|
1362
1370
|
},
|
|
1363
|
-
_drawAlpha: function(
|
|
1364
|
-
for (var
|
|
1365
|
-
var E =
|
|
1366
|
-
this._templates[L] ? Z = this._templates[L] : this._templates[L] = Z =
|
|
1371
|
+
_drawAlpha: function(y) {
|
|
1372
|
+
for (var u = this._min = y.min, v = this._max = y.max, y = y.data || [], C = y.length, w = 1 - this._blur; C--; ) {
|
|
1373
|
+
var E = y[C], S = E.x, z = E.y, L = E.radius, J = Math.min(E.value, v), I = S - L, G = z - L, Q = this.shadowCtx, Z;
|
|
1374
|
+
this._templates[L] ? Z = this._templates[L] : this._templates[L] = Z = T(L, w), Q.globalAlpha = (J - u) / (v - u), Q.drawImage(Z, I, G), I < this._renderBoundaries[0] && (this._renderBoundaries[0] = I), G < this._renderBoundaries[1] && (this._renderBoundaries[1] = G), I + 2 * L > this._renderBoundaries[2] && (this._renderBoundaries[2] = I + 2 * L), G + 2 * L > this._renderBoundaries[3] && (this._renderBoundaries[3] = G + 2 * L);
|
|
1367
1375
|
}
|
|
1368
1376
|
},
|
|
1369
1377
|
_colorize: function() {
|
|
1370
|
-
var
|
|
1371
|
-
|
|
1372
|
-
for (var J = this.shadowCtx.getImageData(
|
|
1373
|
-
var je = I[Z],
|
|
1374
|
-
if (
|
|
1375
|
-
var
|
|
1376
|
-
E > 0 ?
|
|
1378
|
+
var l = this._renderBoundaries[0], u = this._renderBoundaries[1], v = this._renderBoundaries[2] - l, y = this._renderBoundaries[3] - u, C = this._width, w = this._height, E = this._opacity, S = this._maxOpacity, z = this._minOpacity, L = this._useGradientOpacity;
|
|
1379
|
+
l < 0 && (l = 0), u < 0 && (u = 0), l + v > C && (v = C - l), u + y > w && (y = w - u);
|
|
1380
|
+
for (var J = this.shadowCtx.getImageData(l, u, v, y), I = J.data, G = I.length, Q = this._palette, Z = 3; Z < G; Z += 4) {
|
|
1381
|
+
var je = I[Z], Oe = je * 4;
|
|
1382
|
+
if (Oe) {
|
|
1383
|
+
var Ce;
|
|
1384
|
+
E > 0 ? Ce = E : je < S ? je < z ? Ce = z : Ce = je : Ce = S, I[Z - 3] = Q[Oe], I[Z - 2] = Q[Oe + 1], I[Z - 1] = Q[Oe + 2], I[Z] = L ? Q[Oe + 3] : Ce;
|
|
1377
1385
|
}
|
|
1378
1386
|
}
|
|
1379
|
-
this.ctx.putImageData(J,
|
|
1387
|
+
this.ctx.putImageData(J, l, u), this._renderBoundaries = [1e3, 1e3, 0, 0];
|
|
1380
1388
|
},
|
|
1381
|
-
getValueAt: function(
|
|
1382
|
-
var
|
|
1383
|
-
return
|
|
1389
|
+
getValueAt: function(l) {
|
|
1390
|
+
var u, v = this.shadowCtx, y = v.getImageData(l.x, l.y, 1, 1), C = y.data[3], w = this._max, E = this._min;
|
|
1391
|
+
return u = Math.abs(w - E) * (C / 255) >> 0, u;
|
|
1384
1392
|
},
|
|
1385
1393
|
getDataURL: function() {
|
|
1386
1394
|
return this.canvas.toDataURL();
|
|
1387
1395
|
}
|
|
1388
|
-
},
|
|
1396
|
+
}, M;
|
|
1389
1397
|
}(), o = function() {
|
|
1390
|
-
var
|
|
1391
|
-
return n.defaultRenderer === "canvas2d" && (
|
|
1392
|
-
}(),
|
|
1398
|
+
var f = !1;
|
|
1399
|
+
return n.defaultRenderer === "canvas2d" && (f = c), f;
|
|
1400
|
+
}(), h = {
|
|
1393
1401
|
merge: function() {
|
|
1394
|
-
for (var
|
|
1395
|
-
var
|
|
1396
|
-
for (var
|
|
1397
|
-
|
|
1402
|
+
for (var g = {}, f = arguments.length, T = 0; T < f; T++) {
|
|
1403
|
+
var _ = arguments[T];
|
|
1404
|
+
for (var M in _)
|
|
1405
|
+
g[M] = _[M];
|
|
1398
1406
|
}
|
|
1399
|
-
return
|
|
1407
|
+
return g;
|
|
1400
1408
|
}
|
|
1401
1409
|
}, d = function() {
|
|
1402
|
-
var
|
|
1403
|
-
function
|
|
1410
|
+
var f = function() {
|
|
1411
|
+
function l() {
|
|
1404
1412
|
this.cStore = {};
|
|
1405
1413
|
}
|
|
1406
|
-
return
|
|
1407
|
-
on: function(
|
|
1414
|
+
return l.prototype = {
|
|
1415
|
+
on: function(u, v, y) {
|
|
1408
1416
|
var C = this.cStore;
|
|
1409
|
-
C[
|
|
1410
|
-
return
|
|
1417
|
+
C[u] || (C[u] = []), C[u].push(function(w) {
|
|
1418
|
+
return v.call(y, w);
|
|
1411
1419
|
});
|
|
1412
1420
|
},
|
|
1413
|
-
emit: function(
|
|
1414
|
-
var
|
|
1415
|
-
if (
|
|
1416
|
-
for (var C =
|
|
1417
|
-
var E =
|
|
1418
|
-
E(
|
|
1421
|
+
emit: function(u, v) {
|
|
1422
|
+
var y = this.cStore;
|
|
1423
|
+
if (y[u])
|
|
1424
|
+
for (var C = y[u].length, w = 0; w < C; w++) {
|
|
1425
|
+
var E = y[u][w];
|
|
1426
|
+
E(v);
|
|
1419
1427
|
}
|
|
1420
1428
|
}
|
|
1421
|
-
},
|
|
1422
|
-
}(),
|
|
1423
|
-
var
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
min:
|
|
1427
|
-
max:
|
|
1428
|
-
gradient:
|
|
1429
|
+
}, l;
|
|
1430
|
+
}(), T = function(M) {
|
|
1431
|
+
var l = M._renderer, u = M._coordinator, v = M._store;
|
|
1432
|
+
u.on("renderpartial", l.renderPartial, l), u.on("renderall", l.renderAll, l), u.on("extremachange", function(y) {
|
|
1433
|
+
M._config.onExtremaChange && M._config.onExtremaChange({
|
|
1434
|
+
min: y.min,
|
|
1435
|
+
max: y.max,
|
|
1436
|
+
gradient: M._config.gradient || M._config.defaultGradient
|
|
1429
1437
|
});
|
|
1430
|
-
}),
|
|
1438
|
+
}), v.setCoordinator(u);
|
|
1431
1439
|
};
|
|
1432
|
-
function
|
|
1433
|
-
var
|
|
1434
|
-
if (this._coordinator = new
|
|
1435
|
-
var
|
|
1436
|
-
if (n.plugins[
|
|
1437
|
-
var
|
|
1438
|
-
this._renderer = new
|
|
1440
|
+
function _() {
|
|
1441
|
+
var M = this._config = h.merge(n, arguments[0] || {});
|
|
1442
|
+
if (this._coordinator = new f(), M.plugin) {
|
|
1443
|
+
var l = M.plugin;
|
|
1444
|
+
if (n.plugins[l]) {
|
|
1445
|
+
var u = n.plugins[l];
|
|
1446
|
+
this._renderer = new u.renderer(M), this._store = new u.store(M);
|
|
1439
1447
|
} else
|
|
1440
|
-
throw new Error("Plugin '" +
|
|
1448
|
+
throw new Error("Plugin '" + l + "' not found. Maybe it was not registered.");
|
|
1441
1449
|
} else
|
|
1442
|
-
this._renderer = new o(
|
|
1443
|
-
|
|
1450
|
+
this._renderer = new o(M), this._store = new a(M);
|
|
1451
|
+
T(this);
|
|
1444
1452
|
}
|
|
1445
|
-
return
|
|
1453
|
+
return _.prototype = {
|
|
1446
1454
|
addData: function() {
|
|
1447
1455
|
return this._store.addData.apply(this._store, arguments), this;
|
|
1448
1456
|
},
|
|
@@ -1458,9 +1466,9 @@ var Pr = { exports: {} };
|
|
|
1458
1466
|
setDataMin: function() {
|
|
1459
1467
|
return this._store.setDataMin.apply(this._store, arguments), this;
|
|
1460
1468
|
},
|
|
1461
|
-
configure: function(
|
|
1462
|
-
const
|
|
1463
|
-
return this._config =
|
|
1469
|
+
configure: function(M) {
|
|
1470
|
+
const l = this._config;
|
|
1471
|
+
return this._config = h.merge(this._config, M), this._renderer.updateConfig(this._config, l), this._coordinator.emit("renderall", this._store._getInternalData()), this;
|
|
1464
1472
|
},
|
|
1465
1473
|
repaint: function() {
|
|
1466
1474
|
return this._coordinator.emit("renderall", this._store._getInternalData()), this;
|
|
@@ -1471,19 +1479,19 @@ var Pr = { exports: {} };
|
|
|
1471
1479
|
getDataURL: function() {
|
|
1472
1480
|
return this._renderer.getDataURL();
|
|
1473
1481
|
},
|
|
1474
|
-
getValueAt: function(
|
|
1475
|
-
return this._store.getValueAt ? this._store.getValueAt(
|
|
1482
|
+
getValueAt: function(M) {
|
|
1483
|
+
return this._store.getValueAt ? this._store.getValueAt(M) : this._renderer.getValueAt ? this._renderer.getValueAt(M) : null;
|
|
1476
1484
|
}
|
|
1477
|
-
},
|
|
1478
|
-
}(),
|
|
1479
|
-
create: function(
|
|
1480
|
-
return new d(
|
|
1485
|
+
}, _;
|
|
1486
|
+
}(), p = {
|
|
1487
|
+
create: function(g) {
|
|
1488
|
+
return new d(g);
|
|
1481
1489
|
},
|
|
1482
|
-
register: function(
|
|
1483
|
-
n.plugins[
|
|
1490
|
+
register: function(g, f) {
|
|
1491
|
+
n.plugins[g] = f;
|
|
1484
1492
|
}
|
|
1485
1493
|
};
|
|
1486
|
-
return
|
|
1494
|
+
return p;
|
|
1487
1495
|
}();
|
|
1488
1496
|
var r = function(n) {
|
|
1489
1497
|
Reflect.getPrototypeOf(r.prototype) !== BMap.Overlay.prototype && Reflect.setPrototypeOf(r.prototype, BMap.Overlay.prototype), this.conf = n, this.conf.visible = n.visible === void 0 ? !0 : n.visible, this.heatmap = null, this.latlngs = [], this.bounds = null;
|
|
@@ -1496,34 +1504,34 @@ var Pr = { exports: {} };
|
|
|
1496
1504
|
n.getPanes().mapPane.appendChild(a), this.conf.valueField = this.conf.valueField || "count", this.heatmap = e.create(this.conf);
|
|
1497
1505
|
var c = this;
|
|
1498
1506
|
return n.addEventListener("resize", function(o) {
|
|
1499
|
-
var
|
|
1500
|
-
a.style.width =
|
|
1507
|
+
var h = o.size;
|
|
1508
|
+
a.style.width = h.width + "px", a.style.height = h.height + "px", c.heatmap._renderer.setDimensions(h.width, h.height), c.draw();
|
|
1501
1509
|
}), this._div = a, a;
|
|
1502
1510
|
}, r.prototype.draw = function() {
|
|
1503
1511
|
if (s()) {
|
|
1504
1512
|
var n = this._map.getBounds();
|
|
1505
1513
|
if (!n.equals(this.bounds)) {
|
|
1506
1514
|
this.bounds = n;
|
|
1507
|
-
var a = this._map.pointToOverlayPixel(n.getNorthEast()), c = this._map.pointToOverlayPixel(n.getSouthWest()), o = a.y,
|
|
1508
|
-
if (this.conf.element.style.left =
|
|
1515
|
+
var a = this._map.pointToOverlayPixel(n.getNorthEast()), c = this._map.pointToOverlayPixel(n.getSouthWest()), o = a.y, h = c.x, d = c.y - a.y, p = a.x - c.x;
|
|
1516
|
+
if (this.conf.element.style.left = h + "px", this.conf.element.style.top = o + "px", this.conf.element.style.width = p + "px", this.conf.element.style.height = d + "px", this.latlngs.length > 0) {
|
|
1509
1517
|
this.heatmap.removeData();
|
|
1510
|
-
var
|
|
1511
|
-
const
|
|
1518
|
+
var g = this.latlngs.length;
|
|
1519
|
+
const l = {
|
|
1512
1520
|
max: this.heatmap._store.getData().max,
|
|
1513
1521
|
data: []
|
|
1514
1522
|
};
|
|
1515
|
-
for (;
|
|
1516
|
-
var
|
|
1517
|
-
if (n.containsPoint(
|
|
1518
|
-
var
|
|
1519
|
-
|
|
1520
|
-
x:
|
|
1521
|
-
y:
|
|
1522
|
-
count: this.latlngs[
|
|
1523
|
+
for (; g--; ) {
|
|
1524
|
+
var f = this.latlngs[g].latlng;
|
|
1525
|
+
if (n.containsPoint(f)) {
|
|
1526
|
+
var T = this._map.pointToOverlayPixel(f), h = this._map.pointToOverlayPixel(n.getSouthWest()).x, o = this._map.pointToOverlayPixel(n.getNorthEast()).y, _ = new BMap.Pixel(T.x - h, T.y - o), M = this.pixelTransform(_);
|
|
1527
|
+
l.data.push({
|
|
1528
|
+
x: M.x,
|
|
1529
|
+
y: M.y,
|
|
1530
|
+
count: this.latlngs[g].c
|
|
1523
1531
|
});
|
|
1524
1532
|
}
|
|
1525
1533
|
}
|
|
1526
|
-
this.conf.radiusChangeByZoom && (this.heatmap._store._cfgRadius = this.conf.radiusChangeByZoom(this._map.getZoom())), this.heatmap.setData(
|
|
1534
|
+
this.conf.radiusChangeByZoom && (this.heatmap._store._cfgRadius = this.conf.radiusChangeByZoom(this._map.getZoom())), this.heatmap.setData(l);
|
|
1527
1535
|
}
|
|
1528
1536
|
}
|
|
1529
1537
|
}
|
|
@@ -1542,18 +1550,18 @@ var Pr = { exports: {} };
|
|
|
1542
1550
|
var a = this._map.getBounds(), c = {
|
|
1543
1551
|
max: n.max,
|
|
1544
1552
|
data: []
|
|
1545
|
-
}, o = n.data,
|
|
1546
|
-
for (this.latlngs = [], this.heatmap.removeData(), this.conf.radiusChangeByZoom && (this.heatmap._store._cfgRadius = this.conf.radiusChangeByZoom(this._map.getZoom()));
|
|
1547
|
-
var d = new BMap.Point(o[
|
|
1553
|
+
}, o = n.data, h = o.length;
|
|
1554
|
+
for (this.latlngs = [], this.heatmap.removeData(), this.conf.radiusChangeByZoom && (this.heatmap._store._cfgRadius = this.conf.radiusChangeByZoom(this._map.getZoom())); h--; ) {
|
|
1555
|
+
var d = new BMap.Point(o[h].lng, o[h].lat);
|
|
1548
1556
|
if (this.latlngs.push({
|
|
1549
1557
|
latlng: d,
|
|
1550
|
-
c: o[
|
|
1558
|
+
c: o[h].count
|
|
1551
1559
|
}), !!a.containsPoint(d)) {
|
|
1552
|
-
var
|
|
1560
|
+
var p = this._map.pointToOverlayPixel(d), g = this._map.pointToOverlayPixel(a.getSouthWest()).x, f = this._map.pointToOverlayPixel(a.getNorthEast()).y, T = new BMap.Pixel(p.x - g, p.y - f), _ = this.pixelTransform(T);
|
|
1553
1561
|
c.data.push({
|
|
1554
|
-
x:
|
|
1555
|
-
y:
|
|
1556
|
-
count: o[
|
|
1562
|
+
x: _.x,
|
|
1563
|
+
y: _.y,
|
|
1564
|
+
count: o[h].count
|
|
1557
1565
|
});
|
|
1558
1566
|
}
|
|
1559
1567
|
}
|
|
@@ -1566,8 +1574,8 @@ var Pr = { exports: {} };
|
|
|
1566
1574
|
lat: a,
|
|
1567
1575
|
count: c
|
|
1568
1576
|
});
|
|
1569
|
-
var o = new BMap.Point(n, a),
|
|
1570
|
-
this.heatmap.store.addDataPoint(
|
|
1577
|
+
var o = new BMap.Point(n, a), h = this.pixelTransform(this._map.pointToOverlayPixel(o));
|
|
1578
|
+
this.heatmap.store.addDataPoint(h.x, h.y, c), this.latlngs.push({
|
|
1571
1579
|
latlng: o,
|
|
1572
1580
|
c
|
|
1573
1581
|
});
|
|
@@ -1621,7 +1629,7 @@ class Lr {
|
|
|
1621
1629
|
class Oi extends Lr {
|
|
1622
1630
|
constructor(e, r) {
|
|
1623
1631
|
super();
|
|
1624
|
-
|
|
1632
|
+
m(this, "inner");
|
|
1625
1633
|
this.map = e, this.inner = new google.maps.visualization.HeatmapLayer(qe.toGoogle(r, this.map.coordType)), this.inner.setMap(e.innerMap);
|
|
1626
1634
|
}
|
|
1627
1635
|
setData(e) {
|
|
@@ -1637,7 +1645,7 @@ class Oi extends Lr {
|
|
|
1637
1645
|
class Ci extends Lr {
|
|
1638
1646
|
constructor(e, r) {
|
|
1639
1647
|
super();
|
|
1640
|
-
|
|
1648
|
+
m(this, "inner");
|
|
1641
1649
|
this.map = e;
|
|
1642
1650
|
const s = qe.toBaidu(r, this.map.coordType, r.maxIntensity);
|
|
1643
1651
|
this.inner = new Mi(s), e.innerMap.addOverlay(this.inner), this.inner.setDataSet(s.data);
|
|
@@ -1670,7 +1678,7 @@ class Br {
|
|
|
1670
1678
|
this.options = t;
|
|
1671
1679
|
}
|
|
1672
1680
|
}
|
|
1673
|
-
function
|
|
1681
|
+
function Le(i, t, e) {
|
|
1674
1682
|
const r = new URL(t, i), s = new URLSearchParams(Object.entries(e).filter(li));
|
|
1675
1683
|
return r.search = "?" + s.toString(), r;
|
|
1676
1684
|
}
|
|
@@ -1678,43 +1686,43 @@ function pt() {
|
|
|
1678
1686
|
const i = window.location.hostname.split(".").filter((t) => !be.isInt(t));
|
|
1679
1687
|
return i.length === 3 ? i.join(".") : [...i, "tg", "map", "urls"].slice(0, 3).join(".");
|
|
1680
1688
|
}
|
|
1681
|
-
const
|
|
1689
|
+
const Se = class Se extends Br {
|
|
1682
1690
|
/** @see https://developers.google.com/maps/documentation/urls/get-started#directions-action */
|
|
1683
1691
|
directions(t, e, r) {
|
|
1684
|
-
return
|
|
1692
|
+
return Le(Se.BASE_URL, "dir/", {
|
|
1685
1693
|
api: "1",
|
|
1686
1694
|
// {@template google_map_normal_gcj02}
|
|
1687
1695
|
// google地图的普通地图, 在国内其实上是gcj02坐标, 卫星地图是wgs84坐标, 因为这里打开的是基础地图, 故使用gcj02
|
|
1688
1696
|
// {@endtemplate}
|
|
1689
|
-
origin: te.toString(t,
|
|
1690
|
-
destination: te.toString(e,
|
|
1697
|
+
origin: te.toString(t, D.gcj02),
|
|
1698
|
+
destination: te.toString(e, D.gcj02),
|
|
1691
1699
|
travelmode: r
|
|
1692
1700
|
});
|
|
1693
1701
|
}
|
|
1694
1702
|
/** @see https://developers.google.com/maps/documentation/urls/get-started#search-action */
|
|
1695
1703
|
search(t) {
|
|
1696
|
-
return
|
|
1704
|
+
return Le(Se.BASE_URL, "search/", {
|
|
1697
1705
|
api: "1",
|
|
1698
1706
|
// {@macro google_map_normal_gcj02}
|
|
1699
|
-
query: te.toString(t,
|
|
1707
|
+
query: te.toString(t, D.gcj02)
|
|
1700
1708
|
});
|
|
1701
1709
|
}
|
|
1702
1710
|
};
|
|
1703
|
-
|
|
1704
|
-
let Mt =
|
|
1711
|
+
m(Se, "BASE_URL", "https://www.google.com/maps/");
|
|
1712
|
+
let Mt = Se;
|
|
1705
1713
|
const ge = class ge extends Br {
|
|
1706
1714
|
/**
|
|
1707
1715
|
* 导航
|
|
1708
1716
|
* @see https://lbsyun.baidu.com/faq/api?title=webapi/uri/web#:~:text=%E6%9C%8D%E5%8A%A1%E5%9C%B0%E5%9D%80-,http%3A//api.map.baidu.com/direction,-//PC%26Webapp%E6%9C%8D%E5%8A%A1
|
|
1709
1717
|
* */
|
|
1710
1718
|
directions(t, e, r = "driving") {
|
|
1711
|
-
const s = te.getCoordType(e) ?? te.getCoordType(t) ??
|
|
1712
|
-
return
|
|
1719
|
+
const s = te.getCoordType(e) ?? te.getCoordType(t) ?? D.bd09, n = te.toString(e, s);
|
|
1720
|
+
return Le(ge.BASE_URL, "direction", {
|
|
1713
1721
|
// baidu地图, 一定要有起点, 故这里用终点当起点, 防止导航失败
|
|
1714
1722
|
origin: te.toString(t, s) ?? (typeof e != "string" ? `name:请选择起点|latlng:${n}` : n),
|
|
1715
1723
|
destination: n,
|
|
1716
1724
|
// 默认就是bd09
|
|
1717
|
-
coord_type: s ===
|
|
1725
|
+
coord_type: s === D.bd09 ? void 0 : s,
|
|
1718
1726
|
mode: r,
|
|
1719
1727
|
output: "html",
|
|
1720
1728
|
region: "中国",
|
|
@@ -1728,7 +1736,7 @@ const ge = class ge extends Br {
|
|
|
1728
1736
|
* 显示经纬度, {@link markerApi}中途跳转的url, 一定能够定位到
|
|
1729
1737
|
* */
|
|
1730
1738
|
latlngApi(t) {
|
|
1731
|
-
const e = t.to(
|
|
1739
|
+
const e = t.to(D.bd09);
|
|
1732
1740
|
return new URL(`https://map.baidu.com/?latlng=${e.lat},${e.lng}`);
|
|
1733
1741
|
}
|
|
1734
1742
|
/**
|
|
@@ -1736,9 +1744,9 @@ const ge = class ge extends Br {
|
|
|
1736
1744
|
* @see https://lbsyun.baidu.com/faq/api?title=webapi/uri/web#%E5%9B%BE%E5%8C%BA%E5%8A%9F%E8%83%BD
|
|
1737
1745
|
*/
|
|
1738
1746
|
markerApi(t, e, r) {
|
|
1739
|
-
return
|
|
1747
|
+
return Le(ge.BASE_URL, "marker", {
|
|
1740
1748
|
location: `${t.lat},${t.lng}`,
|
|
1741
|
-
coord_type: t.coord ===
|
|
1749
|
+
coord_type: t.coord === D.bd09 ? void 0 : t.coord,
|
|
1742
1750
|
title: e,
|
|
1743
1751
|
content: r,
|
|
1744
1752
|
output: "html",
|
|
@@ -1750,20 +1758,20 @@ const ge = class ge extends Br {
|
|
|
1750
1758
|
* @see https://lbsyun.baidu.com/faq/api?title=webapi/uri/web#%E5%9B%BE%E5%8C%BA%E5%8A%9F%E8%83%BD:~:text=%E4%B8%8D%E4%BF%9D%E8%AF%81%E6%9C%8D%E5%8A%A1%E3%80%82-,2.1.2%20%E5%9C%B0%E5%9D%80%E8%A7%A3%E6%9E%90,-%E8%B0%83%E7%94%A8%E8%AF%A5
|
|
1751
1759
|
* */
|
|
1752
1760
|
geocoderApi(t) {
|
|
1753
|
-
return
|
|
1761
|
+
return Le(ge.BASE_URL, "geocoder", {
|
|
1754
1762
|
...typeof t == "string" ? {
|
|
1755
1763
|
address: t
|
|
1756
1764
|
} : {
|
|
1757
1765
|
location: `${t.lat},${t.lng}`,
|
|
1758
1766
|
// 默认就是bd09
|
|
1759
|
-
coord_type: t.coord ===
|
|
1767
|
+
coord_type: t.coord === D.bd09 ? void 0 : t.coord
|
|
1760
1768
|
},
|
|
1761
1769
|
output: "html",
|
|
1762
1770
|
src: pt()
|
|
1763
1771
|
});
|
|
1764
1772
|
}
|
|
1765
1773
|
};
|
|
1766
|
-
|
|
1774
|
+
m(ge, "BASE_URL", "https://api.map.baidu.com/");
|
|
1767
1775
|
let Ot = ge, wi = class Ir {
|
|
1768
1776
|
constructor(t, e, r) {
|
|
1769
1777
|
this.extend(Ir, google.maps.OverlayView), this.map_ = t, this.MARKER_CLUSTER_IMAGE_PATH_ = "../images/m", this.MARKER_CLUSTER_IMAGE_EXTENSION_ = "png", this.markers_ = [], this.clusters_ = [], this.sizes = [53, 56, 66, 78, 90], this.styles_ = [], this.ready_ = !1;
|
|
@@ -2485,57 +2493,57 @@ var Sr = { exports: {} };
|
|
|
2485
2493
|
return Object.prototype.toString.call(o) == "[object String]";
|
|
2486
2494
|
}, r.isString = r.lang.isString, r.dom._g = function(o) {
|
|
2487
2495
|
return r.lang.isString(o) ? document.getElementById(o) : o;
|
|
2488
|
-
}, 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,
|
|
2496
|
+
}, 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, h) {
|
|
2489
2497
|
o = r.dom._g(o);
|
|
2490
|
-
var d = r.dom.getDocument(o),
|
|
2491
|
-
return d.defaultView && d.defaultView.getComputedStyle && (
|
|
2492
|
-
}, r.dom._styleFixer = r.dom._styleFixer || {}, r.dom._styleFilter = r.dom._styleFilter || [], r.dom._styleFilter.filter = function(o,
|
|
2493
|
-
for (var
|
|
2494
|
-
(
|
|
2495
|
-
return
|
|
2498
|
+
var d = r.dom.getDocument(o), p;
|
|
2499
|
+
return d.defaultView && d.defaultView.getComputedStyle && (p = d.defaultView.getComputedStyle(o, null), p) ? p[h] || p.getPropertyValue(h) : "";
|
|
2500
|
+
}, r.dom._styleFixer = r.dom._styleFixer || {}, r.dom._styleFilter = r.dom._styleFilter || [], r.dom._styleFilter.filter = function(o, h, d) {
|
|
2501
|
+
for (var p = 0, g = r.dom._styleFilter, f; f = g[p]; p++)
|
|
2502
|
+
(f = f[d]) && (h = f(o, h));
|
|
2503
|
+
return h;
|
|
2496
2504
|
}, r.string = r.string || {}, r.string.toCamelCase = function(o) {
|
|
2497
|
-
return o.indexOf("-") < 0 && o.indexOf("_") < 0 ? o : o.replace(/[-_][^-_]/g, function(
|
|
2498
|
-
return
|
|
2505
|
+
return o.indexOf("-") < 0 && o.indexOf("_") < 0 ? o : o.replace(/[-_][^-_]/g, function(h) {
|
|
2506
|
+
return h.charAt(1).toUpperCase();
|
|
2499
2507
|
});
|
|
2500
|
-
}, r.dom.getStyle = function(o,
|
|
2508
|
+
}, r.dom.getStyle = function(o, h) {
|
|
2501
2509
|
var d = r.dom;
|
|
2502
|
-
o = d.g(o),
|
|
2503
|
-
var
|
|
2504
|
-
if (!
|
|
2505
|
-
var
|
|
2506
|
-
|
|
2510
|
+
o = d.g(o), h = r.string.toCamelCase(h);
|
|
2511
|
+
var p = o.style[h] || (o.currentStyle ? o.currentStyle[h] : "") || d.getComputedStyle(o, h);
|
|
2512
|
+
if (!p) {
|
|
2513
|
+
var g = d._styleFixer[h];
|
|
2514
|
+
g && (p = g.get ? g.get(o) : r.dom.getStyle(o, g));
|
|
2507
2515
|
}
|
|
2508
|
-
return (
|
|
2516
|
+
return (g = d._styleFilter) && (p = g.filter(h, p, "get")), p;
|
|
2509
2517
|
}, 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) {
|
|
2510
2518
|
o = r.dom.g(o);
|
|
2511
|
-
var
|
|
2512
|
-
d.isGecko > 0 &&
|
|
2513
|
-
var
|
|
2514
|
-
if (o ==
|
|
2515
|
-
return
|
|
2519
|
+
var h = r.dom.getDocument(o), d = r.browser, p = r.dom.getStyle;
|
|
2520
|
+
d.isGecko > 0 && h.getBoxObjectFor && p(o, "position") == "absolute" && (o.style.top === "" || o.style.left);
|
|
2521
|
+
var g = { left: 0, top: 0 }, f = d.ie && !d.isStrict ? h.body : h.documentElement, T, _;
|
|
2522
|
+
if (o == f)
|
|
2523
|
+
return g;
|
|
2516
2524
|
if (o.getBoundingClientRect) {
|
|
2517
|
-
|
|
2518
|
-
var
|
|
2519
|
-
d.ie && !d.isStrict && (
|
|
2525
|
+
_ = o.getBoundingClientRect(), g.left = Math.floor(_.left) + Math.max(h.documentElement.scrollLeft, h.body.scrollLeft), g.top = Math.floor(_.top) + Math.max(h.documentElement.scrollTop, h.body.scrollTop), g.left -= h.documentElement.clientLeft, g.top -= h.documentElement.clientTop;
|
|
2526
|
+
var M = h.body, l = parseInt(p(M, "borderLeftWidth")), u = parseInt(p(M, "borderTopWidth"));
|
|
2527
|
+
d.ie && !d.isStrict && (g.left -= isNaN(l) ? 2 : l, g.top -= isNaN(u) ? 2 : u);
|
|
2520
2528
|
} else {
|
|
2521
|
-
|
|
2529
|
+
T = o;
|
|
2522
2530
|
do {
|
|
2523
|
-
if (
|
|
2524
|
-
|
|
2531
|
+
if (g.left += T.offsetLeft, g.top += T.offsetTop, d.isWebkit > 0 && p(T, "position") == "fixed") {
|
|
2532
|
+
g.left += h.body.scrollLeft, g.top += h.body.scrollTop;
|
|
2525
2533
|
break;
|
|
2526
2534
|
}
|
|
2527
|
-
|
|
2528
|
-
} while (
|
|
2529
|
-
for ((d.opera > 0 || d.isWebkit > 0 &&
|
|
2530
|
-
|
|
2535
|
+
T = T.offsetParent;
|
|
2536
|
+
} while (T && T != o);
|
|
2537
|
+
for ((d.opera > 0 || d.isWebkit > 0 && p(o, "position") == "absolute") && (g.top -= h.body.offsetTop), T = o.offsetParent; T && T != h.body; )
|
|
2538
|
+
g.left -= T.scrollLeft, (!d.opera || T.tagName != "TR") && (g.top -= T.scrollTop), T = T.offsetParent;
|
|
2531
2539
|
}
|
|
2532
|
-
return
|
|
2533
|
-
}, r.event = r.event || {}, r.event._listeners = r.event._listeners || [], r.event.on = function(o,
|
|
2534
|
-
|
|
2535
|
-
var
|
|
2536
|
-
d.call(o,
|
|
2537
|
-
},
|
|
2538
|
-
return
|
|
2540
|
+
return g;
|
|
2541
|
+
}, r.event = r.event || {}, r.event._listeners = r.event._listeners || [], r.event.on = function(o, h, d) {
|
|
2542
|
+
h = h.replace(/^on/i, ""), o = r.dom._g(o);
|
|
2543
|
+
var p = function(M) {
|
|
2544
|
+
d.call(o, M);
|
|
2545
|
+
}, g = r.event._listeners, f = r.event._eventFilter, T, _ = h;
|
|
2546
|
+
return h = h.toLowerCase(), f && f[h] && (T = f[h](o, h, p), _ = T.type, p = T.listener), o.addEventListener ? o.addEventListener(_, p, !1) : o.attachEvent && o.attachEvent("on" + _, p), g[g.length] = [o, h, d, p, _], o;
|
|
2539
2547
|
}, r.on = r.event.on, function() {
|
|
2540
2548
|
var o = s[r.guid];
|
|
2541
2549
|
r.lang.guid = function() {
|
|
@@ -2552,58 +2560,58 @@ var Sr = { exports: {} };
|
|
|
2552
2560
|
this.disposed = !0;
|
|
2553
2561
|
}, r.lang.Class.prototype.toString = function() {
|
|
2554
2562
|
return "[object " + (this._className || "Object") + "]";
|
|
2555
|
-
}, r.lang.Event = function(o,
|
|
2556
|
-
this.type = o, this.returnValue = !0, this.target =
|
|
2557
|
-
}, r.lang.Class.prototype.addEventListener = function(o,
|
|
2558
|
-
if (r.lang.isFunction(
|
|
2563
|
+
}, r.lang.Event = function(o, h) {
|
|
2564
|
+
this.type = o, this.returnValue = !0, this.target = h || null, this.currentTarget = null;
|
|
2565
|
+
}, r.lang.Class.prototype.addEventListener = function(o, h, d) {
|
|
2566
|
+
if (r.lang.isFunction(h)) {
|
|
2559
2567
|
!this.__listeners && (this.__listeners = {});
|
|
2560
|
-
var
|
|
2568
|
+
var p = this.__listeners, g;
|
|
2561
2569
|
if (typeof d == "string" && d) {
|
|
2562
2570
|
if (/[^\w\-]/.test(d))
|
|
2563
2571
|
throw "nonstandard key:" + d;
|
|
2564
|
-
|
|
2572
|
+
h.hashCode = d, g = d;
|
|
2565
2573
|
}
|
|
2566
|
-
o.indexOf("on") != 0 && (o = "on" + o), typeof
|
|
2574
|
+
o.indexOf("on") != 0 && (o = "on" + o), typeof p[o] != "object" && (p[o] = {}), g = g || r.lang.guid(), h.hashCode = g, p[o][g] = h;
|
|
2567
2575
|
}
|
|
2568
|
-
}, r.lang.Class.prototype.removeEventListener = function(o,
|
|
2569
|
-
if (!(typeof
|
|
2576
|
+
}, r.lang.Class.prototype.removeEventListener = function(o, h) {
|
|
2577
|
+
if (!(typeof h < "u" && (r.lang.isFunction(h) && !(h = h.hashCode) || !r.lang.isString(h)))) {
|
|
2570
2578
|
!this.__listeners && (this.__listeners = {}), o.indexOf("on") != 0 && (o = "on" + o);
|
|
2571
2579
|
var d = this.__listeners;
|
|
2572
2580
|
if (d[o])
|
|
2573
|
-
if (typeof
|
|
2574
|
-
d[o][
|
|
2581
|
+
if (typeof h < "u")
|
|
2582
|
+
d[o][h] && delete d[o][h];
|
|
2575
2583
|
else
|
|
2576
|
-
for (var
|
|
2577
|
-
delete d[o][
|
|
2584
|
+
for (var p in d[o])
|
|
2585
|
+
delete d[o][p];
|
|
2578
2586
|
}
|
|
2579
|
-
}, r.lang.Class.prototype.dispatchEvent = function(o,
|
|
2580
|
-
r.lang.isString(o) && (o = new r.lang.Event(o)), !this.__listeners && (this.__listeners = {}),
|
|
2581
|
-
for (var d in
|
|
2582
|
-
o[d] =
|
|
2583
|
-
var d,
|
|
2584
|
-
if (o.target = o.target || this, o.currentTarget = this,
|
|
2585
|
-
for (d in
|
|
2586
|
-
|
|
2587
|
+
}, r.lang.Class.prototype.dispatchEvent = function(o, h) {
|
|
2588
|
+
r.lang.isString(o) && (o = new r.lang.Event(o)), !this.__listeners && (this.__listeners = {}), h = h || {};
|
|
2589
|
+
for (var d in h)
|
|
2590
|
+
o[d] = h[d];
|
|
2591
|
+
var d, p = this.__listeners, g = o.type;
|
|
2592
|
+
if (o.target = o.target || this, o.currentTarget = this, g.indexOf("on") != 0 && (g = "on" + g), r.lang.isFunction(this[g]) && this[g].apply(this, arguments), typeof p[g] == "object")
|
|
2593
|
+
for (d in p[g])
|
|
2594
|
+
p[g][d].apply(this, arguments);
|
|
2587
2595
|
return o.returnValue;
|
|
2588
|
-
}, r.lang.inherits = function(o,
|
|
2589
|
-
var
|
|
2590
|
-
|
|
2591
|
-
for (
|
|
2592
|
-
p
|
|
2593
|
-
o.prototype.constructor = o, o.superClass =
|
|
2596
|
+
}, r.lang.inherits = function(o, h, d) {
|
|
2597
|
+
var p, g, f = o.prototype, T = new Function();
|
|
2598
|
+
T.prototype = h.prototype, g = o.prototype = new T();
|
|
2599
|
+
for (p in f)
|
|
2600
|
+
g[p] = f[p];
|
|
2601
|
+
o.prototype.constructor = o, o.superClass = h.prototype, typeof d == "string" && (g._className = d);
|
|
2594
2602
|
}, r.inherits = r.lang.inherits;
|
|
2595
|
-
var n = "http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m", a = "png", c = function(o,
|
|
2603
|
+
var n = "http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m", a = "png", c = function(o, h, d) {
|
|
2596
2604
|
try {
|
|
2597
2605
|
BMap;
|
|
2598
2606
|
} catch {
|
|
2599
2607
|
throw Error("Baidu Map JS API is not ready yet!");
|
|
2600
2608
|
}
|
|
2601
|
-
e.lang.inherits(c, BMap.Overlay, "TextIconOverlay"), this._position = o, this._text =
|
|
2609
|
+
e.lang.inherits(c, BMap.Overlay, "TextIconOverlay"), this._position = o, this._text = h, this._options = d || {}, this._styles = this._options.styles || [], this._zIndex = this._options.zIndex, !this._styles.length && this._setupDefaultStyles();
|
|
2602
2610
|
};
|
|
2603
2611
|
return c.prototype._setupDefaultStyles = function() {
|
|
2604
|
-
for (var o = [53, 56, 66, 78, 90],
|
|
2612
|
+
for (var o = [53, 56, 66, 78, 90], h = 0, d; d = o[h]; h++)
|
|
2605
2613
|
this._styles.push({
|
|
2606
|
-
url: n +
|
|
2614
|
+
url: n + h + "." + a,
|
|
2607
2615
|
size: new BMap.Size(d, d)
|
|
2608
2616
|
});
|
|
2609
2617
|
}, c.prototype.initialize = function(o) {
|
|
@@ -2618,9 +2626,9 @@ var Sr = { exports: {} };
|
|
|
2618
2626
|
return this._position;
|
|
2619
2627
|
}, c.prototype.setPosition = function(o) {
|
|
2620
2628
|
o && (!this._position || !this._position.equals(o)) && (this._position = o, this._updatePosition());
|
|
2621
|
-
}, c.prototype.getStyleByText = function(o,
|
|
2622
|
-
var d = parseInt(o),
|
|
2623
|
-
return
|
|
2629
|
+
}, c.prototype.getStyleByText = function(o, h) {
|
|
2630
|
+
var d = parseInt(o), p = parseInt(d / 10);
|
|
2631
|
+
return p = Math.max(0, p), p = Math.min(p, h.length - 1), h[p];
|
|
2624
2632
|
}, c.prototype._updateCss = function() {
|
|
2625
2633
|
if (this._domElement) {
|
|
2626
2634
|
var o = this.getStyleByText(this._text, this._styles);
|
|
@@ -2630,37 +2638,37 @@ var Sr = { exports: {} };
|
|
|
2630
2638
|
this._domElement && (this._domElement.innerHTML = this._text);
|
|
2631
2639
|
}, c.prototype._updatePosition = function() {
|
|
2632
2640
|
if (this._domElement && this._position) {
|
|
2633
|
-
var o = this._domElement.style,
|
|
2634
|
-
|
|
2641
|
+
var o = this._domElement.style, h = this._map.pointToOverlayPixel(this._position);
|
|
2642
|
+
h.x -= Math.ceil(parseInt(o.width) / 2), h.y -= Math.ceil(parseInt(o.height) / 2), o.left = h.x + "px", o.top = h.y + "px";
|
|
2635
2643
|
}
|
|
2636
2644
|
}, c.prototype._buildCssText = function(o) {
|
|
2637
|
-
var
|
|
2638
|
-
if (this._zIndex &&
|
|
2639
|
-
|
|
2645
|
+
var h = o.url, d = o.size, p = o.anchor, g = o.offset, f = o.textColor || "black", T = o.textSize || 10, _ = [];
|
|
2646
|
+
if (this._zIndex && _.push("z-index:" + this._zIndex + ";"), e.browser.ie < 7)
|
|
2647
|
+
_.push('filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="' + h + '");');
|
|
2640
2648
|
else {
|
|
2641
|
-
|
|
2642
|
-
var
|
|
2643
|
-
|
|
2649
|
+
_.push("background-image:url(" + h + ");");
|
|
2650
|
+
var M = "0 0";
|
|
2651
|
+
g instanceof BMap.Size && (M = g.width + "px " + g.height + "px"), _.push("background-position:" + M + ";");
|
|
2644
2652
|
}
|
|
2645
|
-
return d instanceof BMap.Size && (
|
|
2653
|
+
return d instanceof BMap.Size && (p instanceof BMap.Size ? (p.height > 0 && p.height < d.height && _.push("height:" + (d.height - p.height) + "px; padding-top:" + p.height + "px;"), p.width > 0 && p.width < d.width && _.push("width:" + (d.width - p.width) + "px; padding-left:" + p.width + "px;")) : (_.push("height:" + d.height + "px; line-height:" + d.height + "px;"), _.push("width:" + d.width + "px; text-align:center;"))), _.push("cursor:pointer; color:" + f + "; position:absolute; font-size:" + T + "px; font-family:Arial,sans-serif; font-weight:bold"), _.join("");
|
|
2646
2654
|
}, c.prototype._bind = function() {
|
|
2647
2655
|
if (!this._domElement)
|
|
2648
2656
|
return;
|
|
2649
|
-
var o = this,
|
|
2650
|
-
function
|
|
2651
|
-
var
|
|
2652
|
-
if (
|
|
2653
|
-
var
|
|
2654
|
-
|
|
2657
|
+
var o = this, h = this._map, d = e.lang.Event;
|
|
2658
|
+
function p(g, f) {
|
|
2659
|
+
var T = g.srcElement || g.target, _ = g.clientX || g.pageX, M = g.clientY || g.pageY;
|
|
2660
|
+
if (g && f && _ && M && T) {
|
|
2661
|
+
var l = e.dom.getPosition(h.getContainer());
|
|
2662
|
+
f.pixel = new BMap.Pixel(_ - l.left, M - l.top), f.point = h.pixelToPoint(f.pixel);
|
|
2655
2663
|
}
|
|
2656
|
-
return
|
|
2664
|
+
return f;
|
|
2657
2665
|
}
|
|
2658
|
-
e.event.on(this._domElement, "mouseover", function(
|
|
2659
|
-
o.dispatchEvent(
|
|
2660
|
-
}), e.event.on(this._domElement, "mouseout", function(
|
|
2661
|
-
o.dispatchEvent(
|
|
2662
|
-
}), e.event.on(this._domElement, "click", function(
|
|
2663
|
-
o.dispatchEvent(
|
|
2666
|
+
e.event.on(this._domElement, "mouseover", function(g) {
|
|
2667
|
+
o.dispatchEvent(p(g, new d("onmouseover")));
|
|
2668
|
+
}), e.event.on(this._domElement, "mouseout", function(g) {
|
|
2669
|
+
o.dispatchEvent(p(g, new d("onmouseout")));
|
|
2670
|
+
}), e.event.on(this._domElement, "click", function(g) {
|
|
2671
|
+
o.dispatchEvent(p(g, new d("onclick")));
|
|
2664
2672
|
});
|
|
2665
2673
|
}, c;
|
|
2666
2674
|
});
|
|
@@ -2979,7 +2987,7 @@ class Li extends Rr {
|
|
|
2979
2987
|
constructor(e, r) {
|
|
2980
2988
|
var n;
|
|
2981
2989
|
super(e);
|
|
2982
|
-
|
|
2990
|
+
m(this, "inner");
|
|
2983
2991
|
this.inner = new x(e.innerMap, {
|
|
2984
2992
|
// baidu的构造器中的markers, 会触发重绘, 会导致使用旧的calculator计算cluster
|
|
2985
2993
|
// markers: options.markers?.map(it => (it as BaiduMarker).innerOverlay),
|
|
@@ -3001,7 +3009,7 @@ class Bi extends Rr {
|
|
|
3001
3009
|
constructor(e, r) {
|
|
3002
3010
|
var n, a;
|
|
3003
3011
|
super(e);
|
|
3004
|
-
|
|
3012
|
+
m(this, "inner");
|
|
3005
3013
|
this.inner = new wi(
|
|
3006
3014
|
e.innerMap,
|
|
3007
3015
|
// google的构造器中的markers,不会触发重绘, 第一次绘制通过监听地图的'idle'事件触发, 可以直接设置
|
|
@@ -3033,7 +3041,7 @@ class $r {
|
|
|
3033
3041
|
class Ii extends $r {
|
|
3034
3042
|
constructor(e, r) {
|
|
3035
3043
|
super();
|
|
3036
|
-
|
|
3044
|
+
m(this, "inner");
|
|
3037
3045
|
this.map = e, this.inner = new google.maps.places.PlacesService(e.innerMap);
|
|
3038
3046
|
}
|
|
3039
3047
|
search(e, r) {
|
|
@@ -3064,7 +3072,7 @@ class Ii extends $r {
|
|
|
3064
3072
|
switch (c) {
|
|
3065
3073
|
case google.maps.places.PlacesServiceStatus.ZERO_RESULTS:
|
|
3066
3074
|
case google.maps.places.PlacesServiceStatus.OK: {
|
|
3067
|
-
const o = (a ?? []).map((
|
|
3075
|
+
const o = (a ?? []).map((h) => xr(h, this.map));
|
|
3068
3076
|
s(o);
|
|
3069
3077
|
break;
|
|
3070
3078
|
}
|
|
@@ -3079,8 +3087,8 @@ class Ii extends $r {
|
|
|
3079
3087
|
class Si extends $r {
|
|
3080
3088
|
constructor(e, r) {
|
|
3081
3089
|
super();
|
|
3082
|
-
|
|
3083
|
-
|
|
3090
|
+
m(this, "searchRequestMap", /* @__PURE__ */ new Map());
|
|
3091
|
+
m(this, "currentSearch");
|
|
3084
3092
|
this.map = e;
|
|
3085
3093
|
}
|
|
3086
3094
|
get inner() {
|
|
@@ -3112,21 +3120,21 @@ class Si extends $r {
|
|
|
3112
3120
|
const o = a.getStatus();
|
|
3113
3121
|
switch (o) {
|
|
3114
3122
|
case BMAP_STATUS_SUCCESS: {
|
|
3115
|
-
const
|
|
3123
|
+
const h = [];
|
|
3116
3124
|
for (let d = 0; d < c.getCurrentNumPois(); d++) {
|
|
3117
|
-
const
|
|
3118
|
-
|
|
3119
|
-
id:
|
|
3120
|
-
city:
|
|
3125
|
+
const p = c.getPoi(d);
|
|
3126
|
+
h.push({
|
|
3127
|
+
id: p.uid,
|
|
3128
|
+
city: p.city,
|
|
3121
3129
|
country: "",
|
|
3122
3130
|
// 百度地图只支持中国
|
|
3123
|
-
position: O.fromBaidu(
|
|
3124
|
-
province:
|
|
3125
|
-
title:
|
|
3126
|
-
address:
|
|
3131
|
+
position: O.fromBaidu(p.point, this.map.coordType),
|
|
3132
|
+
province: p.province,
|
|
3133
|
+
title: p.title,
|
|
3134
|
+
address: p.address
|
|
3127
3135
|
});
|
|
3128
3136
|
}
|
|
3129
|
-
s(
|
|
3137
|
+
s(h);
|
|
3130
3138
|
break;
|
|
3131
3139
|
}
|
|
3132
3140
|
case BMAP_STATUS_UNKNOWN_LOCATION:
|
|
@@ -3144,8 +3152,8 @@ class Si extends $r {
|
|
|
3144
3152
|
}
|
|
3145
3153
|
class zr {
|
|
3146
3154
|
constructor(t, e) {
|
|
3147
|
-
|
|
3148
|
-
|
|
3155
|
+
m(this, "onData");
|
|
3156
|
+
m(this, "onError");
|
|
3149
3157
|
this.map = t, this.input = e;
|
|
3150
3158
|
}
|
|
3151
3159
|
/**
|
|
@@ -3154,13 +3162,13 @@ class zr {
|
|
|
3154
3162
|
* @mustCallSuper 子类必须调用一次`super.setSearchListener`, 用来保存{@link onData}和{@link onError}
|
|
3155
3163
|
* */
|
|
3156
3164
|
setSearchListener(t, e) {
|
|
3157
|
-
return this.onData && B("setSearchListener只能调用一次"), this.onData = t, this.onError = e,
|
|
3165
|
+
return this.onData && B("setSearchListener只能调用一次"), this.onData = t, this.onError = e, De;
|
|
3158
3166
|
}
|
|
3159
3167
|
}
|
|
3160
3168
|
class ki extends zr {
|
|
3161
3169
|
constructor(e, r) {
|
|
3162
3170
|
super(e, r.input);
|
|
3163
|
-
|
|
3171
|
+
m(this, "searchBox");
|
|
3164
3172
|
this.searchBox = new google.maps.places.SearchBox(r.input), this.searchBox.bindTo("bounds", e.innerMap);
|
|
3165
3173
|
}
|
|
3166
3174
|
setSearchListener(e, r) {
|
|
@@ -3176,8 +3184,8 @@ class ki extends zr {
|
|
|
3176
3184
|
class Ai extends zr {
|
|
3177
3185
|
constructor(e, r) {
|
|
3178
3186
|
super(e, r.input);
|
|
3179
|
-
|
|
3180
|
-
|
|
3187
|
+
m(this, "autocomplete");
|
|
3188
|
+
m(this, "placesService");
|
|
3181
3189
|
this.autocomplete = e.createAutocomplete({ input: r.input, bindToMap: !0 }), this.placesService = e.createPlacesService({});
|
|
3182
3190
|
}
|
|
3183
3191
|
setSearchListener(e, r) {
|
|
@@ -3195,9 +3203,9 @@ class Ai extends zr {
|
|
|
3195
3203
|
var Di = /* @__PURE__ */ ((i) => (i[i.WORLD = 1] = "WORLD", i[i.STATE = 5] = "STATE", i[i.CITY = 10] = "CITY", i[i.STREET = 15] = "STREET", i[i.BUILDING = 20] = "BUILDING", i))(Di || {});
|
|
3196
3204
|
class Nt {
|
|
3197
3205
|
constructor(t) {
|
|
3198
|
-
|
|
3206
|
+
m(this, "latestInfoWindow");
|
|
3199
3207
|
/** 使用{@link setEventTargetDelegate}初始化 */
|
|
3200
|
-
|
|
3208
|
+
m(this, "delegate", void 0);
|
|
3201
3209
|
this.element = t, process.env.NODE_ENV !== "production" && setTimeout(() => {
|
|
3202
3210
|
this.delegate || console.warn(`${this.constructor.name}继承了AbstractMap, 但未调用setEventTargetDelegate(delegate)`);
|
|
3203
3211
|
});
|
|
@@ -3257,12 +3265,12 @@ function Zi(i) {
|
|
|
3257
3265
|
function Wi(i) {
|
|
3258
3266
|
return Array.isArray(i) ? [] : {};
|
|
3259
3267
|
}
|
|
3260
|
-
function
|
|
3268
|
+
function $e(i, t) {
|
|
3261
3269
|
return t.clone !== !1 && t.isMergeableObject(i) ? _e(Wi(i), i, t) : i;
|
|
3262
3270
|
}
|
|
3263
3271
|
function Hi(i, t, e) {
|
|
3264
3272
|
return i.concat(t).map(function(r) {
|
|
3265
|
-
return
|
|
3273
|
+
return $e(r, e);
|
|
3266
3274
|
});
|
|
3267
3275
|
}
|
|
3268
3276
|
function Vi(i, t) {
|
|
@@ -3292,15 +3300,15 @@ function Fi(i, t) {
|
|
|
3292
3300
|
function Ui(i, t, e) {
|
|
3293
3301
|
var r = {};
|
|
3294
3302
|
return e.isMergeableObject(i) && cr(i).forEach(function(s) {
|
|
3295
|
-
r[s] =
|
|
3303
|
+
r[s] = $e(i[s], e);
|
|
3296
3304
|
}), cr(t).forEach(function(s) {
|
|
3297
|
-
Fi(i, s) || (Nr(i, s) && e.isMergeableObject(t[s]) ? r[s] = Vi(s, e)(i[s], t[s], e) : r[s] =
|
|
3305
|
+
Fi(i, s) || (Nr(i, s) && e.isMergeableObject(t[s]) ? r[s] = Vi(s, e)(i[s], t[s], e) : r[s] = $e(t[s], e));
|
|
3298
3306
|
}), r;
|
|
3299
3307
|
}
|
|
3300
3308
|
function _e(i, t, e) {
|
|
3301
|
-
e = e || {}, e.arrayMerge = e.arrayMerge || Hi, e.isMergeableObject = e.isMergeableObject || Ri, e.cloneUnlessOtherwiseSpecified =
|
|
3309
|
+
e = e || {}, e.arrayMerge = e.arrayMerge || Hi, e.isMergeableObject = e.isMergeableObject || Ri, e.cloneUnlessOtherwiseSpecified = $e;
|
|
3302
3310
|
var r = Array.isArray(t), s = Array.isArray(i), n = r === s;
|
|
3303
|
-
return n ? r ? e.arrayMerge(i, t, e) : Ui(i, t, e) :
|
|
3311
|
+
return n ? r ? e.arrayMerge(i, t, e) : Ui(i, t, e) : $e(t, e);
|
|
3304
3312
|
}
|
|
3305
3313
|
_e.all = function(t, e) {
|
|
3306
3314
|
if (!Array.isArray(t))
|
|
@@ -3333,62 +3341,62 @@ function Zr(i) {
|
|
|
3333
3341
|
var t, e;
|
|
3334
3342
|
return !(dr(i) === !1 || (t = i.constructor, typeof t != "function") || (e = t.prototype, dr(e) === !1) || e.hasOwnProperty("isPrototypeOf") === !1);
|
|
3335
3343
|
}
|
|
3336
|
-
var
|
|
3344
|
+
var le;
|
|
3337
3345
|
((i) => {
|
|
3338
|
-
function t(d,
|
|
3339
|
-
return d.reduce((
|
|
3346
|
+
function t(d, p) {
|
|
3347
|
+
return d.reduce((g, f) => (g[p(f)] = f, g), {});
|
|
3340
3348
|
}
|
|
3341
3349
|
i.fromArray = t;
|
|
3342
3350
|
function e(d) {
|
|
3343
|
-
return d.reduce((
|
|
3351
|
+
return d.reduce((p, g) => (p[g[0]] = g[1], p), {});
|
|
3344
3352
|
}
|
|
3345
3353
|
i.fromEntries = e;
|
|
3346
3354
|
function r(d) {
|
|
3347
|
-
return JSON.stringify(d, (
|
|
3355
|
+
return JSON.stringify(d, (p, g) => typeof g == "object" && Object.getPrototypeOf(g) !== Object.prototype ? g.toString !== Object.prototype.toString ? g.toString() : `[object ${Object.getPrototypeOf(g).constructor.name}]` : g);
|
|
3348
3356
|
}
|
|
3349
3357
|
i.toJsonSafely = r;
|
|
3350
3358
|
function s(d) {
|
|
3351
|
-
Zr(d) && Object.keys(d).forEach((
|
|
3352
|
-
d[
|
|
3359
|
+
Zr(d) && Object.keys(d).forEach((p) => {
|
|
3360
|
+
d[p] === void 0 ? delete d[p] : s(d[p]);
|
|
3353
3361
|
});
|
|
3354
3362
|
}
|
|
3355
3363
|
i.deleteUndefinedPropertyOnPlainObjectDeeply = s;
|
|
3356
|
-
function n(d,
|
|
3357
|
-
let
|
|
3358
|
-
return
|
|
3364
|
+
function n(d, p, g) {
|
|
3365
|
+
let f = d[p];
|
|
3366
|
+
return f === void 0 && (f = g(), d[p] = f), f;
|
|
3359
3367
|
}
|
|
3360
3368
|
i.putIfAbsent = n;
|
|
3361
|
-
function a(d, ...
|
|
3362
|
-
const
|
|
3363
|
-
for (const
|
|
3364
|
-
|
|
3365
|
-
return
|
|
3369
|
+
function a(d, ...p) {
|
|
3370
|
+
const g = ur(p), f = {};
|
|
3371
|
+
for (const T in d)
|
|
3372
|
+
g(T) || (f[T] = d[T]);
|
|
3373
|
+
return f;
|
|
3366
3374
|
}
|
|
3367
3375
|
i.omit = a;
|
|
3368
|
-
function c(d, ...
|
|
3369
|
-
const
|
|
3370
|
-
for (const
|
|
3371
|
-
|
|
3372
|
-
return
|
|
3376
|
+
function c(d, ...p) {
|
|
3377
|
+
const g = ur(p), f = {};
|
|
3378
|
+
for (const T in d)
|
|
3379
|
+
g(T) && (f[T] = d[T]);
|
|
3380
|
+
return f;
|
|
3373
3381
|
}
|
|
3374
3382
|
i.pick = c;
|
|
3375
|
-
function o(d,
|
|
3376
|
-
const
|
|
3377
|
-
let
|
|
3378
|
-
for (const
|
|
3379
|
-
if (
|
|
3383
|
+
function o(d, p) {
|
|
3384
|
+
const g = typeof p == "string" ? p.split(".") : p;
|
|
3385
|
+
let f = d;
|
|
3386
|
+
for (const T of g) {
|
|
3387
|
+
if (f == null)
|
|
3380
3388
|
return;
|
|
3381
|
-
|
|
3389
|
+
f = f[T];
|
|
3382
3390
|
}
|
|
3383
|
-
return
|
|
3391
|
+
return f;
|
|
3384
3392
|
}
|
|
3385
3393
|
i.get = o;
|
|
3386
|
-
function
|
|
3387
|
-
const
|
|
3388
|
-
|
|
3394
|
+
function h(d, p) {
|
|
3395
|
+
const g = typeof p == "string" ? p.split(".") : p, f = o(d, g.slice(0, -1)), T = g[g.length - 1];
|
|
3396
|
+
f != null && delete f[T];
|
|
3389
3397
|
}
|
|
3390
|
-
i.del =
|
|
3391
|
-
})(
|
|
3398
|
+
i.del = h;
|
|
3399
|
+
})(le || (le = {}));
|
|
3392
3400
|
function ur(i) {
|
|
3393
3401
|
if (i.length <= 4)
|
|
3394
3402
|
return i.includes.bind(i);
|
|
@@ -3397,12 +3405,12 @@ function ur(i) {
|
|
|
3397
3405
|
return t.has.bind(t);
|
|
3398
3406
|
}
|
|
3399
3407
|
}
|
|
3400
|
-
|
|
3408
|
+
le.toJsonSafely;
|
|
3401
3409
|
const Xi = ["single", "multi"];
|
|
3402
3410
|
var ee = /* @__PURE__ */ ((i) => (i.auto = "auto", i.none = "none", i.greedy = "greedy", i.cooperative = "cooperative", i))(ee || {}), Ct;
|
|
3403
3411
|
((i) => {
|
|
3404
3412
|
function t(e) {
|
|
3405
|
-
|
|
3413
|
+
le.deleteUndefinedPropertyOnPlainObjectDeeply(e);
|
|
3406
3414
|
const r = { center: O.ZERO, zoom: 5 };
|
|
3407
3415
|
return Gr(r, e || {}, {
|
|
3408
3416
|
isMergeableObject: Zr
|
|
@@ -3412,7 +3420,7 @@ var ee = /* @__PURE__ */ ((i) => (i.auto = "auto", i.none = "none", i.greedy = "
|
|
|
3412
3420
|
})(Ct || (Ct = {}));
|
|
3413
3421
|
class Wr {
|
|
3414
3422
|
constructor(t, e) {
|
|
3415
|
-
|
|
3423
|
+
m(this, "_delegate");
|
|
3416
3424
|
this.innerOverlay = t, this.coordType = e;
|
|
3417
3425
|
}
|
|
3418
3426
|
get delegate() {
|
|
@@ -3447,7 +3455,7 @@ class lt extends Wr {
|
|
|
3447
3455
|
super(t, e), this.map = r;
|
|
3448
3456
|
}
|
|
3449
3457
|
createDelegate() {
|
|
3450
|
-
return new
|
|
3458
|
+
return new Re(this.innerOverlay, this.map);
|
|
3451
3459
|
}
|
|
3452
3460
|
/** 仅限内部使用; 设为private时, 生成的d.ts文件中, 方法返回值会变成any, 故改成了public */
|
|
3453
3461
|
get overlay() {
|
|
@@ -3464,7 +3472,7 @@ class lt extends Wr {
|
|
|
3464
3472
|
return t !== void 0 && (t || this.setVisible(!1)), this;
|
|
3465
3473
|
}
|
|
3466
3474
|
}
|
|
3467
|
-
const
|
|
3475
|
+
const ke = class ke extends lt {
|
|
3468
3476
|
constructor(t, e, r, s) {
|
|
3469
3477
|
super(t, e, r), this.state = s;
|
|
3470
3478
|
}
|
|
@@ -3478,7 +3486,7 @@ const Ae = class Ae extends lt {
|
|
|
3478
3486
|
this.innerOverlay.setStrokeColor(t);
|
|
3479
3487
|
}
|
|
3480
3488
|
setStrokeOpacity(t) {
|
|
3481
|
-
this.innerOverlay.setStrokeOpacity(t +
|
|
3489
|
+
this.innerOverlay.setStrokeOpacity(t + ke.OPACITY_DELTA);
|
|
3482
3490
|
}
|
|
3483
3491
|
setStrokeWeight(t) {
|
|
3484
3492
|
this.innerOverlay.setStrokeWeight(t);
|
|
@@ -3487,7 +3495,7 @@ const Ae = class Ae extends lt {
|
|
|
3487
3495
|
this.innerOverlay.setFillColor(t);
|
|
3488
3496
|
}
|
|
3489
3497
|
setFillOpacity(t) {
|
|
3490
|
-
this.innerOverlay.setFillOpacity(t +
|
|
3498
|
+
this.innerOverlay.setFillOpacity(t + ke.OPACITY_DELTA);
|
|
3491
3499
|
}
|
|
3492
3500
|
};
|
|
3493
3501
|
/**
|
|
@@ -3496,8 +3504,8 @@ const Ae = class Ae extends lt {
|
|
|
3496
3504
|
* - 透明度为0.7和0.8时, 在maintain的发布模式下, polyline的线条会不可见 (原因未知, 在tg-map中无法复现)
|
|
3497
3505
|
* 故统一加个0.001, 规避这些问题...
|
|
3498
3506
|
*/
|
|
3499
|
-
|
|
3500
|
-
let j =
|
|
3507
|
+
m(ke, "OPACITY_DELTA", 1e-3);
|
|
3508
|
+
let j = ke;
|
|
3501
3509
|
class ht extends Gt {
|
|
3502
3510
|
isEditable() {
|
|
3503
3511
|
return this.innerOverlay.getEditable();
|
|
@@ -3524,22 +3532,22 @@ class ht extends Gt {
|
|
|
3524
3532
|
class Zt extends j {
|
|
3525
3533
|
constructor() {
|
|
3526
3534
|
super(...arguments);
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3535
|
+
m(this, "prevCenter");
|
|
3536
|
+
m(this, "prevRadius");
|
|
3537
|
+
m(this, "isDoingSetCenter", !1);
|
|
3538
|
+
m(this, "isDoingSetRadius", !1);
|
|
3539
|
+
m(this, "eventHubDelegate");
|
|
3540
|
+
m(this, "onRadiusChanged", () => {
|
|
3533
3541
|
var r;
|
|
3534
3542
|
const e = this.innerOverlay.getRadius();
|
|
3535
3543
|
this.prevRadius !== e && (this.isDoingSetRadius || (r = this.eventHubDelegate) == null || r.notify({ type: "radius-changed", target: this }), this.prevRadius = e);
|
|
3536
3544
|
});
|
|
3537
|
-
|
|
3545
|
+
m(this, "onCenterChanged", () => {
|
|
3538
3546
|
var r;
|
|
3539
3547
|
const e = this.innerOverlay.getCenter();
|
|
3540
3548
|
this.prevCenter !== e && (this.isDoingSetCenter || (r = this.eventHubDelegate) == null || r.notify({ type: "center-changed", target: this }), this.prevCenter = e);
|
|
3541
3549
|
});
|
|
3542
|
-
|
|
3550
|
+
m(this, "resetEditableTimeoutId");
|
|
3543
3551
|
}
|
|
3544
3552
|
static create(e) {
|
|
3545
3553
|
const r = this.coordType, s = new BMap.Circle(e.center.toBaidu(r), e.radius, {
|
|
@@ -3603,7 +3611,7 @@ class Wt extends ht {
|
|
|
3603
3611
|
this.coordType = this.map.coordType, this.innerOverlay.setCenter(t.toGoogle(this.coordType));
|
|
3604
3612
|
}
|
|
3605
3613
|
getCenter() {
|
|
3606
|
-
return O.fromGoogle(this.innerOverlay.getCenter() ??
|
|
3614
|
+
return O.fromGoogle(this.innerOverlay.getCenter() ?? ae.LATLNG_ZERO, this.coordType);
|
|
3607
3615
|
}
|
|
3608
3616
|
setRadius(t) {
|
|
3609
3617
|
this.innerOverlay.setRadius(t);
|
|
@@ -3621,10 +3629,10 @@ const pr = {
|
|
|
3621
3629
|
return i.lat === t.lat && i.lng === t.lng;
|
|
3622
3630
|
}
|
|
3623
3631
|
};
|
|
3624
|
-
var
|
|
3632
|
+
var oe;
|
|
3625
3633
|
((i) => {
|
|
3626
3634
|
i.ZERO = { x: 0, y: 0 };
|
|
3627
|
-
})(
|
|
3635
|
+
})(oe || (oe = {}));
|
|
3628
3636
|
let gt;
|
|
3629
3637
|
function Ji(i, t, e, r, s, n) {
|
|
3630
3638
|
return gt || (gt = Qi()), new gt(i, t, e, r, s, n);
|
|
@@ -3633,23 +3641,23 @@ function Qi() {
|
|
|
3633
3641
|
Hr();
|
|
3634
3642
|
const i = new BMap.Point(0, 0);
|
|
3635
3643
|
return class extends BMap.OverlayV3 {
|
|
3636
|
-
constructor(r, s = i, n =
|
|
3644
|
+
constructor(r, s = i, n = oe.ZERO, a, c = 654, o = "") {
|
|
3637
3645
|
super();
|
|
3638
3646
|
// 类表达式不能有私有成员, 故改成public
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3647
|
+
m(this, "container");
|
|
3648
|
+
m(this, "border");
|
|
3649
|
+
m(this, "inner");
|
|
3650
|
+
m(this, "map");
|
|
3651
|
+
m(this, "marker");
|
|
3644
3652
|
this.content = r, this.position = s, this.offset = n;
|
|
3645
|
-
const
|
|
3646
|
-
this.container = document.createElement("div"), this.container.className =
|
|
3647
|
-
const d = (
|
|
3648
|
-
this.container.onclick = d, this.container.ondblclick = d, this.container.oncontextmenu = d, this.container.onmousedown = d, this.container.onmousemove = d, this.container.onmousewheel = d, this.border = document.createElement("div"), this.border.className = `${
|
|
3649
|
-
const
|
|
3650
|
-
|
|
3653
|
+
const h = "baidu-info-box-container";
|
|
3654
|
+
this.container = document.createElement("div"), this.container.className = h, this.container.style.position = "absolute";
|
|
3655
|
+
const d = (g) => g.stopPropagation();
|
|
3656
|
+
this.container.onclick = d, this.container.ondblclick = d, this.container.oncontextmenu = d, this.container.onmousedown = d, this.container.onmousemove = d, this.container.onmousewheel = d, this.border = document.createElement("div"), this.border.className = `${h}__border ${o}`, this.inner = document.createElement("div"), this.inner.className = h + "__inner";
|
|
3657
|
+
const p = document.createElement("span");
|
|
3658
|
+
p.className = h + "__close", p.addEventListener("click", () => {
|
|
3651
3659
|
this.close(), this.dispatchEvent({ type: "onclickclose" });
|
|
3652
|
-
}), this.inner.appendChild(r), this.border.appendChild(this.inner), this.border.appendChild(
|
|
3660
|
+
}), this.inner.appendChild(r), this.border.appendChild(this.inner), this.border.appendChild(p), this.container.appendChild(this.border), a && this.setZIndex(a), this.setMaxWidth(c), this.onMarkerPositionChanged = this.onMarkerPositionChanged.bind(this);
|
|
3653
3661
|
}
|
|
3654
3662
|
initialize(r) {
|
|
3655
3663
|
return this.map = r, r.getPanes().floatPane.appendChild(this.container), this.container;
|
|
@@ -3711,7 +3719,7 @@ class Ht {
|
|
|
3711
3719
|
}
|
|
3712
3720
|
class Vt extends Ht {
|
|
3713
3721
|
constructor(t, e, r) {
|
|
3714
|
-
super(new
|
|
3722
|
+
super(new Re(t, e)), this.inner = t, this.map = e, this.state = r;
|
|
3715
3723
|
}
|
|
3716
3724
|
static create(t) {
|
|
3717
3725
|
const e = t.position || O.ZERO, r = new BMap.InfoWindow(t.content, {
|
|
@@ -3741,8 +3749,8 @@ class Vt extends Ht {
|
|
|
3741
3749
|
class jt extends Ht {
|
|
3742
3750
|
constructor(e, r) {
|
|
3743
3751
|
super(new ye(e, r));
|
|
3744
|
-
|
|
3745
|
-
|
|
3752
|
+
m(this, "eventHub", new Tr());
|
|
3753
|
+
m(this, "isOpened", !1);
|
|
3746
3754
|
this.inner = e, this.map = r, e.addListener("closeclick", () => {
|
|
3747
3755
|
this.isOpened = !1, this.eventHub.hasListener("close") && this.eventHub.notify({ type: "close", target: this });
|
|
3748
3756
|
}), e.addListener("map_changed", () => {
|
|
@@ -3790,7 +3798,7 @@ class jt extends Ht {
|
|
|
3790
3798
|
this.isOpened && (this.isOpened = !1, this.inner.close(), this.eventHub.notify({ type: "close", target: this }));
|
|
3791
3799
|
}
|
|
3792
3800
|
getPosition() {
|
|
3793
|
-
return O.fromGoogle(this.inner.getPosition() ??
|
|
3801
|
+
return O.fromGoogle(this.inner.getPosition() ?? ae.LATLNG_ZERO, this.map.coordType);
|
|
3794
3802
|
}
|
|
3795
3803
|
setPosition(e) {
|
|
3796
3804
|
this.inner.setPosition(e.toGoogle(this.map.coordType));
|
|
@@ -3857,7 +3865,7 @@ class Ut extends Ht {
|
|
|
3857
3865
|
this.inner.close();
|
|
3858
3866
|
}
|
|
3859
3867
|
getPosition() {
|
|
3860
|
-
return O.fromGoogle(this.inner.getPosition() ??
|
|
3868
|
+
return O.fromGoogle(this.inner.getPosition() ?? ae.LATLNG_ZERO, this.coordType);
|
|
3861
3869
|
}
|
|
3862
3870
|
setPosition(t) {
|
|
3863
3871
|
this.coordType = this.map.coordType, this.inner.setPosition(t.toGoogle(this.coordType));
|
|
@@ -3905,7 +3913,7 @@ const es = {
|
|
|
3905
3913
|
return t && s.endsWith(t) ? s.slice(0, -t.length) : s;
|
|
3906
3914
|
}
|
|
3907
3915
|
};
|
|
3908
|
-
var
|
|
3916
|
+
var ze = /* @__PURE__ */ ((i) => (i.map = "map", i.overlay = "overlay", i.overlayMouseTarget = "overlayMouseTarget", i.float = "float", i))(ze || {}), Ne;
|
|
3909
3917
|
((i) => {
|
|
3910
3918
|
function t(r, s) {
|
|
3911
3919
|
switch (r) {
|
|
@@ -3937,14 +3945,14 @@ var Ne = /* @__PURE__ */ ((i) => (i.map = "map", i.overlay = "overlay", i.overla
|
|
|
3937
3945
|
}
|
|
3938
3946
|
}
|
|
3939
3947
|
i.toBaidu = e;
|
|
3940
|
-
})(
|
|
3948
|
+
})(Ne || (Ne = {}));
|
|
3941
3949
|
class ts {
|
|
3942
3950
|
constructor(t, e) {
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3951
|
+
m(this, "baidu");
|
|
3952
|
+
m(this, "google");
|
|
3953
|
+
m(this, "projection");
|
|
3954
|
+
m(this, "element", void 0);
|
|
3955
|
+
m(this, "mapPane");
|
|
3948
3956
|
this.map = t, this.mapPane = e.mapPane;
|
|
3949
3957
|
}
|
|
3950
3958
|
create() {
|
|
@@ -3964,7 +3972,7 @@ class ts {
|
|
|
3964
3972
|
initialize(n) {
|
|
3965
3973
|
var o;
|
|
3966
3974
|
const a = t.create(), c = n.getPanes();
|
|
3967
|
-
return (o =
|
|
3975
|
+
return (o = Ne.toBaidu(t.mapPane, c)) == null || o.appendChild(a), a;
|
|
3968
3976
|
}
|
|
3969
3977
|
draw() {
|
|
3970
3978
|
t.draw();
|
|
@@ -3989,7 +3997,7 @@ class ts {
|
|
|
3989
3997
|
class e extends google.maps.OverlayView {
|
|
3990
3998
|
onAdd() {
|
|
3991
3999
|
const s = t.create(), n = this.getPanes() ?? B("onAdd回调中一定会有panes");
|
|
3992
|
-
|
|
4000
|
+
Ne.toGoogle(t.mapPane, n).appendChild(s);
|
|
3993
4001
|
}
|
|
3994
4002
|
draw() {
|
|
3995
4003
|
t.draw();
|
|
@@ -4001,10 +4009,10 @@ class ts {
|
|
|
4001
4009
|
}
|
|
4002
4010
|
this.google = new e(), this.projection = {
|
|
4003
4011
|
fromLatLngToOverlayPoint(r) {
|
|
4004
|
-
return t.google.getProjection().fromLatLngToDivPixel(r.toGoogle(t.map.coordType)) ??
|
|
4012
|
+
return t.google.getProjection().fromLatLngToDivPixel(r.toGoogle(t.map.coordType)) ?? oe.ZERO;
|
|
4005
4013
|
},
|
|
4006
4014
|
fromOverlayPointToLatLng(r) {
|
|
4007
|
-
return O.fromGoogle(t.google.getProjection().fromDivPixelToLatLng(new google.maps.Point(r.x, r.y)) ??
|
|
4015
|
+
return O.fromGoogle(t.google.getProjection().fromDivPixelToLatLng(new google.maps.Point(r.x, r.y)) ?? ae.LATLNG_ZERO, t.map.coordType);
|
|
4008
4016
|
}
|
|
4009
4017
|
};
|
|
4010
4018
|
}
|
|
@@ -4017,9 +4025,9 @@ function rs(i, t, e, r, s) {
|
|
|
4017
4025
|
}
|
|
4018
4026
|
function is() {
|
|
4019
4027
|
return class extends google.maps.OverlayView {
|
|
4020
|
-
constructor(e, r, s, n =
|
|
4028
|
+
constructor(e, r, s, n = ze.overlayMouseTarget, a) {
|
|
4021
4029
|
super();
|
|
4022
|
-
|
|
4030
|
+
m(this, "container");
|
|
4023
4031
|
this.position = r, this.offset = s, this._mapPane = n, this.container = document.createElement("div"), this.container.className = "label-container", this.container.style.position = "absolute", a && this.setZIndex(a), this.container.addEventListener("click", () => {
|
|
4024
4032
|
google.maps.event.trigger(this, "click");
|
|
4025
4033
|
}), this.setElement(e);
|
|
@@ -4033,7 +4041,7 @@ function is() {
|
|
|
4033
4041
|
}
|
|
4034
4042
|
onAdd() {
|
|
4035
4043
|
const e = this.getPanes() ?? B("onAdd回调中一定能够获取panes");
|
|
4036
|
-
|
|
4044
|
+
Ne.toGoogle(this._mapPane, e).appendChild(this.container);
|
|
4037
4045
|
}
|
|
4038
4046
|
draw() {
|
|
4039
4047
|
var e, r;
|
|
@@ -4087,10 +4095,10 @@ var Te;
|
|
|
4087
4095
|
class Yt extends lt {
|
|
4088
4096
|
constructor(e, r, s, n) {
|
|
4089
4097
|
super(e, r, s);
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4098
|
+
m(this, "icon");
|
|
4099
|
+
m(this, "iconAnchor");
|
|
4100
|
+
m(this, "content", void 0);
|
|
4101
|
+
m(this, "contentObserver");
|
|
4094
4102
|
this.setContentInternal(n, !0);
|
|
4095
4103
|
}
|
|
4096
4104
|
static create(e) {
|
|
@@ -4156,24 +4164,24 @@ class Yt extends lt {
|
|
|
4156
4164
|
width: e.style.anchor.width + o.x,
|
|
4157
4165
|
height: e.style.anchor.height + o.y
|
|
4158
4166
|
}, process.env.NODE_ENV !== "production" && setTimeout(() => {
|
|
4159
|
-
var
|
|
4167
|
+
var p, g;
|
|
4160
4168
|
if (me(e.__icon__, `${e}必须是由'SymbolIcon.toBaidu()'创建的`), !e.anchor) {
|
|
4161
4169
|
console.log("BaiduLabelOverlay.attachIcon", "Bmap.Symbol.anchor尚未计算完成");
|
|
4162
4170
|
return;
|
|
4163
4171
|
}
|
|
4164
|
-
const
|
|
4165
|
-
if (o.x !==
|
|
4166
|
-
const
|
|
4167
|
-
(
|
|
4168
|
-
(
|
|
4172
|
+
const h = e.anchor.width - e.style.anchor.width, d = e.anchor.height - e.style.anchor.height;
|
|
4173
|
+
if (o.x !== h || o.y !== d) {
|
|
4174
|
+
const f = [
|
|
4175
|
+
(p = e.__icon__.anchor) == null ? void 0 : p.x,
|
|
4176
|
+
(g = e.__icon__.anchor) == null ? void 0 : g.y,
|
|
4169
4177
|
e.__icon__.rotation,
|
|
4170
4178
|
e.__icon__.scale,
|
|
4171
4179
|
e.__icon__.strokeWeight
|
|
4172
|
-
].map((
|
|
4180
|
+
].map((T) => T ?? "").join(",");
|
|
4173
4181
|
console.warn("BaiduLabelOverlay.attachIcon", e.__icon__, be.trimIndent(
|
|
4174
4182
|
`
|
|
4175
|
-
为了保证Label的位置正确, 请将SymbolIcon(${
|
|
4176
|
-
${JSON.stringify({ x:
|
|
4183
|
+
为了保证Label的位置正确, 请将SymbolIcon(${f})中baiduLabelOffset的值改写成:
|
|
4184
|
+
${JSON.stringify({ x: h, y: d })}
|
|
4177
4185
|
`
|
|
4178
4186
|
));
|
|
4179
4187
|
}
|
|
@@ -4210,7 +4218,7 @@ class qt extends Gt {
|
|
|
4210
4218
|
this.coordType = this.map.coordType, this.innerOverlay.setPosition(t.toGoogle(this.coordType));
|
|
4211
4219
|
}
|
|
4212
4220
|
getOffset() {
|
|
4213
|
-
return this.innerOverlay.getOffset() ??
|
|
4221
|
+
return this.innerOverlay.getOffset() ?? oe.ZERO;
|
|
4214
4222
|
}
|
|
4215
4223
|
setOffset(t) {
|
|
4216
4224
|
this.innerOverlay.setOffset(t);
|
|
@@ -4305,7 +4313,7 @@ var et;
|
|
|
4305
4313
|
}
|
|
4306
4314
|
i.toBaidu = e;
|
|
4307
4315
|
})(et || (et = {}));
|
|
4308
|
-
class
|
|
4316
|
+
class Ge extends lt {
|
|
4309
4317
|
constructor(t, e, r, s) {
|
|
4310
4318
|
super(t, e, r), this.state = s;
|
|
4311
4319
|
}
|
|
@@ -4321,7 +4329,7 @@ class Ze extends lt {
|
|
|
4321
4329
|
}, n = new BMap.Marker(t.position.toBaidu(e, t.normalizePositionForBaidu), s);
|
|
4322
4330
|
n.__create_by_tg__ = !0, t.zIndex !== void 0 && n.setZIndex(t.zIndex);
|
|
4323
4331
|
const a = t.clickable === void 0 ? !0 : t.clickable, c = !!t.draggable;
|
|
4324
|
-
return new
|
|
4332
|
+
return new Ge(n, e, this, { clickable: a, draggable: c, zIndex: t.zIndex, normalize: t.normalizePositionForBaidu }).visibleOptionInternal(t.visible);
|
|
4325
4333
|
}
|
|
4326
4334
|
getPosition() {
|
|
4327
4335
|
return O.fromBaidu(this.innerOverlay.getPosition(), this.coordType);
|
|
@@ -4375,10 +4383,10 @@ class Ze extends lt {
|
|
|
4375
4383
|
class Kt extends Gt {
|
|
4376
4384
|
constructor() {
|
|
4377
4385
|
super(...arguments);
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4386
|
+
m(this, "label");
|
|
4387
|
+
m(this, "labelPositionListener");
|
|
4388
|
+
m(this, "labelVisibleListener");
|
|
4389
|
+
m(this, "labelMapChangedListener");
|
|
4382
4390
|
}
|
|
4383
4391
|
static create(e) {
|
|
4384
4392
|
const r = this.coordType, s = e.icon, n = {
|
|
@@ -4451,10 +4459,10 @@ class Kt extends Gt {
|
|
|
4451
4459
|
class Xt extends j {
|
|
4452
4460
|
constructor() {
|
|
4453
4461
|
super(...arguments);
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4462
|
+
m(this, "eventHubDelegate");
|
|
4463
|
+
m(this, "prevPath");
|
|
4464
|
+
m(this, "isDoingSetPath", !1);
|
|
4465
|
+
m(this, "onLineUpdate", () => {
|
|
4458
4466
|
var r;
|
|
4459
4467
|
const e = this.innerOverlay.getPath();
|
|
4460
4468
|
e !== this.prevPath && (this.isDoingSetPath || (r = this.eventHubDelegate) == null || r.notify({
|
|
@@ -4487,7 +4495,7 @@ class Xt extends j {
|
|
|
4487
4495
|
class Jt extends Xt {
|
|
4488
4496
|
constructor() {
|
|
4489
4497
|
super(...arguments);
|
|
4490
|
-
|
|
4498
|
+
m(this, "pathEditedEventType", "path-edited");
|
|
4491
4499
|
}
|
|
4492
4500
|
static create(e) {
|
|
4493
4501
|
var n, a;
|
|
@@ -4530,8 +4538,8 @@ class Jt extends Xt {
|
|
|
4530
4538
|
class Qt extends ht {
|
|
4531
4539
|
constructor() {
|
|
4532
4540
|
super(...arguments);
|
|
4533
|
-
|
|
4534
|
-
|
|
4541
|
+
m(this, "pathChangedListeners");
|
|
4542
|
+
m(this, "eventHubDelegate");
|
|
4535
4543
|
}
|
|
4536
4544
|
static create(e) {
|
|
4537
4545
|
var n;
|
|
@@ -4579,7 +4587,7 @@ class Qt extends ht {
|
|
|
4579
4587
|
class er extends Xt {
|
|
4580
4588
|
constructor() {
|
|
4581
4589
|
super(...arguments);
|
|
4582
|
-
|
|
4590
|
+
m(this, "pathEditedEventType", "paths-edited");
|
|
4583
4591
|
}
|
|
4584
4592
|
static create(e) {
|
|
4585
4593
|
const r = this.coordType;
|
|
@@ -4605,8 +4613,8 @@ class er extends Xt {
|
|
|
4605
4613
|
class tr extends ht {
|
|
4606
4614
|
constructor() {
|
|
4607
4615
|
super(...arguments);
|
|
4608
|
-
|
|
4609
|
-
|
|
4616
|
+
m(this, "pathChangedListeners");
|
|
4617
|
+
m(this, "eventHubDelegate");
|
|
4610
4618
|
}
|
|
4611
4619
|
static create(e) {
|
|
4612
4620
|
const r = this.coordType, s = new google.maps.Polygon({
|
|
@@ -4659,9 +4667,9 @@ class tr extends ht {
|
|
|
4659
4667
|
class rr extends Xt {
|
|
4660
4668
|
constructor(e, r, s, n) {
|
|
4661
4669
|
super(e, r, s, n);
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4670
|
+
m(this, "pathEditedEventType", "bounds-changed");
|
|
4671
|
+
m(this, "isDoingUpdateRectangle", !1);
|
|
4672
|
+
m(this, "onBoundsChanged", ({ originalEvent: e }) => {
|
|
4665
4673
|
if (this.isDoingUpdateRectangle)
|
|
4666
4674
|
return;
|
|
4667
4675
|
const r = e.prevPath ?? [], s = e.path;
|
|
@@ -4672,9 +4680,9 @@ class rr extends Xt {
|
|
|
4672
4680
|
if (a > r.length) {
|
|
4673
4681
|
for (let o = 0; o < a; o++)
|
|
4674
4682
|
if (r[o] == null || !pr.equals(s[o], r[o])) {
|
|
4675
|
-
const
|
|
4676
|
-
let
|
|
4677
|
-
d.lat ===
|
|
4683
|
+
const h = s[(o - 2 + a) % a], d = s[(o - 1 + a) % a], p = s[o], g = s[(o + 1) % a], f = s[(o + 2) % a];
|
|
4684
|
+
let T;
|
|
4685
|
+
d.lat === g.lat ? T = new BMap.Point(d.lng, p.lat) : d.lng === g.lng ? T = new BMap.Point(p.lng, d.lat) : T = p, n = [h, f, T];
|
|
4678
4686
|
break;
|
|
4679
4687
|
}
|
|
4680
4688
|
} else if (a === r.length) {
|
|
@@ -4732,7 +4740,7 @@ class ir extends ht {
|
|
|
4732
4740
|
return new ir(r, e, this);
|
|
4733
4741
|
}
|
|
4734
4742
|
getBounds() {
|
|
4735
|
-
return X.fromGoogle(this.innerOverlay.getBounds() ??
|
|
4743
|
+
return X.fromGoogle(this.innerOverlay.getBounds() ?? ae.BOUNDS_ZERO, this.coordType);
|
|
4736
4744
|
}
|
|
4737
4745
|
setBounds(t) {
|
|
4738
4746
|
const e = t.toGoogle(this.coordType);
|
|
@@ -4744,28 +4752,28 @@ class ss extends Nt {
|
|
|
4744
4752
|
constructor(e, r) {
|
|
4745
4753
|
var s;
|
|
4746
4754
|
super(e);
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4755
|
+
m(this, "buildInMapTypeId2BIMT");
|
|
4756
|
+
m(this, "baiduMapType2BIMT");
|
|
4757
|
+
m(this, "map");
|
|
4758
|
+
m(this, "createLabel", Yt.create);
|
|
4759
|
+
m(this, "createCircle", Zt.create);
|
|
4760
|
+
m(this, "createPolygon", er.create);
|
|
4761
|
+
m(this, "createPolyline", Jt.create);
|
|
4762
|
+
m(this, "createRectangle", rr.create);
|
|
4763
|
+
m(this, "createInfoWindow", Vt.create);
|
|
4764
|
+
m(this, "createInfoBox", Ft.create);
|
|
4765
|
+
m(this, "createMarker", Ge.create);
|
|
4766
|
+
m(this, "createMapTypeControl", It.create);
|
|
4767
|
+
m(this, "createZoomControl", Rt.create);
|
|
4768
|
+
m(this, "createStreetViewControl", At.create);
|
|
4769
|
+
m(this, "createScaleControl", St.create);
|
|
4762
4770
|
this.buildInMapTypeId2BIMT = V.BUILD_IN_MAP_TYPES.getValueMap(W.prototype.getId), this.baiduMapType2BIMT = V.BUILD_IN_MAP_TYPES.getValueMap(W.prototype.asBaiduMapType), this.map = new BMap.Map(e, {
|
|
4763
4771
|
minZoom: r.minZoom && r.minZoom + de,
|
|
4764
4772
|
maxZoom: r.maxZoom && r.maxZoom + de,
|
|
4765
4773
|
mapType: r.buildInMapTypeId && ((s = this.buildInMapTypeId2BIMT.get(r.buildInMapTypeId)) == null ? void 0 : s.asBaiduMapType()),
|
|
4766
4774
|
enableMapClick: !1
|
|
4767
4775
|
// 关闭底图点击功能
|
|
4768
|
-
}), this.map.centerAndZoom(r.center.toBaidu(this.coordType), r.zoom + de), this.setGestureHandling(r.gestureHandling), r.infoWindowMode === "multi" && console.warn("baidu不支持多个InfoWindow, 可能会出现未知问题"), r.mapStyle && this.map.setMapStyleV2(r.mapStyle.baidu), this.setEventTargetDelegate(new
|
|
4776
|
+
}), this.map.centerAndZoom(r.center.toBaidu(this.coordType), r.zoom + de), this.setGestureHandling(r.gestureHandling), r.infoWindowMode === "multi" && console.warn("baidu不支持多个InfoWindow, 可能会出现未知问题"), r.mapStyle && this.map.setMapStyleV2(r.mapStyle.baidu), this.setEventTargetDelegate(new Re(this.map, this)), this.map.addEventListener("addoverlay", (n) => {
|
|
4769
4777
|
const a = n.target.__info_box__;
|
|
4770
4778
|
a && (console.debug("add:info-box", a), this.map.addOverlay(a));
|
|
4771
4779
|
}), this.map.addEventListener("removeoverlay", (n) => {
|
|
@@ -4892,8 +4900,8 @@ class ss extends Nt {
|
|
|
4892
4900
|
const r = class extends BMap.Control {
|
|
4893
4901
|
constructor() {
|
|
4894
4902
|
super(...arguments);
|
|
4895
|
-
|
|
4896
|
-
|
|
4903
|
+
m(this, "defaultAnchor", U.getBaidu().toValue(e.position));
|
|
4904
|
+
m(this, "defaultOffset", new BMap.Size(0, 0));
|
|
4897
4905
|
}
|
|
4898
4906
|
initialize(n) {
|
|
4899
4907
|
const a = e.onCreateElement();
|
|
@@ -4929,21 +4937,21 @@ class ns extends Nt {
|
|
|
4929
4937
|
constructor(e, r) {
|
|
4930
4938
|
var n, a;
|
|
4931
4939
|
super(e);
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4940
|
+
m(this, "buildInMapTypeId2BIMT");
|
|
4941
|
+
m(this, "googleMapTypeId2BIMT");
|
|
4942
|
+
m(this, "map");
|
|
4943
|
+
m(this, "createLabel", qt.create);
|
|
4944
|
+
m(this, "createCircle", Wt.create);
|
|
4945
|
+
m(this, "createPolygon", tr.create);
|
|
4946
|
+
m(this, "createPolyline", Qt.create);
|
|
4947
|
+
m(this, "createRectangle", ir.create);
|
|
4948
|
+
m(this, "createInfoWindow", jt.create);
|
|
4949
|
+
m(this, "createInfoBox", Ut.create);
|
|
4950
|
+
m(this, "createMarker", Kt.create);
|
|
4951
|
+
m(this, "createMapTypeControl", Tt.create);
|
|
4952
|
+
m(this, "createZoomControl", $t.create);
|
|
4953
|
+
m(this, "createStreetViewControl", Dt.create);
|
|
4954
|
+
m(this, "createScaleControl", kt.create);
|
|
4947
4955
|
this.mapOptions = r, this.buildInMapTypeId2BIMT = V.BUILD_IN_MAP_TYPES.getValueMap(W.prototype.getId), this.googleMapTypeId2BIMT = V.BUILD_IN_MAP_TYPES.getValueMap(W.prototype.getGoogleMapTypeId);
|
|
4948
4956
|
const s = r.buildInMapTypeId && this.buildInMapTypeId2BIMT.get(r.buildInMapTypeId);
|
|
4949
4957
|
this.map = new google.maps.Map(e, {
|
|
@@ -4976,18 +4984,18 @@ class ns extends Nt {
|
|
|
4976
4984
|
const n = r.fromLatLngToPoint(s.getSouthWest()), a = r.fromLatLngToPoint(s.getNorthEast()), c = this.innerMap.getZoom();
|
|
4977
4985
|
if (n == null || a == null || c == null)
|
|
4978
4986
|
return O.ZERO;
|
|
4979
|
-
const o = Math.pow(2, c),
|
|
4980
|
-
return O.fromGoogle(r.fromPointToLatLng(
|
|
4987
|
+
const o = Math.pow(2, c), h = new google.maps.Point(e.x / o + n.x, e.y / o + a.y);
|
|
4988
|
+
return O.fromGoogle(r.fromPointToLatLng(h) ?? ae.LATLNG_ZERO, this.coordType);
|
|
4981
4989
|
}
|
|
4982
4990
|
fromLatLngToContainerPoint(e) {
|
|
4983
4991
|
const r = this.innerMap.getProjection(), s = this.innerMap.getBounds();
|
|
4984
4992
|
if (r == null || s == null)
|
|
4985
|
-
return
|
|
4993
|
+
return oe.ZERO;
|
|
4986
4994
|
const n = r.fromLatLngToPoint(s.getSouthWest()), a = r.fromLatLngToPoint(s.getNorthEast()), c = this.innerMap.getZoom();
|
|
4987
4995
|
if (n == null || a == null || c == null)
|
|
4988
|
-
return
|
|
4989
|
-
const o = Math.pow(2, c),
|
|
4990
|
-
return
|
|
4996
|
+
return oe.ZERO;
|
|
4997
|
+
const o = Math.pow(2, c), h = r.fromLatLngToPoint(e.toGoogle(this.coordType));
|
|
4998
|
+
return h == null ? oe.ZERO : { x: (h.x - n.x) * o, y: (h.y - a.y) * o };
|
|
4991
4999
|
}
|
|
4992
5000
|
setDefaultCursor(e) {
|
|
4993
5001
|
this.innerMap.setOptions({ draggableCursor: e });
|
|
@@ -4999,7 +5007,7 @@ class ns extends Nt {
|
|
|
4999
5007
|
this.map.setOptions({ disableDoubleClickZoom: !e });
|
|
5000
5008
|
}
|
|
5001
5009
|
getCenter() {
|
|
5002
|
-
return O.fromGoogle(this.map.getCenter() ??
|
|
5010
|
+
return O.fromGoogle(this.map.getCenter() ?? ae.LATLNG_ZERO, this.coordType);
|
|
5003
5011
|
}
|
|
5004
5012
|
setCenter(e) {
|
|
5005
5013
|
this.map.setCenter(e.toGoogle(this.coordType));
|
|
@@ -5123,8 +5131,8 @@ class ls extends Nt {
|
|
|
5123
5131
|
constructor(e, r) {
|
|
5124
5132
|
var a;
|
|
5125
5133
|
super(e);
|
|
5126
|
-
|
|
5127
|
-
|
|
5134
|
+
m(this, "map");
|
|
5135
|
+
m(this, "defaultLayers");
|
|
5128
5136
|
this.mapOptions = r;
|
|
5129
5137
|
const s = jr().here;
|
|
5130
5138
|
tt.includes(s.version) || B(`不支持${s.version}, HereMap当前只支持如下版本: ${tt}`);
|
|
@@ -5141,7 +5149,7 @@ class ls extends Nt {
|
|
|
5141
5149
|
return this.map;
|
|
5142
5150
|
}
|
|
5143
5151
|
get coordType() {
|
|
5144
|
-
return
|
|
5152
|
+
return D.wgs84;
|
|
5145
5153
|
}
|
|
5146
5154
|
getCenter() {
|
|
5147
5155
|
return O.fromHere(this.map.getCenter(), this.coordType);
|
|
@@ -5295,11 +5303,11 @@ var q = /* @__PURE__ */ ((i) => (i.google = "google", i.baidu = "baidu", i.here
|
|
|
5295
5303
|
var hs = { VITE_APP_DEV_KEY_BAIDU: "kXOq8Hg9BZbZEWAjXKuzd1oGreynup8h", VITE_APP_DEV_KEY_GOOGLE: "AIzaSyBcyzMel3dYFNcfcr0LOklbBQNpWycyZXo", VITE_APP_DEV_KEY_HERE: "", BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
|
|
5296
5304
|
const cs = {};
|
|
5297
5305
|
function ds(i) {
|
|
5298
|
-
return
|
|
5306
|
+
return le.putIfAbsent(cs, i, () => hi(() => us({ type: i, config: jr()[i] })))();
|
|
5299
5307
|
}
|
|
5300
5308
|
function us({ type: i, config: t }) {
|
|
5301
5309
|
const e = window, r = ps(i);
|
|
5302
|
-
if (
|
|
5310
|
+
if (le.get(e, r))
|
|
5303
5311
|
return Promise.resolve();
|
|
5304
5312
|
switch (i !== q.here && !t.key && B(`请先配置${i}地图的key`), i) {
|
|
5305
5313
|
case q.google:
|
|
@@ -5311,18 +5319,18 @@ function us({ type: i, config: t }) {
|
|
|
5311
5319
|
case q.baidu:
|
|
5312
5320
|
return gr(`https://api.map.baidu.com/api?v=${t.version}&ak=${t.key}`);
|
|
5313
5321
|
case q.here:
|
|
5314
|
-
return
|
|
5322
|
+
return xe(we("core", t.version)).then(() => Promise.all([
|
|
5315
5323
|
// 其他大多数模块都可以同时载入
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
])).catch((s) => (
|
|
5324
|
+
xe(we("service", t.version)),
|
|
5325
|
+
xe(we("mapevents", t.version)),
|
|
5326
|
+
xe(we("clustering", t.version)),
|
|
5327
|
+
xe(we("ui", t.version))
|
|
5328
|
+
])).catch((s) => (le.del(e, r), Promise.reject(s)));
|
|
5321
5329
|
default:
|
|
5322
5330
|
vt(i);
|
|
5323
5331
|
}
|
|
5324
5332
|
}
|
|
5325
|
-
function
|
|
5333
|
+
function we(i, t = tt[0]) {
|
|
5326
5334
|
return `https://js.api.here.com/v3/${t}/mapsjs-${i}.js`;
|
|
5327
5335
|
}
|
|
5328
5336
|
function ps(i) {
|
|
@@ -5344,7 +5352,7 @@ function gr(i, t = "callback") {
|
|
|
5344
5352
|
n.src = `${i}&${t}=${s}`, n.onerror = r, document.body.appendChild(n);
|
|
5345
5353
|
});
|
|
5346
5354
|
}
|
|
5347
|
-
function
|
|
5355
|
+
function xe(i) {
|
|
5348
5356
|
return new Promise((t, e) => {
|
|
5349
5357
|
const r = document.createElement("script");
|
|
5350
5358
|
r.src = i, r.onload = t, r.onerror = e, document.body.appendChild(r);
|
|
@@ -5364,13 +5372,13 @@ function ms(i, t) {
|
|
|
5364
5372
|
validator: (e) => i.includes(e)
|
|
5365
5373
|
};
|
|
5366
5374
|
}
|
|
5367
|
-
function
|
|
5375
|
+
function N(i) {
|
|
5368
5376
|
return {
|
|
5369
5377
|
type: i,
|
|
5370
5378
|
required: !0
|
|
5371
5379
|
};
|
|
5372
5380
|
}
|
|
5373
|
-
function
|
|
5381
|
+
function b(i, t) {
|
|
5374
5382
|
return {
|
|
5375
5383
|
type: i,
|
|
5376
5384
|
default: t
|
|
@@ -5393,17 +5401,17 @@ function bn(i) {
|
|
|
5393
5401
|
};
|
|
5394
5402
|
}), t;
|
|
5395
5403
|
}
|
|
5396
|
-
const
|
|
5404
|
+
const Ee = {
|
|
5397
5405
|
enumerable: !0,
|
|
5398
5406
|
configurable: !0,
|
|
5399
|
-
get:
|
|
5400
|
-
set:
|
|
5407
|
+
get: De,
|
|
5408
|
+
set: De
|
|
5401
5409
|
};
|
|
5402
5410
|
function fs(i) {
|
|
5403
5411
|
return Object.keys(i).forEach((t) => {
|
|
5404
5412
|
const e = i[t];
|
|
5405
5413
|
let r = !1;
|
|
5406
|
-
typeof e == "function" ? (
|
|
5414
|
+
typeof e == "function" ? (Ee.get = e, Ee.set = De, r = !0) : typeof e == "object" && typeof e.get == "function" && (Ee.get = e.get, Ee.set = e.set, r = !0), r && (i[t] = Object.defineProperty(i, t, Ee));
|
|
5407
5415
|
}), i;
|
|
5408
5416
|
}
|
|
5409
5417
|
function Tn(i) {
|
|
@@ -5446,10 +5454,10 @@ function vs(i, t) {
|
|
|
5446
5454
|
listenerProps: s
|
|
5447
5455
|
};
|
|
5448
5456
|
}
|
|
5449
|
-
function
|
|
5457
|
+
function ie(i, t) {
|
|
5450
5458
|
return fr(() => vs(i, t));
|
|
5451
5459
|
}
|
|
5452
|
-
function
|
|
5460
|
+
function k() {
|
|
5453
5461
|
return Function;
|
|
5454
5462
|
}
|
|
5455
5463
|
const Cn = () => {
|
|
@@ -5461,17 +5469,17 @@ const Cn = () => {
|
|
|
5461
5469
|
((s && s.type) !== i || Date.now() - (t ?? 0) > 1e3) && e(s);
|
|
5462
5470
|
}
|
|
5463
5471
|
return { eventLog: e, eventLogLess: r };
|
|
5464
|
-
}, sr = "$map",
|
|
5472
|
+
}, sr = "$map", Ze = "onCreate", We = "onDestroy", $ = P({
|
|
5465
5473
|
inject: [sr],
|
|
5466
5474
|
mounted() {
|
|
5467
|
-
Ue(this,
|
|
5475
|
+
Ue(this, Ze);
|
|
5468
5476
|
},
|
|
5469
5477
|
beforeUnmount() {
|
|
5470
|
-
Ue(this,
|
|
5478
|
+
Ue(this, We);
|
|
5471
5479
|
},
|
|
5472
5480
|
methods: {
|
|
5473
5481
|
recreate() {
|
|
5474
|
-
Ue(this,
|
|
5482
|
+
Ue(this, We), Ue(this, Ze);
|
|
5475
5483
|
}
|
|
5476
5484
|
},
|
|
5477
5485
|
render() {
|
|
@@ -5496,51 +5504,51 @@ const Cn = () => {
|
|
|
5496
5504
|
* - :last-center.sync="center": 获取tg-map销毁时的最后的center的值, 使用这种方式可以做到type切换时保留中心点位置
|
|
5497
5505
|
* @see AbstractMapEventMap.center-changed
|
|
5498
5506
|
* */
|
|
5499
|
-
center:
|
|
5507
|
+
center: N(O),
|
|
5500
5508
|
/**
|
|
5501
5509
|
* 同步center的延时
|
|
5502
5510
|
* @default 300
|
|
5503
5511
|
* @see center
|
|
5504
5512
|
*/
|
|
5505
|
-
centerSyncDelay:
|
|
5513
|
+
centerSyncDelay: b(Number, 300),
|
|
5506
5514
|
/**
|
|
5507
5515
|
* 仅用来获取center的值, 需要设置center的值请使用`center`属性
|
|
5508
5516
|
* @see center
|
|
5509
5517
|
* */
|
|
5510
|
-
currentCenter:
|
|
5518
|
+
currentCenter: b(O),
|
|
5511
5519
|
/**
|
|
5512
5520
|
* 仅用于获取tg-map销毁时的最后的center的值
|
|
5513
5521
|
* @see center
|
|
5514
5522
|
*/
|
|
5515
|
-
lastCenter:
|
|
5516
|
-
zoom:
|
|
5523
|
+
lastCenter: b(O),
|
|
5524
|
+
zoom: N(Number),
|
|
5517
5525
|
/**
|
|
5518
5526
|
* 该属性不会响应式更新, 要让它立即生效, 请参考{@link file://./../views/map/InfoDemo.vue#L3}
|
|
5519
5527
|
* @see MapOptions.infoWindowMode
|
|
5520
5528
|
*/
|
|
5521
5529
|
infoWindowMode: ms(Xi),
|
|
5522
5530
|
gestureHandling: F(ee),
|
|
5523
|
-
minZoom:
|
|
5524
|
-
maxZoom:
|
|
5525
|
-
mapStyle:
|
|
5531
|
+
minZoom: b(Number),
|
|
5532
|
+
maxZoom: b(Number),
|
|
5533
|
+
mapStyle: b(Object),
|
|
5526
5534
|
mapTypeId: F(Mr),
|
|
5527
5535
|
/** 地图类型对象, 优先级比mapTypeId高 */
|
|
5528
|
-
mapType:
|
|
5529
|
-
hideLogo:
|
|
5530
|
-
onLoad:
|
|
5531
|
-
"onUpdate:center":
|
|
5532
|
-
"onUpdate:current-center":
|
|
5533
|
-
"onUpdate:last-center":
|
|
5534
|
-
"onUpdate:map-type":
|
|
5535
|
-
"onUpdate:map-type-id":
|
|
5536
|
-
"onUpdate:zoom":
|
|
5537
|
-
onError:
|
|
5536
|
+
mapType: b(Object),
|
|
5537
|
+
hideLogo: b(Boolean),
|
|
5538
|
+
onLoad: k(),
|
|
5539
|
+
"onUpdate:center": k(),
|
|
5540
|
+
"onUpdate:current-center": k(),
|
|
5541
|
+
"onUpdate:last-center": k(),
|
|
5542
|
+
"onUpdate:map-type": k(),
|
|
5543
|
+
"onUpdate:map-type-id": k(),
|
|
5544
|
+
"onUpdate:zoom": k(),
|
|
5545
|
+
onError: k()
|
|
5538
5546
|
},
|
|
5539
5547
|
/** 声明事件的类型信息, 详见: {@link splitAttrs} */
|
|
5540
5548
|
emits: void 0,
|
|
5541
5549
|
setup(i, { attrs: t }) {
|
|
5542
5550
|
return {
|
|
5543
|
-
attrs:
|
|
5551
|
+
attrs: ie(t, i),
|
|
5544
5552
|
centerSyncTimeoutId: void 0
|
|
5545
5553
|
};
|
|
5546
5554
|
},
|
|
@@ -5552,7 +5560,7 @@ const Cn = () => {
|
|
|
5552
5560
|
},
|
|
5553
5561
|
computed: {
|
|
5554
5562
|
propsJson() {
|
|
5555
|
-
return
|
|
5563
|
+
return le.toJsonSafely(this.$props);
|
|
5556
5564
|
}
|
|
5557
5565
|
},
|
|
5558
5566
|
watch: {
|
|
@@ -5608,12 +5616,12 @@ const Cn = () => {
|
|
|
5608
5616
|
buildInMapTypeId: this.mapTypeId
|
|
5609
5617
|
}
|
|
5610
5618
|
);
|
|
5611
|
-
if (this.map = Kr(t), this.mapType && t.setMapType(this.mapType), "ready" in this.attrs.listeners && console.error("地图载入完成的事件已经从ready改为了load, 请手动修改"),
|
|
5619
|
+
if (this.map = Kr(t), this.mapType && t.setMapType(this.mapType), "ready" in this.attrs.listeners && console.error("地图载入完成的事件已经从ready改为了load, 请手动修改"), re(
|
|
5612
5620
|
this.attrs.listeners,
|
|
5613
5621
|
t,
|
|
5614
5622
|
/* excludes: */
|
|
5615
5623
|
["load"]
|
|
5616
|
-
), this.$emit("load", t),
|
|
5624
|
+
), this.$emit("load", t), Ae([
|
|
5617
5625
|
() => this.zoom,
|
|
5618
5626
|
() => this.center
|
|
5619
5627
|
//
|
|
@@ -5640,14 +5648,14 @@ const Cn = () => {
|
|
|
5640
5648
|
this.isDestroyed = !0, this.map && ("update:last-center" in this.attrs.listenerProps && this.$emit("update:last-center", this.map.getCenter()), "update:center" in this.attrs.listenerProps && (clearTimeout(this.centerSyncTimeoutId), this.$emit("update:center", this.map.getCenter())));
|
|
5641
5649
|
},
|
|
5642
5650
|
methods: {}
|
|
5643
|
-
}),
|
|
5651
|
+
}), se = (i, t) => {
|
|
5644
5652
|
const e = i.__vccOpts || i;
|
|
5645
5653
|
for (const [r, s] of t)
|
|
5646
5654
|
e[r] = s;
|
|
5647
5655
|
return e;
|
|
5648
5656
|
};
|
|
5649
5657
|
function _s(i, t, e, r, s, n) {
|
|
5650
|
-
return
|
|
5658
|
+
return he(), ce("div", He({ class: "tg-map" }, i.attrs.binds), [
|
|
5651
5659
|
Xr("div", {
|
|
5652
5660
|
ref: "map",
|
|
5653
5661
|
class: it({
|
|
@@ -5660,7 +5668,7 @@ function _s(i, t, e, r, s, n) {
|
|
|
5660
5668
|
K(i.$slots, "overlay")
|
|
5661
5669
|
], 16);
|
|
5662
5670
|
}
|
|
5663
|
-
const Ve = /* @__PURE__ */
|
|
5671
|
+
const Ve = /* @__PURE__ */ se(ys, [["render", _s]]);
|
|
5664
5672
|
function bs(i) {
|
|
5665
5673
|
if (i == null)
|
|
5666
5674
|
return;
|
|
@@ -5702,18 +5710,18 @@ const Ts = P({
|
|
|
5702
5710
|
}
|
|
5703
5711
|
});
|
|
5704
5712
|
function Ms(i, t, e, r, s, n) {
|
|
5705
|
-
return
|
|
5713
|
+
return he(), ce("div", {
|
|
5706
5714
|
class: it(i.$options.name),
|
|
5707
5715
|
style: Jr({ left: i.dimen(i.left), top: i.dimen(i.topValue), right: i.dimen(i.right), bottom: i.dimen(i.bottom) })
|
|
5708
5716
|
}, [
|
|
5709
5717
|
K(i.$slots, "default")
|
|
5710
5718
|
], 6);
|
|
5711
5719
|
}
|
|
5712
|
-
const Os = /* @__PURE__ */
|
|
5720
|
+
const Os = /* @__PURE__ */ se(Ts, [["render", Ms]]), Cs = P({
|
|
5713
5721
|
name: "tg-custom-control",
|
|
5714
5722
|
mixins: [$],
|
|
5715
5723
|
props: {
|
|
5716
|
-
position: F(
|
|
5724
|
+
position: F(A, A.RIGHT_BOTTOM)
|
|
5717
5725
|
},
|
|
5718
5726
|
setup() {
|
|
5719
5727
|
return {
|
|
@@ -5739,19 +5747,19 @@ const Os = /* @__PURE__ */ oe(Ts, [["render", Ms]]), Cs = P({
|
|
|
5739
5747
|
}
|
|
5740
5748
|
});
|
|
5741
5749
|
function ws(i, t, e, r, s, n) {
|
|
5742
|
-
return
|
|
5750
|
+
return he(), ce("div", {
|
|
5743
5751
|
class: it(i.$options.name)
|
|
5744
5752
|
}, [
|
|
5745
5753
|
K(i.$slots, "default")
|
|
5746
5754
|
], 2);
|
|
5747
5755
|
}
|
|
5748
|
-
const xs = /* @__PURE__ */
|
|
5756
|
+
const xs = /* @__PURE__ */ se(Cs, [["render", ws]]), Es = P({
|
|
5749
5757
|
name: "tg-map-type-control",
|
|
5750
5758
|
mixins: [$],
|
|
5751
5759
|
props: {
|
|
5752
|
-
position: F(
|
|
5760
|
+
position: F(A, A.TOP_LEFT),
|
|
5753
5761
|
type: F(Or),
|
|
5754
|
-
mapTypes:
|
|
5762
|
+
mapTypes: b(Array)
|
|
5755
5763
|
},
|
|
5756
5764
|
setup() {
|
|
5757
5765
|
return {
|
|
@@ -5782,7 +5790,7 @@ const xs = /* @__PURE__ */ oe(Cs, [["render", ws]]), Es = P({
|
|
|
5782
5790
|
name: "tg-scale-control",
|
|
5783
5791
|
mixins: [$],
|
|
5784
5792
|
props: {
|
|
5785
|
-
position: F(
|
|
5793
|
+
position: F(A, A.BOTTOM_RIGHT)
|
|
5786
5794
|
},
|
|
5787
5795
|
setup() {
|
|
5788
5796
|
return {
|
|
@@ -5821,12 +5829,12 @@ function nr() {
|
|
|
5821
5829
|
return i.value ?? B("map尚未初始化");
|
|
5822
5830
|
},
|
|
5823
5831
|
/** 地图元素创建回调 */
|
|
5824
|
-
[
|
|
5825
|
-
ti(r), t && B(`${
|
|
5832
|
+
[Ze](r) {
|
|
5833
|
+
ti(r), t && B(`${Ze}只能调用一次`), t = r;
|
|
5826
5834
|
},
|
|
5827
5835
|
/** 地图元素销毁回调 */
|
|
5828
|
-
[
|
|
5829
|
-
ri(r), e && B(`${
|
|
5836
|
+
[We](r) {
|
|
5837
|
+
ri(r), e && B(`${We}只能调用一次`), e = r;
|
|
5830
5838
|
},
|
|
5831
5839
|
/** 重新创建地图元素 */
|
|
5832
5840
|
recreate() {
|
|
@@ -5837,7 +5845,7 @@ function nr() {
|
|
|
5837
5845
|
const Ls = P({
|
|
5838
5846
|
name: "tg-street-view-control",
|
|
5839
5847
|
props: {
|
|
5840
|
-
position: F(
|
|
5848
|
+
position: F(A, A.RIGHT_BOTTOM)
|
|
5841
5849
|
},
|
|
5842
5850
|
setup(i) {
|
|
5843
5851
|
let t = void 0;
|
|
@@ -5846,14 +5854,14 @@ const Ls = P({
|
|
|
5846
5854
|
t = e.createStreetViewControl(i), e.addControl(t);
|
|
5847
5855
|
}), s(() => {
|
|
5848
5856
|
e.removeControl(t);
|
|
5849
|
-
}),
|
|
5857
|
+
}), Ae(() => i.position, (n) => {
|
|
5850
5858
|
t.setPosition(n);
|
|
5851
5859
|
}), ct;
|
|
5852
5860
|
}
|
|
5853
5861
|
}), Bs = P({
|
|
5854
5862
|
name: "tg-zoom-control",
|
|
5855
5863
|
props: {
|
|
5856
|
-
position: F(
|
|
5864
|
+
position: F(A, A.RIGHT_BOTTOM)
|
|
5857
5865
|
},
|
|
5858
5866
|
setup(i) {
|
|
5859
5867
|
let t = void 0;
|
|
@@ -5862,18 +5870,18 @@ const Ls = P({
|
|
|
5862
5870
|
t = e.createZoomControl(i), e.addControl(t);
|
|
5863
5871
|
}), s(() => {
|
|
5864
5872
|
e.removeControl(t);
|
|
5865
|
-
}),
|
|
5873
|
+
}), Ae(() => i.position, (n) => {
|
|
5866
5874
|
t.setPosition(n);
|
|
5867
5875
|
}), ct;
|
|
5868
5876
|
}
|
|
5869
5877
|
}), Is = P({
|
|
5870
5878
|
name: "tg-heatmap",
|
|
5871
5879
|
props: {
|
|
5872
|
-
maxIntensity:
|
|
5873
|
-
gradient:
|
|
5874
|
-
opacity:
|
|
5875
|
-
radius:
|
|
5876
|
-
data:
|
|
5880
|
+
maxIntensity: b(Number),
|
|
5881
|
+
gradient: b(Object),
|
|
5882
|
+
opacity: b(Number),
|
|
5883
|
+
radius: b(Number),
|
|
5884
|
+
data: N(Array)
|
|
5877
5885
|
},
|
|
5878
5886
|
setup(i) {
|
|
5879
5887
|
const { map: t, onCreate: e, onDestroy: r } = nr();
|
|
@@ -5882,7 +5890,7 @@ const Ls = P({
|
|
|
5882
5890
|
s = t.createHeatmap(i);
|
|
5883
5891
|
}), r(() => {
|
|
5884
5892
|
s.remove();
|
|
5885
|
-
}),
|
|
5893
|
+
}), Ae(() => i.data, (n) => s.setData(n)), Ae(
|
|
5886
5894
|
[() => i.maxIntensity, () => i.gradient, () => i.opacity, () => i.radius],
|
|
5887
5895
|
() => s.setOptions(i)
|
|
5888
5896
|
), ct;
|
|
@@ -5892,13 +5900,13 @@ const Ls = P({
|
|
|
5892
5900
|
mixins: [$],
|
|
5893
5901
|
// markers从this.$children中读取, 故需要省略(Omit)
|
|
5894
5902
|
props: {
|
|
5895
|
-
gridSize:
|
|
5896
|
-
maxZoom:
|
|
5897
|
-
minClusterSize:
|
|
5898
|
-
averageCenter:
|
|
5899
|
-
styles:
|
|
5900
|
-
stylesIndexCalculator:
|
|
5901
|
-
zIndex:
|
|
5903
|
+
gridSize: b(Number),
|
|
5904
|
+
maxZoom: b(Number),
|
|
5905
|
+
minClusterSize: b(Number),
|
|
5906
|
+
averageCenter: b(Boolean),
|
|
5907
|
+
styles: b(Array),
|
|
5908
|
+
stylesIndexCalculator: b(Function),
|
|
5909
|
+
zIndex: b(Number)
|
|
5902
5910
|
},
|
|
5903
5911
|
setup() {
|
|
5904
5912
|
return {
|
|
@@ -5952,13 +5960,13 @@ const Ls = P({
|
|
|
5952
5960
|
}
|
|
5953
5961
|
});
|
|
5954
5962
|
function ks(i, t, e, r, s, n) {
|
|
5955
|
-
return
|
|
5963
|
+
return he(), ce("div", {
|
|
5956
5964
|
class: it(i.$options.name)
|
|
5957
5965
|
}, [
|
|
5958
5966
|
K(i.$slots, "default")
|
|
5959
5967
|
], 2);
|
|
5960
5968
|
}
|
|
5961
|
-
const Ur = /* @__PURE__ */
|
|
5969
|
+
const Ur = /* @__PURE__ */ se(Ss, [["render", ks]]), As = P({
|
|
5962
5970
|
name: "tg-traffic-layer",
|
|
5963
5971
|
mixins: [$],
|
|
5964
5972
|
// 请直接使用v-if来控制它的显隐
|
|
@@ -5981,23 +5989,23 @@ const Ur = /* @__PURE__ */ oe(Ss, [["render", ks]]), As = P({
|
|
|
5981
5989
|
mixins: [$],
|
|
5982
5990
|
inheritAttrs: !1,
|
|
5983
5991
|
props: {
|
|
5984
|
-
center:
|
|
5985
|
-
radius:
|
|
5986
|
-
clickable:
|
|
5987
|
-
editable:
|
|
5988
|
-
strokeColor:
|
|
5989
|
-
strokeOpacity:
|
|
5990
|
-
strokeWeight:
|
|
5991
|
-
visible:
|
|
5992
|
-
fillColor:
|
|
5993
|
-
fillOpacity:
|
|
5994
|
-
"onUpdate:center":
|
|
5995
|
-
"onUpdate:radius":
|
|
5992
|
+
center: N(O),
|
|
5993
|
+
radius: N(Number),
|
|
5994
|
+
clickable: b(Boolean),
|
|
5995
|
+
editable: b(Boolean),
|
|
5996
|
+
strokeColor: b(String),
|
|
5997
|
+
strokeOpacity: b(Number),
|
|
5998
|
+
strokeWeight: b(Number),
|
|
5999
|
+
visible: b(Boolean),
|
|
6000
|
+
fillColor: b(String),
|
|
6001
|
+
fillOpacity: b(Number),
|
|
6002
|
+
"onUpdate:center": k(),
|
|
6003
|
+
"onUpdate:radius": k()
|
|
5996
6004
|
},
|
|
5997
6005
|
emits: void 0,
|
|
5998
6006
|
setup(i, { attrs: t }) {
|
|
5999
6007
|
return {
|
|
6000
|
-
attrs:
|
|
6008
|
+
attrs: ie(t, i),
|
|
6001
6009
|
overlay: void 0,
|
|
6002
6010
|
emittedRadius: void 0,
|
|
6003
6011
|
emittedCenter: void 0
|
|
@@ -6046,7 +6054,7 @@ const Ur = /* @__PURE__ */ oe(Ss, [["render", ks]]), As = P({
|
|
|
6046
6054
|
}
|
|
6047
6055
|
},
|
|
6048
6056
|
onCreate() {
|
|
6049
|
-
this.overlay = this.$map.createCircle(this), this.$map.addOverlay(this.overlay),
|
|
6057
|
+
this.overlay = this.$map.createCircle(this), this.$map.addOverlay(this.overlay), re(this.attrs.listeners, this.overlay), "update:center" in this.attrs.listenerProps && this.overlay.addEventListener("center-changed", () => {
|
|
6050
6058
|
this.$emit("update:center", this.emittedCenter = this.overlay.getCenter());
|
|
6051
6059
|
}), "update:radius" in this.attrs.listenerProps && this.overlay.addEventListener("radius-changed", () => {
|
|
6052
6060
|
this.$emit("update:radius", this.emittedRadius = this.overlay.getRadius());
|
|
@@ -6075,8 +6083,8 @@ const $s = P({
|
|
|
6075
6083
|
name: "tg-element-overlay",
|
|
6076
6084
|
mixins: [$],
|
|
6077
6085
|
props: {
|
|
6078
|
-
mapPane: F(
|
|
6079
|
-
position:
|
|
6086
|
+
mapPane: F(ze, ze.overlayMouseTarget),
|
|
6087
|
+
position: N(O)
|
|
6080
6088
|
},
|
|
6081
6089
|
setup() {
|
|
6082
6090
|
return {
|
|
@@ -6104,38 +6112,38 @@ const $s = P({
|
|
|
6104
6112
|
}
|
|
6105
6113
|
});
|
|
6106
6114
|
function zs(i, t, e, r, s, n) {
|
|
6107
|
-
return
|
|
6115
|
+
return he(), ce("div", He({
|
|
6108
6116
|
class: i.$options.name
|
|
6109
6117
|
}, i.$attrs), [
|
|
6110
6118
|
K(i.$slots, "default")
|
|
6111
6119
|
], 16);
|
|
6112
6120
|
}
|
|
6113
|
-
const Ns = /* @__PURE__ */
|
|
6121
|
+
const Ns = /* @__PURE__ */ se($s, [["render", zs]]), Gs = P({
|
|
6114
6122
|
name: "tg-marker",
|
|
6115
6123
|
mixins: [$],
|
|
6116
6124
|
inheritAttrs: !1,
|
|
6117
6125
|
props: {
|
|
6118
|
-
position:
|
|
6119
|
-
title:
|
|
6120
|
-
icon:
|
|
6121
|
-
clickable:
|
|
6122
|
-
draggable:
|
|
6123
|
-
crossOnDrag:
|
|
6124
|
-
cursor:
|
|
6125
|
-
zIndex:
|
|
6126
|
-
visible:
|
|
6127
|
-
normalizePositionForBaidu:
|
|
6126
|
+
position: N(O),
|
|
6127
|
+
title: b(String),
|
|
6128
|
+
icon: b(Object),
|
|
6129
|
+
clickable: b(Boolean),
|
|
6130
|
+
draggable: b(Boolean),
|
|
6131
|
+
crossOnDrag: b(Boolean),
|
|
6132
|
+
cursor: b(String),
|
|
6133
|
+
zIndex: b(Number),
|
|
6134
|
+
visible: b(Boolean),
|
|
6135
|
+
normalizePositionForBaidu: b(Boolean),
|
|
6128
6136
|
/**
|
|
6129
6137
|
* 是否自动添加到TgMarkerClusterer中去
|
|
6130
6138
|
* @default true
|
|
6131
6139
|
*/
|
|
6132
|
-
autoAddToClusterer:
|
|
6133
|
-
"onUpdate:position":
|
|
6140
|
+
autoAddToClusterer: b(Boolean, !0),
|
|
6141
|
+
"onUpdate:position": k()
|
|
6134
6142
|
},
|
|
6135
6143
|
emits: void 0,
|
|
6136
6144
|
setup(i, { attrs: t }) {
|
|
6137
6145
|
return {
|
|
6138
|
-
attrs:
|
|
6146
|
+
attrs: ie(t, i),
|
|
6139
6147
|
marker: void 0,
|
|
6140
6148
|
label: yt(),
|
|
6141
6149
|
info: yt(),
|
|
@@ -6159,7 +6167,7 @@ const Ns = /* @__PURE__ */ oe($s, [["render", zs]]), Gs = P({
|
|
|
6159
6167
|
i ? this.marker.setIcon(i) : this.recreate();
|
|
6160
6168
|
},
|
|
6161
6169
|
clickable(i) {
|
|
6162
|
-
this.marker instanceof
|
|
6170
|
+
this.marker instanceof Ge ? this.recreate() : this.marker.setClickable(i);
|
|
6163
6171
|
},
|
|
6164
6172
|
draggable(i) {
|
|
6165
6173
|
this.marker.setDraggable(i);
|
|
@@ -6171,7 +6179,7 @@ const Ns = /* @__PURE__ */ oe($s, [["render", zs]]), Gs = P({
|
|
|
6171
6179
|
this.recreate();
|
|
6172
6180
|
},
|
|
6173
6181
|
zIndex(i) {
|
|
6174
|
-
this.marker instanceof
|
|
6182
|
+
this.marker instanceof Ge ? this.recreate() : this.marker.setZIndex(i);
|
|
6175
6183
|
},
|
|
6176
6184
|
visible(i) {
|
|
6177
6185
|
this.marker.setVisible(i);
|
|
@@ -6184,7 +6192,7 @@ const Ns = /* @__PURE__ */ oe($s, [["render", zs]]), Gs = P({
|
|
|
6184
6192
|
}
|
|
6185
6193
|
},
|
|
6186
6194
|
onCreate() {
|
|
6187
|
-
this.marker = this.$map.createMarker(this), this.label && this.marker.setLabel(this.label.overlay), this.$clusterer() && this.autoAddToClusterer ? this.$clusterer().onAddMarker(this.marker) : this.$map.addOverlay(this.marker), this.autoAddToClustererWhenCreate = this.autoAddToClusterer, this.info && this.info.show && this.info.overlay.open(this.marker),
|
|
6195
|
+
this.marker = this.$map.createMarker(this), this.label && this.marker.setLabel(this.label.overlay), this.$clusterer() && this.autoAddToClusterer ? this.$clusterer().onAddMarker(this.marker) : this.$map.addOverlay(this.marker), this.autoAddToClustererWhenCreate = this.autoAddToClusterer, this.info && this.info.show && this.info.overlay.open(this.marker), re(this.attrs.listeners, this.marker), "update:position" in this.attrs.listenerProps && this.marker.addEventListener("dragend", (i) => {
|
|
6188
6196
|
this.$emit("update:position", this.emittedPosition = i.position);
|
|
6189
6197
|
});
|
|
6190
6198
|
},
|
|
@@ -6213,29 +6221,25 @@ const Ns = /* @__PURE__ */ oe($s, [["render", zs]]), Gs = P({
|
|
|
6213
6221
|
}
|
|
6214
6222
|
});
|
|
6215
6223
|
function Zs(i, t, e, r, s, n) {
|
|
6216
|
-
return
|
|
6217
|
-
class: i.$options.name
|
|
6218
|
-
}, i.attrs.binds), [
|
|
6219
|
-
K(i.$slots, "default")
|
|
6220
|
-
], 16);
|
|
6224
|
+
return K(i.$slots, "default");
|
|
6221
6225
|
}
|
|
6222
|
-
const dt = /* @__PURE__ */
|
|
6226
|
+
const dt = /* @__PURE__ */ se(Gs, [["render", Zs]]), Ws = P({
|
|
6223
6227
|
name: "tg-info-box",
|
|
6224
6228
|
mixins: [$],
|
|
6225
6229
|
inheritAttrs: !1,
|
|
6226
6230
|
props: {
|
|
6227
|
-
show:
|
|
6228
|
-
position:
|
|
6229
|
-
offset:
|
|
6230
|
-
maxWidth:
|
|
6231
|
-
borderClass:
|
|
6232
|
-
zIndex:
|
|
6233
|
-
"onUpdate:show":
|
|
6231
|
+
show: N(Boolean),
|
|
6232
|
+
position: b(O),
|
|
6233
|
+
offset: b(Object),
|
|
6234
|
+
maxWidth: b(Number),
|
|
6235
|
+
borderClass: b(String),
|
|
6236
|
+
zIndex: b(Number),
|
|
6237
|
+
"onUpdate:show": k()
|
|
6234
6238
|
},
|
|
6235
6239
|
emits: void 0,
|
|
6236
6240
|
setup(i, { attrs: t }) {
|
|
6237
6241
|
return {
|
|
6238
|
-
attrs:
|
|
6242
|
+
attrs: ie(t, i),
|
|
6239
6243
|
overlay: void 0
|
|
6240
6244
|
};
|
|
6241
6245
|
},
|
|
@@ -6262,7 +6266,7 @@ const dt = /* @__PURE__ */ oe(Gs, [["render", Zs]]), Ws = P({
|
|
|
6262
6266
|
onCreate() {
|
|
6263
6267
|
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", () => {
|
|
6264
6268
|
this.$emit("update:show", !1);
|
|
6265
|
-
}),
|
|
6269
|
+
}), re(this.attrs.listeners, this.overlay);
|
|
6266
6270
|
},
|
|
6267
6271
|
onDestroy() {
|
|
6268
6272
|
this.$marker() ? this.$marker().onRemoveInfo(this) : this.overlay.close();
|
|
@@ -6293,28 +6297,28 @@ const dt = /* @__PURE__ */ oe(Gs, [["render", Zs]]), Ws = P({
|
|
|
6293
6297
|
}
|
|
6294
6298
|
});
|
|
6295
6299
|
function Hs(i, t, e, r, s, n) {
|
|
6296
|
-
return
|
|
6300
|
+
return he(), ce("div", He({
|
|
6297
6301
|
class: i.$options.name
|
|
6298
6302
|
}, i.attrs.binds), [
|
|
6299
6303
|
K(i.$slots, "default")
|
|
6300
6304
|
], 16);
|
|
6301
6305
|
}
|
|
6302
|
-
const Vs = /* @__PURE__ */
|
|
6306
|
+
const Vs = /* @__PURE__ */ se(Ws, [["render", Hs]]), js = P({
|
|
6303
6307
|
name: "tg-info-window",
|
|
6304
6308
|
mixins: [$],
|
|
6305
6309
|
inheritAttrs: !1,
|
|
6306
6310
|
props: {
|
|
6307
|
-
show:
|
|
6308
|
-
position:
|
|
6309
|
-
maxWidth:
|
|
6310
|
-
offset:
|
|
6311
|
-
disableAutoPan:
|
|
6312
|
-
"onUpdate:show":
|
|
6311
|
+
show: N(Boolean),
|
|
6312
|
+
position: b(O),
|
|
6313
|
+
maxWidth: b(Number),
|
|
6314
|
+
offset: b(Object),
|
|
6315
|
+
disableAutoPan: b(Boolean),
|
|
6316
|
+
"onUpdate:show": k()
|
|
6313
6317
|
},
|
|
6314
6318
|
emits: void 0,
|
|
6315
6319
|
setup(i, { attrs: t }) {
|
|
6316
6320
|
return {
|
|
6317
|
-
attrs:
|
|
6321
|
+
attrs: ie(t, i),
|
|
6318
6322
|
overlay: void 0
|
|
6319
6323
|
};
|
|
6320
6324
|
},
|
|
@@ -6357,14 +6361,14 @@ const Vs = /* @__PURE__ */ oe(Ws, [["render", Hs]]), js = P({
|
|
|
6357
6361
|
this.$emit("update:show", !0);
|
|
6358
6362
|
}), this.overlay.addEventListener("close", () => {
|
|
6359
6363
|
this.$emit("update:show", !1);
|
|
6360
|
-
}),
|
|
6364
|
+
}), re(this.attrs.listeners, this.overlay);
|
|
6361
6365
|
},
|
|
6362
6366
|
onDestroy() {
|
|
6363
6367
|
this.$marker() ? this.$marker().onRemoveInfo(this) : this.overlay.close();
|
|
6364
6368
|
}
|
|
6365
6369
|
});
|
|
6366
6370
|
function Fs(i, t, e, r, s, n) {
|
|
6367
|
-
return ii((
|
|
6371
|
+
return ii((he(), ce("div", He({
|
|
6368
6372
|
class: i.$options.name
|
|
6369
6373
|
}, i.attrs.binds), [
|
|
6370
6374
|
K(i.$slots, "default")
|
|
@@ -6372,20 +6376,20 @@ function Fs(i, t, e, r, s, n) {
|
|
|
6372
6376
|
[si, i.show]
|
|
6373
6377
|
]);
|
|
6374
6378
|
}
|
|
6375
|
-
const Us = /* @__PURE__ */
|
|
6379
|
+
const Us = /* @__PURE__ */ se(js, [["render", Fs]]), Ys = P({
|
|
6376
6380
|
name: "tg-label",
|
|
6377
6381
|
mixins: [$],
|
|
6378
6382
|
inheritAttrs: !1,
|
|
6379
6383
|
props: {
|
|
6380
|
-
position:
|
|
6381
|
-
offset:
|
|
6382
|
-
zIndex:
|
|
6383
|
-
mapPane: F(
|
|
6384
|
+
position: b(O),
|
|
6385
|
+
offset: b(Object),
|
|
6386
|
+
zIndex: b(Number),
|
|
6387
|
+
mapPane: F(ze)
|
|
6384
6388
|
},
|
|
6385
6389
|
emits: void 0,
|
|
6386
6390
|
setup(i, { attrs: t }) {
|
|
6387
6391
|
return {
|
|
6388
|
-
attrs:
|
|
6392
|
+
attrs: ie(t),
|
|
6389
6393
|
overlay: void 0
|
|
6390
6394
|
};
|
|
6391
6395
|
},
|
|
@@ -6428,39 +6432,39 @@ const Us = /* @__PURE__ */ oe(js, [["render", Fs]]), Ys = P({
|
|
|
6428
6432
|
}
|
|
6429
6433
|
},
|
|
6430
6434
|
onCreate() {
|
|
6431
|
-
this.overlay = this.$map.createLabel(this.getOptions()), this.$marker() ? this.$marker().onAddLabel(this) : this.$map.addOverlay(this.overlay),
|
|
6435
|
+
this.overlay = this.$map.createLabel(this.getOptions()), this.$marker() ? this.$marker().onAddLabel(this) : this.$map.addOverlay(this.overlay), re(this.attrs.listeners, this.overlay);
|
|
6432
6436
|
},
|
|
6433
6437
|
onDestroy() {
|
|
6434
6438
|
this.$marker() ? this.$marker().onRemoveLabel(this) : this.$map.removeOverlay(this.overlay);
|
|
6435
6439
|
}
|
|
6436
6440
|
});
|
|
6437
6441
|
function qs(i, t, e, r, s, n) {
|
|
6438
|
-
return
|
|
6442
|
+
return he(), ce("div", He({
|
|
6439
6443
|
class: i.$options.name
|
|
6440
6444
|
}, i.attrs.binds), [
|
|
6441
6445
|
K(i.$slots, "default")
|
|
6442
6446
|
], 16);
|
|
6443
6447
|
}
|
|
6444
|
-
const Ks = /* @__PURE__ */
|
|
6448
|
+
const Ks = /* @__PURE__ */ se(Ys, [["render", qs]]), Xs = P({
|
|
6445
6449
|
name: "tg-polygon",
|
|
6446
6450
|
mixins: [$],
|
|
6447
6451
|
inheritAttrs: !1,
|
|
6448
6452
|
props: {
|
|
6449
|
-
paths:
|
|
6450
|
-
clickable:
|
|
6451
|
-
editable:
|
|
6452
|
-
strokeColor:
|
|
6453
|
-
strokeOpacity:
|
|
6454
|
-
strokeWeight:
|
|
6455
|
-
visible:
|
|
6456
|
-
fillColor:
|
|
6457
|
-
fillOpacity:
|
|
6458
|
-
"onUpdate:paths":
|
|
6453
|
+
paths: N(Array),
|
|
6454
|
+
clickable: b(Boolean),
|
|
6455
|
+
editable: b(Boolean),
|
|
6456
|
+
strokeColor: b(String),
|
|
6457
|
+
strokeOpacity: b(Number),
|
|
6458
|
+
strokeWeight: b(Number),
|
|
6459
|
+
visible: b(Boolean),
|
|
6460
|
+
fillColor: b(String),
|
|
6461
|
+
fillOpacity: b(Number),
|
|
6462
|
+
"onUpdate:paths": k()
|
|
6459
6463
|
},
|
|
6460
6464
|
emits: void 0,
|
|
6461
6465
|
setup(i, { attrs: t }) {
|
|
6462
6466
|
return {
|
|
6463
|
-
attrs:
|
|
6467
|
+
attrs: ie(t, i),
|
|
6464
6468
|
overlay: void 0,
|
|
6465
6469
|
emittedPaths: void 0
|
|
6466
6470
|
};
|
|
@@ -6503,7 +6507,7 @@ const Ks = /* @__PURE__ */ oe(Ys, [["render", qs]]), Xs = P({
|
|
|
6503
6507
|
}
|
|
6504
6508
|
},
|
|
6505
6509
|
onCreate() {
|
|
6506
|
-
this.overlay = this.$map.createPolygon(this), this.$map.addOverlay(this.overlay),
|
|
6510
|
+
this.overlay = this.$map.createPolygon(this), this.$map.addOverlay(this.overlay), re(this.attrs.listeners, this.overlay), "update:paths" in this.attrs.listenerProps && this.overlay.addEventListener("paths-edited", () => {
|
|
6507
6511
|
this.$emit("update:paths", this.emittedPaths = this.overlay.getPaths());
|
|
6508
6512
|
});
|
|
6509
6513
|
},
|
|
@@ -6515,20 +6519,20 @@ const Ks = /* @__PURE__ */ oe(Ys, [["render", qs]]), Xs = P({
|
|
|
6515
6519
|
mixins: [$],
|
|
6516
6520
|
inheritAttrs: !1,
|
|
6517
6521
|
props: {
|
|
6518
|
-
path:
|
|
6519
|
-
icons:
|
|
6520
|
-
clickable:
|
|
6521
|
-
editable:
|
|
6522
|
-
strokeColor:
|
|
6523
|
-
strokeOpacity:
|
|
6524
|
-
strokeWeight:
|
|
6525
|
-
visible:
|
|
6526
|
-
"onUpdate:path":
|
|
6522
|
+
path: N(Array),
|
|
6523
|
+
icons: b(Array),
|
|
6524
|
+
clickable: b(Boolean),
|
|
6525
|
+
editable: b(Boolean),
|
|
6526
|
+
strokeColor: b(String),
|
|
6527
|
+
strokeOpacity: b(Number),
|
|
6528
|
+
strokeWeight: b(Number),
|
|
6529
|
+
visible: b(Boolean),
|
|
6530
|
+
"onUpdate:path": k()
|
|
6527
6531
|
},
|
|
6528
6532
|
emits: void 0,
|
|
6529
6533
|
setup(i, { attrs: t }) {
|
|
6530
6534
|
return {
|
|
6531
|
-
attrs:
|
|
6535
|
+
attrs: ie(t, i),
|
|
6532
6536
|
overlay: void 0,
|
|
6533
6537
|
emittedPath: void 0
|
|
6534
6538
|
};
|
|
@@ -6571,7 +6575,7 @@ const Ks = /* @__PURE__ */ oe(Ys, [["render", qs]]), Xs = P({
|
|
|
6571
6575
|
}
|
|
6572
6576
|
},
|
|
6573
6577
|
onCreate() {
|
|
6574
|
-
this.overlay = this.$map.createPolyline(this), this.$map.addOverlay(this.overlay),
|
|
6578
|
+
this.overlay = this.$map.createPolyline(this), this.$map.addOverlay(this.overlay), re(this.attrs.listeners, this.overlay), "update:path" in this.attrs.listenerProps && this.overlay.addEventListener("path-edited", () => {
|
|
6575
6579
|
this.$emit("update:path", this.emittedPath = this.overlay.getPath());
|
|
6576
6580
|
});
|
|
6577
6581
|
},
|
|
@@ -6583,21 +6587,21 @@ const Ks = /* @__PURE__ */ oe(Ys, [["render", qs]]), Xs = P({
|
|
|
6583
6587
|
mixins: [$],
|
|
6584
6588
|
inheritAttrs: !1,
|
|
6585
6589
|
props: {
|
|
6586
|
-
bounds:
|
|
6587
|
-
clickable:
|
|
6588
|
-
editable:
|
|
6589
|
-
strokeColor:
|
|
6590
|
-
strokeOpacity:
|
|
6591
|
-
strokeWeight:
|
|
6592
|
-
visible:
|
|
6593
|
-
fillColor:
|
|
6594
|
-
fillOpacity:
|
|
6595
|
-
"onUpdate:bounds":
|
|
6590
|
+
bounds: N(Object),
|
|
6591
|
+
clickable: b(Boolean),
|
|
6592
|
+
editable: b(Boolean),
|
|
6593
|
+
strokeColor: b(String),
|
|
6594
|
+
strokeOpacity: b(Number),
|
|
6595
|
+
strokeWeight: b(Number),
|
|
6596
|
+
visible: b(Boolean),
|
|
6597
|
+
fillColor: b(String),
|
|
6598
|
+
fillOpacity: b(Number),
|
|
6599
|
+
"onUpdate:bounds": k()
|
|
6596
6600
|
},
|
|
6597
6601
|
emits: void 0,
|
|
6598
6602
|
setup(i, { attrs: t }) {
|
|
6599
6603
|
return {
|
|
6600
|
-
attrs:
|
|
6604
|
+
attrs: ie(t, i),
|
|
6601
6605
|
overlay: void 0,
|
|
6602
6606
|
emittedBounds: void 0
|
|
6603
6607
|
};
|
|
@@ -6637,7 +6641,7 @@ const Ks = /* @__PURE__ */ oe(Ys, [["render", qs]]), Xs = P({
|
|
|
6637
6641
|
}
|
|
6638
6642
|
},
|
|
6639
6643
|
onCreate() {
|
|
6640
|
-
this.overlay = this.$map.createRectangle(this), this.$map.addOverlay(this.overlay),
|
|
6644
|
+
this.overlay = this.$map.createRectangle(this), this.$map.addOverlay(this.overlay), re(this.attrs.listeners, this.overlay), "update:bounds" in this.attrs.listenerProps && this.overlay.addEventListener("bounds-changed", () => {
|
|
6641
6645
|
this.$emit("update:bounds", this.emittedBounds = this.overlay.getBounds());
|
|
6642
6646
|
});
|
|
6643
6647
|
},
|
|
@@ -6651,7 +6655,7 @@ const Ks = /* @__PURE__ */ oe(Ys, [["render", qs]]), Xs = P({
|
|
|
6651
6655
|
beforeCreate() {
|
|
6652
6656
|
const r = Fr() ?? "", n = (t.nameRegex || /^[A-Z]/).test(r) ? (a) => {
|
|
6653
6657
|
t.hookNames ? t.hookNames.includes(a) && console.debug("[lifecycle]", r, a) : en.includes(a) || console.debug("[lifecycle]", r, a);
|
|
6654
|
-
} :
|
|
6658
|
+
} : De;
|
|
6655
6659
|
n("beforeCreate"), this.__life_impl = n;
|
|
6656
6660
|
},
|
|
6657
6661
|
created() {
|
|
@@ -6691,7 +6695,7 @@ const Ks = /* @__PURE__ */ oe(Ys, [["render", qs]]), Xs = P({
|
|
|
6691
6695
|
}
|
|
6692
6696
|
}
|
|
6693
6697
|
}, tn = 6378137;
|
|
6694
|
-
function
|
|
6698
|
+
function Be(i) {
|
|
6695
6699
|
return i * Math.PI / 180;
|
|
6696
6700
|
}
|
|
6697
6701
|
function mr(i) {
|
|
@@ -6700,26 +6704,26 @@ function mr(i) {
|
|
|
6700
6704
|
function rn(i, t) {
|
|
6701
6705
|
if (i.lat === t.lat && i.lng === t.lng)
|
|
6702
6706
|
return 0;
|
|
6703
|
-
const e =
|
|
6707
|
+
const e = Be((i.lat + t.lat) / 2), r = Be((i.lat - t.lat) / 2), s = Be((i.lng - t.lng) / 2);
|
|
6704
6708
|
let n = Math.sin(r), a = Math.sin(s), c = Math.sin(e);
|
|
6705
|
-
const o = tn,
|
|
6709
|
+
const o = tn, h = 1 / 298.257;
|
|
6706
6710
|
n = n * n, a = a * a, c = c * c;
|
|
6707
|
-
const d = n * (1 - a) + (1 - c) * a,
|
|
6708
|
-
return
|
|
6711
|
+
const d = n * (1 - a) + (1 - c) * a, p = (1 - n) * (1 - a) + c * a, g = Math.atan(Math.sqrt(d / p)), f = Math.sqrt(d * p) / g, T = 2 * g * o, _ = (3 * f - 1) / 2 / p, M = (3 * f + 1) / 2 / d;
|
|
6712
|
+
return T * (1 + h * (_ * c * (1 - n) - M * (1 - c) * n));
|
|
6709
6713
|
}
|
|
6710
6714
|
function sn(i, t, e) {
|
|
6711
|
-
const s = 63567523142e-4, n = 1 / 298.257223563, a =
|
|
6712
|
-
let
|
|
6715
|
+
const s = 63567523142e-4, n = 1 / 298.257223563, a = Be(t), c = Math.sin(a), o = Math.cos(a), h = (1 - n) * Math.tan(Be(i.lat)), d = 1 / Math.sqrt(1 + h * h), p = h * d, g = Math.atan2(h, o), f = d * c, T = 1 - f * f, _ = T * (6378137 * 6378137 - s * s) / (s * s), M = 1 + _ / 16384 * (4096 + _ * (-768 + _ * (320 - 175 * _))), l = _ / 1024 * (256 + _ * (-128 + _ * (74 - 47 * _)));
|
|
6716
|
+
let u = 0, v = 0, y = 0, C = e / (s * M), w = 2 * Math.PI;
|
|
6713
6717
|
for (; Math.abs(C - w) > 1e-12; ) {
|
|
6714
|
-
|
|
6715
|
-
const G =
|
|
6716
|
-
w = C, C = e / (s *
|
|
6718
|
+
u = Math.cos(2 * g + C), v = Math.sin(C), y = Math.cos(C);
|
|
6719
|
+
const G = l * v * (u + l / 4 * (y * (-1 + 2 * u * u) - l / 6 * u * (-3 + 4 * v * v) * (-3 + 4 * u * u)));
|
|
6720
|
+
w = C, C = e / (s * M) + G;
|
|
6717
6721
|
}
|
|
6718
|
-
const E =
|
|
6719
|
-
|
|
6720
|
-
(1 - n) * Math.sqrt(
|
|
6721
|
-
),
|
|
6722
|
-
return { lng: i.lng + mr(J), lat: mr(
|
|
6722
|
+
const E = p * v - d * y * o, S = Math.atan2(
|
|
6723
|
+
p * y + d * v * o,
|
|
6724
|
+
(1 - n) * Math.sqrt(f * f + E * E)
|
|
6725
|
+
), z = Math.atan2(v * c, d * y - p * v * o), L = n / 16 * T * (4 + n * (4 - 3 * T)), J = z - (1 - L) * n * f * (C + L * v * (u + L * y * (-1 + 2 * u * u)));
|
|
6726
|
+
return { lng: i.lng + mr(J), lat: mr(S) };
|
|
6723
6727
|
}
|
|
6724
6728
|
const xn = {
|
|
6725
6729
|
getDistance: rn,
|
|
@@ -6736,7 +6740,7 @@ const En = {
|
|
|
6736
6740
|
});
|
|
6737
6741
|
}
|
|
6738
6742
|
const e = i.config.optionMergeStrategies;
|
|
6739
|
-
e[
|
|
6743
|
+
e[Ze] = e[We] = (r, s) => r ? [...new Set([].concat(r, s))] : Array.isArray(s) ? s : [s];
|
|
6740
6744
|
}
|
|
6741
6745
|
};
|
|
6742
6746
|
export {
|
|
@@ -6752,7 +6756,7 @@ export {
|
|
|
6752
6756
|
Vt as BaiduInfoWindow,
|
|
6753
6757
|
It as BaiduMapTypeControl,
|
|
6754
6758
|
Ot as BaiduMapUrls,
|
|
6755
|
-
|
|
6759
|
+
Ge as BaiduMarker,
|
|
6756
6760
|
Li as BaiduMarkerClusterer,
|
|
6757
6761
|
lt as BaiduOverlay,
|
|
6758
6762
|
Si as BaiduPlacesService,
|
|
@@ -6766,10 +6770,10 @@ export {
|
|
|
6766
6770
|
Rt as BaiduZoomControl,
|
|
6767
6771
|
W as BuildInMapType,
|
|
6768
6772
|
Mr as BuildInMapTypeId,
|
|
6769
|
-
|
|
6770
|
-
|
|
6773
|
+
Pe as CachedValue,
|
|
6774
|
+
A as ControlPosition,
|
|
6771
6775
|
U as ControlPositionConverter,
|
|
6772
|
-
|
|
6776
|
+
D as CoordType,
|
|
6773
6777
|
pi as CustomControl,
|
|
6774
6778
|
ts as ElementOverlay,
|
|
6775
6779
|
gi as EmptyControl,
|
|
@@ -6805,23 +6809,23 @@ export {
|
|
|
6805
6809
|
X as LatLngBounds,
|
|
6806
6810
|
wn as LifecycleLogPlugin,
|
|
6807
6811
|
te as Location,
|
|
6808
|
-
|
|
6809
|
-
|
|
6812
|
+
Ze as MIXIN_HOOK_CREATE,
|
|
6813
|
+
We as MIXIN_HOOK_DESTROY,
|
|
6810
6814
|
sr as MIXIN_MAP_NAME,
|
|
6811
6815
|
ve as MVCArrays,
|
|
6812
6816
|
$ as MapMixin,
|
|
6813
6817
|
Ct as MapOptions,
|
|
6814
|
-
|
|
6815
|
-
|
|
6818
|
+
ze as MapPane,
|
|
6819
|
+
Ne as MapPanes,
|
|
6816
6820
|
V as MapType,
|
|
6817
6821
|
Or as MapTypeControlType,
|
|
6818
6822
|
Br as MapUrls,
|
|
6819
6823
|
Di as MapZoom,
|
|
6820
6824
|
Rr as MarkerClusterer,
|
|
6821
|
-
|
|
6825
|
+
le as Objects,
|
|
6822
6826
|
Wr as Overlay,
|
|
6823
6827
|
$r as PlacesService,
|
|
6824
|
-
|
|
6828
|
+
oe as Point,
|
|
6825
6829
|
zr as SearchBox,
|
|
6826
6830
|
xn as SphericalUtils,
|
|
6827
6831
|
be as Strings,
|
|
@@ -6860,7 +6864,7 @@ export {
|
|
|
6860
6864
|
Tn as createPropertyObjectTyped,
|
|
6861
6865
|
pn as debug,
|
|
6862
6866
|
En as default,
|
|
6863
|
-
|
|
6867
|
+
k as eventProp,
|
|
6864
6868
|
On as extractVNodeFromSlotsByComponent,
|
|
6865
6869
|
Et as findAncestorComponentByType,
|
|
6866
6870
|
Mn as findByComponentType,
|
|
@@ -6872,10 +6876,10 @@ export {
|
|
|
6872
6876
|
hn as isInstanceOf,
|
|
6873
6877
|
ln as lateinit,
|
|
6874
6878
|
ds as loadCachedMap,
|
|
6875
|
-
|
|
6876
|
-
|
|
6879
|
+
De as noop,
|
|
6880
|
+
b as optionalProp,
|
|
6877
6881
|
es as path,
|
|
6878
|
-
|
|
6882
|
+
N as requiredProp,
|
|
6879
6883
|
cn as safeAs,
|
|
6880
6884
|
yr as safeAsComponent,
|
|
6881
6885
|
as as setTgMapConfig,
|
|
@@ -6888,7 +6892,7 @@ export {
|
|
|
6888
6892
|
yt as typed,
|
|
6889
6893
|
dn as unwrapStringEnumValue,
|
|
6890
6894
|
Cn as useEventLogMethods,
|
|
6891
|
-
|
|
6895
|
+
ie as useSplittedAttrs,
|
|
6892
6896
|
nr as useTgMapInner
|
|
6893
6897
|
};
|
|
6894
6898
|
//# sourceMappingURL=tg-map.js.map
|