tg-map-vue3 3.8.0 → 3.8.1
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 +320 -318
- package/dist/tg-map.js.map +1 -1
- package/dist/tg-map.umd.cjs +5 -5
- package/dist/tg-map.umd.cjs.map +1 -1
- package/package.json +11 -11
package/dist/tg-map.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode('.baidu-info-box-container{transform:translateY(-11px);font-size:13px;font-weight:300;width:100vw}.baidu-info-box-container__border{position:absolute;padding:12px;background-color:#fff;box-shadow:0 2px 7px 1px #0000004d;border-radius:8px;transform:translate(-50%,-100%)}.baidu-info-box-container__inner{overflow:auto}.baidu-info-box-container__close{position:absolute;right:-6px;top:-6px;width:14px;height:14px;margin:8px;opacity:.6;cursor:pointer}.baidu-info-box-container__close:hover{opacity:1}.baidu-info-box-container:after{position:absolute;background-color:#fff;content:"";width:15px;height:15px;left: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)}})();
|
|
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
|
|
4
|
+
var g = (i, t, e) => (qr(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
5
5
|
import { createCommentVNode as ft, computed as fr, defineComponent as P, markRaw as Kr, watch as De, openBlock as re, createElementBlock as ie, mergeProps as Oe, 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
6
|
function se(i, t, e) {
|
|
7
7
|
Object.keys(i).forEach((r) => {
|
|
@@ -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(m, h, f, M) {
|
|
29
|
+
this.west = Math.min(m, f), this.north = Math.max(h, M), this.east = Math.max(m, f), this.south = Math.min(h, M);
|
|
30
30
|
}
|
|
31
|
-
n.prototype.contain = function(
|
|
32
|
-
return this.west <=
|
|
31
|
+
n.prototype.contain = function(m, h) {
|
|
32
|
+
return this.west <= m && this.east >= m && this.north >= h && this.south <= h;
|
|
33
33
|
};
|
|
34
34
|
var a = [
|
|
35
35
|
new n(79.4462, 49.2204, 96.33, 42.8899),
|
|
@@ -47,70 +47,70 @@ var vr = { exports: {} };
|
|
|
47
47
|
new n(131.2662, 44.8922, 137.0227, 42.5692),
|
|
48
48
|
new n(73.1246, 35.398637, 77.948114, 29.5297)
|
|
49
49
|
];
|
|
50
|
-
function o(
|
|
50
|
+
function o(m, h) {
|
|
51
51
|
for (var f = 0; f < a.length; f++)
|
|
52
|
-
if (a[f].contain(
|
|
52
|
+
if (a[f].contain(m, h)) {
|
|
53
53
|
for (var M = 0; M < c.length; M++)
|
|
54
|
-
if (c[M].contain(
|
|
54
|
+
if (c[M].contain(m, h))
|
|
55
55
|
return !1;
|
|
56
56
|
return !0;
|
|
57
57
|
}
|
|
58
58
|
return !1;
|
|
59
59
|
}
|
|
60
|
-
function l(
|
|
61
|
-
var f =
|
|
60
|
+
function l(m, h) {
|
|
61
|
+
var f = m - 65e-4, M = h - 6e-3, T = Math.sqrt(f * f + M * M) - 2e-5 * Math.sin(M * t), C = Math.atan2(M, f) - 3e-6 * Math.cos(f * t), w = T * Math.cos(C), E = T * Math.sin(C);
|
|
62
62
|
return [w, E];
|
|
63
63
|
}
|
|
64
|
-
function d(
|
|
65
|
-
var f = Math.sqrt(
|
|
64
|
+
function d(m, h) {
|
|
65
|
+
var f = Math.sqrt(m * m + h * h) + 2e-5 * Math.sin(h * t), M = Math.atan2(h, m) + 3e-6 * Math.cos(m * t), T = f * Math.cos(M) + 65e-4, C = f * Math.sin(M) + 6e-3;
|
|
66
66
|
return [T, C];
|
|
67
67
|
}
|
|
68
|
-
function m
|
|
69
|
-
return o(
|
|
68
|
+
function u(m, h) {
|
|
69
|
+
return o(m, h) ? v(m, h) : [m, h];
|
|
70
70
|
}
|
|
71
|
-
function
|
|
72
|
-
if (!o(
|
|
73
|
-
return [
|
|
74
|
-
var f = v(
|
|
75
|
-
return [
|
|
71
|
+
function p(m, h) {
|
|
72
|
+
if (!o(m, h))
|
|
73
|
+
return [m, h];
|
|
74
|
+
var f = v(m, h);
|
|
75
|
+
return [m * 2 - f[0], h * 2 - f[1]];
|
|
76
76
|
}
|
|
77
|
-
function v(
|
|
78
|
-
var f = b(
|
|
77
|
+
function v(m, h) {
|
|
78
|
+
var f = b(m - 105, h - 35), M = y(m - 105, h - 35), T = h / 180 * e, C = Math.sin(T);
|
|
79
79
|
C = 1 - s * C * C;
|
|
80
80
|
var w = Math.sqrt(C);
|
|
81
81
|
f = f * 180 / (r * (1 - s) / (C * w) * e), M = M * 180 / (r / w * Math.cos(T) * e);
|
|
82
|
-
var E = h + f, D =
|
|
82
|
+
var E = h + f, D = m + M;
|
|
83
83
|
return [D, E];
|
|
84
84
|
}
|
|
85
|
-
function b(
|
|
86
|
-
var f = -100 + 2 *
|
|
87
|
-
return f += (20 * Math.sin(6 *
|
|
85
|
+
function b(m, h) {
|
|
86
|
+
var f = -100 + 2 * m + 3 * h + 0.2 * h * h + 0.1 * m * h + 0.2 * Math.sqrt(Math.abs(m));
|
|
87
|
+
return f += (20 * Math.sin(6 * m * e) + 20 * Math.sin(2 * m * e)) * 2 / 3, f += (20 * Math.sin(h * e) + 40 * Math.sin(h / 3 * e)) * 2 / 3, f += (160 * Math.sin(h / 12 * e) + 320 * Math.sin(h * e / 30)) * 2 / 3, f;
|
|
88
88
|
}
|
|
89
|
-
function y(
|
|
90
|
-
var f = 300 +
|
|
91
|
-
return f += (20 * Math.sin(6 *
|
|
89
|
+
function y(m, h) {
|
|
90
|
+
var f = 300 + m + 2 * h + 0.1 * m * m + 0.1 * m * h + 0.1 * Math.sqrt(Math.abs(m));
|
|
91
|
+
return f += (20 * Math.sin(6 * m * e) + 20 * Math.sin(2 * m * e)) * 2 / 3, f += (20 * Math.sin(m * e) + 40 * Math.sin(m / 3 * e)) * 2 / 3, f += (150 * Math.sin(m / 12 * e) + 300 * Math.sin(m / 30 * e)) * 2 / 3, f;
|
|
92
92
|
}
|
|
93
93
|
return {
|
|
94
94
|
// 向前兼容
|
|
95
95
|
bd09togcj02: l,
|
|
96
96
|
gcj02tobd09: d,
|
|
97
|
-
wgs84togcj02:
|
|
98
|
-
gcj02towgs84:
|
|
97
|
+
wgs84togcj02: u,
|
|
98
|
+
gcj02towgs84: p,
|
|
99
99
|
// 小驼峰命名风格
|
|
100
100
|
bd09ToGcj02: l,
|
|
101
101
|
gcj02ToBd09: d,
|
|
102
|
-
wgs84ToGcj02:
|
|
103
|
-
gcj02ToWgs84:
|
|
104
|
-
bd09ToWgs84: function(
|
|
105
|
-
if (!o(
|
|
106
|
-
return [
|
|
107
|
-
var f = l(
|
|
108
|
-
return
|
|
102
|
+
wgs84ToGcj02: u,
|
|
103
|
+
gcj02ToWgs84: p,
|
|
104
|
+
bd09ToWgs84: function(m, h) {
|
|
105
|
+
if (!o(m, h))
|
|
106
|
+
return [m, h];
|
|
107
|
+
var f = l(m, h);
|
|
108
|
+
return p(f[0], f[1]);
|
|
109
109
|
},
|
|
110
|
-
wgs84ToBd09: function(
|
|
111
|
-
if (!o(
|
|
112
|
-
return [
|
|
113
|
-
var f = m
|
|
110
|
+
wgs84ToBd09: function(m, h) {
|
|
111
|
+
if (!o(m, h))
|
|
112
|
+
return [m, h];
|
|
113
|
+
var f = u(m, h);
|
|
114
114
|
return d(f[0], f[1]);
|
|
115
115
|
}
|
|
116
116
|
};
|
|
@@ -345,7 +345,7 @@ const ut = "wgs84", R = class R {
|
|
|
345
345
|
return JSON.stringify(this);
|
|
346
346
|
}
|
|
347
347
|
};
|
|
348
|
-
|
|
348
|
+
g(R, "ZERO", R.create(0, 0));
|
|
349
349
|
let O = R;
|
|
350
350
|
const ae = class ae {
|
|
351
351
|
/**
|
|
@@ -354,7 +354,7 @@ const ae = class ae {
|
|
|
354
354
|
* @param ne 东北, lat/lng更大
|
|
355
355
|
*/
|
|
356
356
|
constructor(t, e) {
|
|
357
|
-
|
|
357
|
+
g(this, "coord");
|
|
358
358
|
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;
|
|
359
359
|
}
|
|
360
360
|
static isBetweenLng(t, e, r) {
|
|
@@ -428,16 +428,16 @@ const ae = class ae {
|
|
|
428
428
|
return [this.sw.toBaidu(t), this.ne.toBaidu(t)];
|
|
429
429
|
}
|
|
430
430
|
};
|
|
431
|
-
|
|
431
|
+
g(ae, "EMPTY", new ae(O.ZERO, O.ZERO));
|
|
432
432
|
let X = ae;
|
|
433
433
|
((i) => {
|
|
434
434
|
class t {
|
|
435
435
|
constructor(r) {
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
436
|
+
g(this, "coord");
|
|
437
|
+
g(this, "minLat");
|
|
438
|
+
g(this, "minLng");
|
|
439
|
+
g(this, "maxLat");
|
|
440
|
+
g(this, "maxLng");
|
|
441
441
|
this.coord = r.coord, this.minLat = this.maxLat = r.lat, this.minLng = this.maxLng = r.lng;
|
|
442
442
|
}
|
|
443
443
|
build() {
|
|
@@ -495,8 +495,8 @@ function or(i, t, e) {
|
|
|
495
495
|
}
|
|
496
496
|
class br {
|
|
497
497
|
constructor(t, e) {
|
|
498
|
-
|
|
499
|
-
|
|
498
|
+
g(this, "eventMap", /* @__PURE__ */ new Map());
|
|
499
|
+
g(this, "target", void 0);
|
|
500
500
|
this.inner = t, this.coordTypeSupplier = e, this.addEventListener = this.addEventListener.bind(this), this.removeEventListener = this.removeEventListener.bind(this);
|
|
501
501
|
}
|
|
502
502
|
setTarget(t) {
|
|
@@ -505,7 +505,7 @@ class br {
|
|
|
505
505
|
}
|
|
506
506
|
class ot {
|
|
507
507
|
constructor(t, e) {
|
|
508
|
-
|
|
508
|
+
g(this, "eventHub", new Tr());
|
|
509
509
|
this.delegate = t, this.options = e;
|
|
510
510
|
}
|
|
511
511
|
notify(t) {
|
|
@@ -555,7 +555,7 @@ const rt = class rt extends br {
|
|
|
555
555
|
}
|
|
556
556
|
};
|
|
557
557
|
// 事件类型映射: tg => google
|
|
558
|
-
|
|
558
|
+
g(rt, "EVENT_TYPE_MAP", {
|
|
559
559
|
"center-changed": "center_changed",
|
|
560
560
|
"zoom-changed": "zoom_changed",
|
|
561
561
|
"radius-changed": "radius_changed",
|
|
@@ -596,7 +596,7 @@ const Se = class Se extends br {
|
|
|
596
596
|
};
|
|
597
597
|
// cSpell:words clickclose
|
|
598
598
|
// 事件类型映射, tg => baidu
|
|
599
|
-
|
|
599
|
+
g(Se, "EVENT_TYPE_MAP", {
|
|
600
600
|
drag: "dragging",
|
|
601
601
|
closeclick: "clickclose",
|
|
602
602
|
// baidu不支持contextmenu事件, 将其映射为rightclick
|
|
@@ -607,7 +607,7 @@ u(Se, "EVENT_TYPE_MAP", {
|
|
|
607
607
|
let $e = Se;
|
|
608
608
|
class Tr {
|
|
609
609
|
constructor() {
|
|
610
|
-
|
|
610
|
+
g(this, "typeMap", /* @__PURE__ */ new Map());
|
|
611
611
|
}
|
|
612
612
|
addEventListener(t, e) {
|
|
613
613
|
let r = this.typeMap.get(t);
|
|
@@ -631,8 +631,8 @@ class ar {
|
|
|
631
631
|
* `keys`和`values`数组中可以有相同的值, 若存在相同值, 则index越小的优先级越高
|
|
632
632
|
*/
|
|
633
633
|
constructor(t, e) {
|
|
634
|
-
|
|
635
|
-
|
|
634
|
+
g(this, "keyToValue", /* @__PURE__ */ new Map());
|
|
635
|
+
g(this, "valueToKey", /* @__PURE__ */ new Map());
|
|
636
636
|
me(t.length === e.length);
|
|
637
637
|
for (let r = t.length - 1; r >= 0; r--)
|
|
638
638
|
this.keyToValue.set(t[r], e[r]), this.valueToKey.set(e[r], t[r]);
|
|
@@ -646,7 +646,7 @@ class ar {
|
|
|
646
646
|
}
|
|
647
647
|
class ui {
|
|
648
648
|
constructor(t, e = 10) {
|
|
649
|
-
|
|
649
|
+
g(this, "map", /* @__PURE__ */ new Map());
|
|
650
650
|
this.values = t, this.maxSize4Debug = e;
|
|
651
651
|
}
|
|
652
652
|
/** 获取保存key-value映射的Map */
|
|
@@ -675,7 +675,7 @@ class ui {
|
|
|
675
675
|
}
|
|
676
676
|
class Le {
|
|
677
677
|
constructor(t) {
|
|
678
|
-
|
|
678
|
+
g(this, "value");
|
|
679
679
|
this.creator = t;
|
|
680
680
|
}
|
|
681
681
|
get() {
|
|
@@ -751,7 +751,7 @@ var k = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
|
|
|
751
751
|
class pi {
|
|
752
752
|
constructor(t) {
|
|
753
753
|
/** 实际添加到地图中的control对象 */
|
|
754
|
-
|
|
754
|
+
g(this, "inner");
|
|
755
755
|
this.position = t;
|
|
756
756
|
}
|
|
757
757
|
}
|
|
@@ -804,8 +804,8 @@ class Bt extends Lt {
|
|
|
804
804
|
class at extends Lt {
|
|
805
805
|
constructor(e, r) {
|
|
806
806
|
super();
|
|
807
|
-
|
|
808
|
-
|
|
807
|
+
g(this, "visible", !1);
|
|
808
|
+
g(this, "map");
|
|
809
809
|
this._type = e, this.position = r;
|
|
810
810
|
}
|
|
811
811
|
isVisible() {
|
|
@@ -865,14 +865,14 @@ class W {
|
|
|
865
865
|
}
|
|
866
866
|
class mn {
|
|
867
867
|
constructor(t, e) {
|
|
868
|
-
|
|
868
|
+
g(this, "baiduLayerCached", new Le(() => {
|
|
869
869
|
const t = new BMap.TileLayer({});
|
|
870
870
|
return t.getTilesUrl = (e, r) => {
|
|
871
871
|
const s = Math.pow(2, r - 1), n = e.x + s, a = s - 1 - e.y;
|
|
872
872
|
return this.options.getTileUrl({ x: n, y: a }, r);
|
|
873
873
|
}, t;
|
|
874
874
|
}));
|
|
875
|
-
|
|
875
|
+
g(this, "baiduMapTypeCached", new Le(() => {
|
|
876
876
|
const t = new BMap.MapType(this.options.name, this.baiduLayerCached.get(), {
|
|
877
877
|
maxZoom: this.options.maxZoom,
|
|
878
878
|
minZoom: this.options.minZoom,
|
|
@@ -880,7 +880,7 @@ class mn {
|
|
|
880
880
|
});
|
|
881
881
|
return t.__baidu_map_type__ = this, t;
|
|
882
882
|
}));
|
|
883
|
-
|
|
883
|
+
g(this, "googleCached", new Le(() => {
|
|
884
884
|
const t = new google.maps.ImageMapType({
|
|
885
885
|
getTileUrl: (e, r) => this.options.getTileUrl(e, r),
|
|
886
886
|
tileSize: new google.maps.Size(256, 256),
|
|
@@ -917,8 +917,8 @@ class mn {
|
|
|
917
917
|
}
|
|
918
918
|
class mi {
|
|
919
919
|
constructor() {
|
|
920
|
-
|
|
921
|
-
|
|
920
|
+
g(this, "baiduCache", new Le(() => new BMap.TrafficLayer()));
|
|
921
|
+
g(this, "googleCache", new Le(() => new google.maps.TrafficLayer()));
|
|
922
922
|
}
|
|
923
923
|
asBaiduLayer() {
|
|
924
924
|
return this.baiduCache.get();
|
|
@@ -973,7 +973,7 @@ const ue = class ue extends at {
|
|
|
973
973
|
});
|
|
974
974
|
}
|
|
975
975
|
};
|
|
976
|
-
|
|
976
|
+
g(ue, "type2google");
|
|
977
977
|
let Tt = ue;
|
|
978
978
|
class St extends Bt {
|
|
979
979
|
static create(t) {
|
|
@@ -1024,14 +1024,14 @@ class $t extends at {
|
|
|
1024
1024
|
}
|
|
1025
1025
|
function fi(i) {
|
|
1026
1026
|
let t, e, r;
|
|
1027
|
-
const s = "The Google Maps JavaScript API", n = "google", a = "importLibrary", c = "__ib__", o = document, l = window, d = l[n] || (l[n] = {}),
|
|
1027
|
+
const s = "The Google Maps JavaScript API", n = "google", a = "importLibrary", c = "__ib__", o = document, l = window, d = l[n] || (l[n] = {}), u = d.maps || (d.maps = {}), p = /* @__PURE__ */ new Set(), v = new URLSearchParams(), b = () => t || (t = new Promise(async (y, m) => {
|
|
1028
1028
|
var h;
|
|
1029
|
-
await (e = o.createElement("script")), v.set("libraries", [...
|
|
1029
|
+
await (e = o.createElement("script")), v.set("libraries", [...p] + "");
|
|
1030
1030
|
for (r in i)
|
|
1031
1031
|
v.set(r.replace(/[A-Z]/g, (f) => "_" + f[0].toLowerCase()), i[r]);
|
|
1032
|
-
v.set("callback", n + ".maps." + c), e.src = `https://maps.${n}apis.com/maps/api/js?` + v,
|
|
1032
|
+
v.set("callback", n + ".maps." + c), e.src = `https://maps.${n}apis.com/maps/api/js?` + v, u[c] = y, e.onerror = () => t = m(Error(s + " could not load.")), e.nonce = ((h = o.querySelector("script[nonce]")) == null ? void 0 : h.nonce) || "", o.head.append(e);
|
|
1033
1033
|
}));
|
|
1034
|
-
|
|
1034
|
+
u[a] ? console.warn(s + " only loads once. Ignoring:", i) : u[a] = (y, ...m) => p.add(y) && b().then(() => u[a](y, ...m));
|
|
1035
1035
|
}
|
|
1036
1036
|
let vi, yi;
|
|
1037
1037
|
const he = {
|
|
@@ -1086,7 +1086,7 @@ class Er {
|
|
|
1086
1086
|
class _i extends Er {
|
|
1087
1087
|
constructor(e, r) {
|
|
1088
1088
|
super();
|
|
1089
|
-
|
|
1089
|
+
g(this, "inner");
|
|
1090
1090
|
this.map = e, this.inner = new google.maps.places.Autocomplete(r.input, {
|
|
1091
1091
|
fields: [
|
|
1092
1092
|
"address_components",
|
|
@@ -1116,10 +1116,10 @@ class _i extends Er {
|
|
|
1116
1116
|
class bi extends Er {
|
|
1117
1117
|
constructor(e, r) {
|
|
1118
1118
|
super();
|
|
1119
|
-
|
|
1120
|
-
|
|
1119
|
+
g(this, "inner");
|
|
1120
|
+
g(this, "input");
|
|
1121
1121
|
// TODO: 要不要添加个移除监听的方法?
|
|
1122
|
-
|
|
1122
|
+
g(this, "removeableArray", []);
|
|
1123
1123
|
if (this.map = e, this.input = r.input, this.inner = new BMap.Autocomplete({
|
|
1124
1124
|
input: r.input,
|
|
1125
1125
|
location: r.bindToMap ? e.innerMap : void 0
|
|
@@ -1176,14 +1176,14 @@ var Pr = { exports: {} };
|
|
|
1176
1176
|
defaultValueField: "value",
|
|
1177
1177
|
plugins: {}
|
|
1178
1178
|
}, a = function() {
|
|
1179
|
-
var v = function(
|
|
1180
|
-
this._coordinator = {}, this._data = [], this._radi = [], this._min = 0, this._max = 1, this._xField =
|
|
1179
|
+
var v = function(m) {
|
|
1180
|
+
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);
|
|
1181
1181
|
}, b = n.defaultRadius;
|
|
1182
1182
|
return v.prototype = {
|
|
1183
1183
|
// when forceRender = false -> called from setData, omits renderall event
|
|
1184
|
-
_organiseData: function(y,
|
|
1184
|
+
_organiseData: function(y, m) {
|
|
1185
1185
|
var h = y[this._xField], f = y[this._yField], M = this._radi, T = this._data, C = this._max, w = this._min, E = y[this._valueField] || 1, D = y.radius || this._cfgRadius || b;
|
|
1186
|
-
return T[h] || (T[h] = [], M[h] = []), T[h][f] ? T[h][f] += E : (T[h][f] = E, M[h][f] = D), T[h][f] > C ? (
|
|
1186
|
+
return T[h] || (T[h] = [], M[h] = []), T[h][f] ? T[h][f] += E : (T[h][f] = E, M[h][f] = D), T[h][f] > C ? (m ? this.setDataMax(T[h][f]) : this._max = T[h][f], !1) : {
|
|
1187
1187
|
x: h,
|
|
1188
1188
|
y: f,
|
|
1189
1189
|
value: E,
|
|
@@ -1193,14 +1193,14 @@ var Pr = { exports: {} };
|
|
|
1193
1193
|
};
|
|
1194
1194
|
},
|
|
1195
1195
|
_unOrganizeData: function() {
|
|
1196
|
-
var y = [],
|
|
1197
|
-
for (var f in
|
|
1198
|
-
for (var M in
|
|
1196
|
+
var y = [], m = this._data, h = this._radi;
|
|
1197
|
+
for (var f in m)
|
|
1198
|
+
for (var M in m[f])
|
|
1199
1199
|
y.push({
|
|
1200
1200
|
x: f,
|
|
1201
1201
|
y: M,
|
|
1202
1202
|
radius: h[f][M],
|
|
1203
|
-
value:
|
|
1203
|
+
value: m[f][M]
|
|
1204
1204
|
});
|
|
1205
1205
|
return {
|
|
1206
1206
|
min: this._min,
|
|
@@ -1216,8 +1216,8 @@ var Pr = { exports: {} };
|
|
|
1216
1216
|
},
|
|
1217
1217
|
addData: function() {
|
|
1218
1218
|
if (arguments[0].length > 0)
|
|
1219
|
-
for (var y = arguments[0],
|
|
1220
|
-
this.addData.call(this, y[
|
|
1219
|
+
for (var y = arguments[0], m = y.length; m--; )
|
|
1220
|
+
this.addData.call(this, y[m]);
|
|
1221
1221
|
else {
|
|
1222
1222
|
var h = this._organiseData(arguments[0], !0);
|
|
1223
1223
|
h && this._coordinator.emit("renderpartial", {
|
|
@@ -1229,10 +1229,10 @@ var Pr = { exports: {} };
|
|
|
1229
1229
|
return this;
|
|
1230
1230
|
},
|
|
1231
1231
|
setData: function(y) {
|
|
1232
|
-
var
|
|
1232
|
+
var m = y.data, h = m.length;
|
|
1233
1233
|
this._data = [], this._radi = [];
|
|
1234
1234
|
for (var f = 0; f < h; f++)
|
|
1235
|
-
this._organiseData(
|
|
1235
|
+
this._organiseData(m[f], !1);
|
|
1236
1236
|
return this._max = y.max, this._min = y.min || 0, this._onExtremaChange(), this._coordinator.emit("renderall", this._getInternalData()), this;
|
|
1237
1237
|
},
|
|
1238
1238
|
removeData: function() {
|
|
@@ -1330,13 +1330,13 @@ var Pr = { exports: {} };
|
|
|
1330
1330
|
data: f
|
|
1331
1331
|
};
|
|
1332
1332
|
};
|
|
1333
|
-
function
|
|
1333
|
+
function m(h) {
|
|
1334
1334
|
var f = h.element, M = this.shadowCanvas = document.createElement("canvas"), T = this.canvas = h.canvas || document.createElement("canvas");
|
|
1335
1335
|
this._renderBoundaries = [1e4, 1e4, 0, 0];
|
|
1336
1336
|
var C = getComputedStyle(h.element) || {};
|
|
1337
1337
|
T.className = "heatmap-canvas", this._width = T.width = M.width = +C.width.replace(/px/, ""), this._height = T.height = M.height = +C.height.replace(/px/, ""), this.shadowCtx = M.getContext("2d"), this.ctx = T.getContext("2d"), T.style.cssText = M.style.cssText = "position:absolute;left:0;top:0;", f.style.position = "relative", f.appendChild(T), this._palette = v(h), this._templates = {}, this._setStyles(h);
|
|
1338
1338
|
}
|
|
1339
|
-
return
|
|
1339
|
+
return m.prototype = {
|
|
1340
1340
|
renderPartial: function(h) {
|
|
1341
1341
|
this._drawAlpha(h), this._colorize();
|
|
1342
1342
|
},
|
|
@@ -1383,18 +1383,18 @@ var Pr = { exports: {} };
|
|
|
1383
1383
|
getDataURL: function() {
|
|
1384
1384
|
return this.canvas.toDataURL();
|
|
1385
1385
|
}
|
|
1386
|
-
},
|
|
1386
|
+
}, m;
|
|
1387
1387
|
}(), o = function() {
|
|
1388
1388
|
var v = !1;
|
|
1389
1389
|
return n.defaultRenderer === "canvas2d" && (v = c), v;
|
|
1390
1390
|
}(), l = {
|
|
1391
1391
|
merge: function() {
|
|
1392
|
-
for (var
|
|
1392
|
+
for (var p = {}, v = arguments.length, b = 0; b < v; b++) {
|
|
1393
1393
|
var y = arguments[b];
|
|
1394
|
-
for (var
|
|
1395
|
-
|
|
1394
|
+
for (var m in y)
|
|
1395
|
+
p[m] = y[m];
|
|
1396
1396
|
}
|
|
1397
|
-
return
|
|
1397
|
+
return p;
|
|
1398
1398
|
}
|
|
1399
1399
|
}, d = function() {
|
|
1400
1400
|
var v = function() {
|
|
@@ -1417,27 +1417,27 @@ var Pr = { exports: {} };
|
|
|
1417
1417
|
}
|
|
1418
1418
|
}
|
|
1419
1419
|
}, h;
|
|
1420
|
-
}(), b = function(
|
|
1421
|
-
var h =
|
|
1420
|
+
}(), b = function(m) {
|
|
1421
|
+
var h = m._renderer, f = m._coordinator, M = m._store;
|
|
1422
1422
|
f.on("renderpartial", h.renderPartial, h), f.on("renderall", h.renderAll, h), f.on("extremachange", function(T) {
|
|
1423
|
-
|
|
1423
|
+
m._config.onExtremaChange && m._config.onExtremaChange({
|
|
1424
1424
|
min: T.min,
|
|
1425
1425
|
max: T.max,
|
|
1426
|
-
gradient:
|
|
1426
|
+
gradient: m._config.gradient || m._config.defaultGradient
|
|
1427
1427
|
});
|
|
1428
1428
|
}), M.setCoordinator(f);
|
|
1429
1429
|
};
|
|
1430
1430
|
function y() {
|
|
1431
|
-
var
|
|
1432
|
-
if (this._coordinator = new v(),
|
|
1433
|
-
var h =
|
|
1431
|
+
var m = this._config = l.merge(n, arguments[0] || {});
|
|
1432
|
+
if (this._coordinator = new v(), m.plugin) {
|
|
1433
|
+
var h = m.plugin;
|
|
1434
1434
|
if (n.plugins[h]) {
|
|
1435
1435
|
var f = n.plugins[h];
|
|
1436
|
-
this._renderer = new f.renderer(
|
|
1436
|
+
this._renderer = new f.renderer(m), this._store = new f.store(m);
|
|
1437
1437
|
} else
|
|
1438
1438
|
throw new Error("Plugin '" + h + "' not found. Maybe it was not registered.");
|
|
1439
1439
|
} else
|
|
1440
|
-
this._renderer = new o(
|
|
1440
|
+
this._renderer = new o(m), this._store = new a(m);
|
|
1441
1441
|
b(this);
|
|
1442
1442
|
}
|
|
1443
1443
|
return y.prototype = {
|
|
@@ -1456,9 +1456,9 @@ var Pr = { exports: {} };
|
|
|
1456
1456
|
setDataMin: function() {
|
|
1457
1457
|
return this._store.setDataMin.apply(this._store, arguments), this;
|
|
1458
1458
|
},
|
|
1459
|
-
configure: function(
|
|
1459
|
+
configure: function(m) {
|
|
1460
1460
|
const h = this._config;
|
|
1461
|
-
return this._config = l.merge(this._config,
|
|
1461
|
+
return this._config = l.merge(this._config, m), this._renderer.updateConfig(this._config, h), this._coordinator.emit("renderall", this._store._getInternalData()), this;
|
|
1462
1462
|
},
|
|
1463
1463
|
repaint: function() {
|
|
1464
1464
|
return this._coordinator.emit("renderall", this._store._getInternalData()), this;
|
|
@@ -1469,19 +1469,19 @@ var Pr = { exports: {} };
|
|
|
1469
1469
|
getDataURL: function() {
|
|
1470
1470
|
return this._renderer.getDataURL();
|
|
1471
1471
|
},
|
|
1472
|
-
getValueAt: function(
|
|
1473
|
-
return this._store.getValueAt ? this._store.getValueAt(
|
|
1472
|
+
getValueAt: function(m) {
|
|
1473
|
+
return this._store.getValueAt ? this._store.getValueAt(m) : this._renderer.getValueAt ? this._renderer.getValueAt(m) : null;
|
|
1474
1474
|
}
|
|
1475
1475
|
}, y;
|
|
1476
|
-
}(),
|
|
1477
|
-
create: function(
|
|
1478
|
-
return new d(
|
|
1476
|
+
}(), u = {
|
|
1477
|
+
create: function(p) {
|
|
1478
|
+
return new d(p);
|
|
1479
1479
|
},
|
|
1480
|
-
register: function(
|
|
1481
|
-
n.plugins[
|
|
1480
|
+
register: function(p, v) {
|
|
1481
|
+
n.plugins[p] = v;
|
|
1482
1482
|
}
|
|
1483
1483
|
};
|
|
1484
|
-
return
|
|
1484
|
+
return u;
|
|
1485
1485
|
}();
|
|
1486
1486
|
var r = function(n) {
|
|
1487
1487
|
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;
|
|
@@ -1502,22 +1502,22 @@ var Pr = { exports: {} };
|
|
|
1502
1502
|
var n = this._map.getBounds();
|
|
1503
1503
|
if (!n.equals(this.bounds)) {
|
|
1504
1504
|
this.bounds = n;
|
|
1505
|
-
var a = this._map.pointToOverlayPixel(n.getNorthEast()), c = this._map.pointToOverlayPixel(n.getSouthWest()), o = a.y, l = c.x, d = c.y - a.y,
|
|
1506
|
-
if (this.conf.element.style.left = l + "px", this.conf.element.style.top = o + "px", this.conf.element.style.width =
|
|
1505
|
+
var a = this._map.pointToOverlayPixel(n.getNorthEast()), c = this._map.pointToOverlayPixel(n.getSouthWest()), o = a.y, l = c.x, d = c.y - a.y, u = a.x - c.x;
|
|
1506
|
+
if (this.conf.element.style.left = l + "px", this.conf.element.style.top = o + "px", this.conf.element.style.width = u + "px", this.conf.element.style.height = d + "px", this.latlngs.length > 0) {
|
|
1507
1507
|
this.heatmap.removeData();
|
|
1508
|
-
var
|
|
1508
|
+
var p = this.latlngs.length;
|
|
1509
1509
|
const h = {
|
|
1510
1510
|
max: this.heatmap._store.getData().max,
|
|
1511
1511
|
data: []
|
|
1512
1512
|
};
|
|
1513
|
-
for (;
|
|
1514
|
-
var v = this.latlngs[
|
|
1513
|
+
for (; p--; ) {
|
|
1514
|
+
var v = this.latlngs[p].latlng;
|
|
1515
1515
|
if (n.containsPoint(v)) {
|
|
1516
|
-
var b = this._map.pointToOverlayPixel(v), l = this._map.pointToOverlayPixel(n.getSouthWest()).x, o = this._map.pointToOverlayPixel(n.getNorthEast()).y, y = new BMap.Pixel(b.x - l, b.y - o),
|
|
1516
|
+
var b = this._map.pointToOverlayPixel(v), l = this._map.pointToOverlayPixel(n.getSouthWest()).x, o = this._map.pointToOverlayPixel(n.getNorthEast()).y, y = new BMap.Pixel(b.x - l, b.y - o), m = this.pixelTransform(y);
|
|
1517
1517
|
h.data.push({
|
|
1518
|
-
x:
|
|
1519
|
-
y:
|
|
1520
|
-
count: this.latlngs[
|
|
1518
|
+
x: m.x,
|
|
1519
|
+
y: m.y,
|
|
1520
|
+
count: this.latlngs[p].c
|
|
1521
1521
|
});
|
|
1522
1522
|
}
|
|
1523
1523
|
}
|
|
@@ -1547,7 +1547,7 @@ var Pr = { exports: {} };
|
|
|
1547
1547
|
latlng: d,
|
|
1548
1548
|
c: o[l].count
|
|
1549
1549
|
}), !!a.containsPoint(d)) {
|
|
1550
|
-
var
|
|
1550
|
+
var u = this._map.pointToOverlayPixel(d), p = this._map.pointToOverlayPixel(a.getSouthWest()).x, v = this._map.pointToOverlayPixel(a.getNorthEast()).y, b = new BMap.Pixel(u.x - p, u.y - v), y = this.pixelTransform(b);
|
|
1551
1551
|
c.data.push({
|
|
1552
1552
|
x: y.x,
|
|
1553
1553
|
y: y.y,
|
|
@@ -1619,7 +1619,7 @@ class Lr {
|
|
|
1619
1619
|
class Oi extends Lr {
|
|
1620
1620
|
constructor(e, r) {
|
|
1621
1621
|
super();
|
|
1622
|
-
|
|
1622
|
+
g(this, "inner");
|
|
1623
1623
|
this.map = e, this.inner = new google.maps.visualization.HeatmapLayer(qe.toGoogle(r, this.map.coordType)), this.inner.setMap(e.innerMap);
|
|
1624
1624
|
}
|
|
1625
1625
|
setData(e) {
|
|
@@ -1635,7 +1635,7 @@ class Oi extends Lr {
|
|
|
1635
1635
|
class Ci extends Lr {
|
|
1636
1636
|
constructor(e, r) {
|
|
1637
1637
|
super();
|
|
1638
|
-
|
|
1638
|
+
g(this, "inner");
|
|
1639
1639
|
this.map = e;
|
|
1640
1640
|
const s = qe.toBaidu(r, this.map.coordType, r.maxIntensity);
|
|
1641
1641
|
this.inner = new Mi(s), e.innerMap.addOverlay(this.inner), this.inner.setDataSet(s.data);
|
|
@@ -1698,7 +1698,7 @@ const ke = class ke extends Br {
|
|
|
1698
1698
|
});
|
|
1699
1699
|
}
|
|
1700
1700
|
};
|
|
1701
|
-
|
|
1701
|
+
g(ke, "BASE_URL", "https://www.google.com/maps/");
|
|
1702
1702
|
let Mt = ke;
|
|
1703
1703
|
const ge = class ge extends Br {
|
|
1704
1704
|
/**
|
|
@@ -1761,7 +1761,7 @@ const ge = class ge extends Br {
|
|
|
1761
1761
|
});
|
|
1762
1762
|
}
|
|
1763
1763
|
};
|
|
1764
|
-
|
|
1764
|
+
g(ge, "BASE_URL", "https://api.map.baidu.com/");
|
|
1765
1765
|
let Ot = ge, wi = class Ir {
|
|
1766
1766
|
constructor(t, e, r) {
|
|
1767
1767
|
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,10 +2485,10 @@ var Sr = { exports: {} };
|
|
|
2485
2485
|
return r.lang.isString(o) ? document.getElementById(o) : o;
|
|
2486
2486
|
}, r._g = r.dom._g, r.browser = r.browser || {}, /msie (\d+\.\d)/i.test(navigator.userAgent) && (r.browser.ie = r.ie = document.documentMode || +RegExp.$1), r.dom.getComputedStyle = function(o, l) {
|
|
2487
2487
|
o = r.dom._g(o);
|
|
2488
|
-
var d = r.dom.getDocument(o),
|
|
2489
|
-
return d.defaultView && d.defaultView.getComputedStyle && (
|
|
2488
|
+
var d = r.dom.getDocument(o), u;
|
|
2489
|
+
return d.defaultView && d.defaultView.getComputedStyle && (u = d.defaultView.getComputedStyle(o, null), u) ? u[l] || u.getPropertyValue(l) : "";
|
|
2490
2490
|
}, r.dom._styleFixer = r.dom._styleFixer || {}, r.dom._styleFilter = r.dom._styleFilter || [], r.dom._styleFilter.filter = function(o, l, d) {
|
|
2491
|
-
for (var
|
|
2491
|
+
for (var u = 0, p = r.dom._styleFilter, v; v = p[u]; u++)
|
|
2492
2492
|
(v = v[d]) && (l = v(o, l));
|
|
2493
2493
|
return l;
|
|
2494
2494
|
}, r.string = r.string || {}, r.string.toCamelCase = function(o) {
|
|
@@ -2498,42 +2498,42 @@ var Sr = { exports: {} };
|
|
|
2498
2498
|
}, r.dom.getStyle = function(o, l) {
|
|
2499
2499
|
var d = r.dom;
|
|
2500
2500
|
o = d.g(o), l = r.string.toCamelCase(l);
|
|
2501
|
-
var
|
|
2502
|
-
if (!
|
|
2503
|
-
var
|
|
2504
|
-
|
|
2501
|
+
var u = o.style[l] || (o.currentStyle ? o.currentStyle[l] : "") || d.getComputedStyle(o, l);
|
|
2502
|
+
if (!u) {
|
|
2503
|
+
var p = d._styleFixer[l];
|
|
2504
|
+
p && (u = p.get ? p.get(o) : r.dom.getStyle(o, p));
|
|
2505
2505
|
}
|
|
2506
|
-
return (
|
|
2506
|
+
return (p = d._styleFilter) && (u = p.filter(l, u, "get")), u;
|
|
2507
2507
|
}, 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) {
|
|
2508
2508
|
o = r.dom.g(o);
|
|
2509
|
-
var l = r.dom.getDocument(o), d = r.browser,
|
|
2510
|
-
d.isGecko > 0 && l.getBoxObjectFor &&
|
|
2511
|
-
var
|
|
2509
|
+
var l = r.dom.getDocument(o), d = r.browser, u = r.dom.getStyle;
|
|
2510
|
+
d.isGecko > 0 && l.getBoxObjectFor && u(o, "position") == "absolute" && (o.style.top === "" || o.style.left);
|
|
2511
|
+
var p = { left: 0, top: 0 }, v = d.ie && !d.isStrict ? l.body : l.documentElement, b, y;
|
|
2512
2512
|
if (o == v)
|
|
2513
|
-
return
|
|
2513
|
+
return p;
|
|
2514
2514
|
if (o.getBoundingClientRect) {
|
|
2515
|
-
y = o.getBoundingClientRect(),
|
|
2516
|
-
var
|
|
2517
|
-
d.ie && !d.isStrict && (
|
|
2515
|
+
y = o.getBoundingClientRect(), p.left = Math.floor(y.left) + Math.max(l.documentElement.scrollLeft, l.body.scrollLeft), p.top = Math.floor(y.top) + Math.max(l.documentElement.scrollTop, l.body.scrollTop), p.left -= l.documentElement.clientLeft, p.top -= l.documentElement.clientTop;
|
|
2516
|
+
var m = l.body, h = parseInt(u(m, "borderLeftWidth")), f = parseInt(u(m, "borderTopWidth"));
|
|
2517
|
+
d.ie && !d.isStrict && (p.left -= isNaN(h) ? 2 : h, p.top -= isNaN(f) ? 2 : f);
|
|
2518
2518
|
} else {
|
|
2519
2519
|
b = o;
|
|
2520
2520
|
do {
|
|
2521
|
-
if (
|
|
2522
|
-
|
|
2521
|
+
if (p.left += b.offsetLeft, p.top += b.offsetTop, d.isWebkit > 0 && u(b, "position") == "fixed") {
|
|
2522
|
+
p.left += l.body.scrollLeft, p.top += l.body.scrollTop;
|
|
2523
2523
|
break;
|
|
2524
2524
|
}
|
|
2525
2525
|
b = b.offsetParent;
|
|
2526
2526
|
} while (b && b != o);
|
|
2527
|
-
for ((d.opera > 0 || d.isWebkit > 0 &&
|
|
2528
|
-
|
|
2527
|
+
for ((d.opera > 0 || d.isWebkit > 0 && u(o, "position") == "absolute") && (p.top -= l.body.offsetTop), b = o.offsetParent; b && b != l.body; )
|
|
2528
|
+
p.left -= b.scrollLeft, (!d.opera || b.tagName != "TR") && (p.top -= b.scrollTop), b = b.offsetParent;
|
|
2529
2529
|
}
|
|
2530
|
-
return
|
|
2530
|
+
return p;
|
|
2531
2531
|
}, r.event = r.event || {}, r.event._listeners = r.event._listeners || [], r.event.on = function(o, l, d) {
|
|
2532
2532
|
l = l.replace(/^on/i, ""), o = r.dom._g(o);
|
|
2533
|
-
var
|
|
2534
|
-
d.call(o,
|
|
2535
|
-
},
|
|
2536
|
-
return l = l.toLowerCase(), v && v[l] && (b = v[l](o, l,
|
|
2533
|
+
var u = function(m) {
|
|
2534
|
+
d.call(o, m);
|
|
2535
|
+
}, p = r.event._listeners, v = r.event._eventFilter, b, y = l;
|
|
2536
|
+
return l = l.toLowerCase(), v && v[l] && (b = v[l](o, l, u), y = b.type, u = b.listener), o.addEventListener ? o.addEventListener(y, u, !1) : o.attachEvent && o.attachEvent("on" + y, u), p[p.length] = [o, l, d, u, y], o;
|
|
2537
2537
|
}, r.on = r.event.on, function() {
|
|
2538
2538
|
var o = s[r.guid];
|
|
2539
2539
|
r.lang.guid = function() {
|
|
@@ -2555,13 +2555,13 @@ var Sr = { exports: {} };
|
|
|
2555
2555
|
}, r.lang.Class.prototype.addEventListener = function(o, l, d) {
|
|
2556
2556
|
if (r.lang.isFunction(l)) {
|
|
2557
2557
|
!this.__listeners && (this.__listeners = {});
|
|
2558
|
-
var
|
|
2558
|
+
var u = this.__listeners, p;
|
|
2559
2559
|
if (typeof d == "string" && d) {
|
|
2560
2560
|
if (/[^\w\-]/.test(d))
|
|
2561
2561
|
throw "nonstandard key:" + d;
|
|
2562
|
-
l.hashCode = d,
|
|
2562
|
+
l.hashCode = d, p = d;
|
|
2563
2563
|
}
|
|
2564
|
-
o.indexOf("on") != 0 && (o = "on" + o), typeof
|
|
2564
|
+
o.indexOf("on") != 0 && (o = "on" + o), typeof u[o] != "object" && (u[o] = {}), p = p || r.lang.guid(), l.hashCode = p, u[o][p] = l;
|
|
2565
2565
|
}
|
|
2566
2566
|
}, r.lang.Class.prototype.removeEventListener = function(o, l) {
|
|
2567
2567
|
if (!(typeof l < "u" && (r.lang.isFunction(l) && !(l = l.hashCode) || !r.lang.isString(l)))) {
|
|
@@ -2571,24 +2571,24 @@ var Sr = { exports: {} };
|
|
|
2571
2571
|
if (typeof l < "u")
|
|
2572
2572
|
d[o][l] && delete d[o][l];
|
|
2573
2573
|
else
|
|
2574
|
-
for (var
|
|
2575
|
-
delete d[o][
|
|
2574
|
+
for (var u in d[o])
|
|
2575
|
+
delete d[o][u];
|
|
2576
2576
|
}
|
|
2577
2577
|
}, r.lang.Class.prototype.dispatchEvent = function(o, l) {
|
|
2578
2578
|
r.lang.isString(o) && (o = new r.lang.Event(o)), !this.__listeners && (this.__listeners = {}), l = l || {};
|
|
2579
2579
|
for (var d in l)
|
|
2580
2580
|
o[d] = l[d];
|
|
2581
|
-
var d,
|
|
2582
|
-
if (o.target = o.target || this, o.currentTarget = this,
|
|
2583
|
-
for (d in
|
|
2584
|
-
|
|
2581
|
+
var d, u = this.__listeners, p = o.type;
|
|
2582
|
+
if (o.target = o.target || this, o.currentTarget = this, p.indexOf("on") != 0 && (p = "on" + p), r.lang.isFunction(this[p]) && this[p].apply(this, arguments), typeof u[p] == "object")
|
|
2583
|
+
for (d in u[p])
|
|
2584
|
+
u[p][d].apply(this, arguments);
|
|
2585
2585
|
return o.returnValue;
|
|
2586
2586
|
}, r.lang.inherits = function(o, l, d) {
|
|
2587
|
-
var
|
|
2588
|
-
b.prototype = l.prototype,
|
|
2589
|
-
for (
|
|
2590
|
-
|
|
2591
|
-
o.prototype.constructor = o, o.superClass = l.prototype, typeof d == "string" && (
|
|
2587
|
+
var u, p, v = o.prototype, b = new Function();
|
|
2588
|
+
b.prototype = l.prototype, p = o.prototype = new b();
|
|
2589
|
+
for (u in v)
|
|
2590
|
+
p[u] = v[u];
|
|
2591
|
+
o.prototype.constructor = o, o.superClass = l.prototype, typeof d == "string" && (p._className = d);
|
|
2592
2592
|
}, r.inherits = r.lang.inherits;
|
|
2593
2593
|
var n = "http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m", a = "png", c = function(o, l, d) {
|
|
2594
2594
|
try {
|
|
@@ -2617,8 +2617,8 @@ var Sr = { exports: {} };
|
|
|
2617
2617
|
}, c.prototype.setPosition = function(o) {
|
|
2618
2618
|
o && (!this._position || !this._position.equals(o)) && (this._position = o, this._updatePosition());
|
|
2619
2619
|
}, c.prototype.getStyleByText = function(o, l) {
|
|
2620
|
-
var d = parseInt(o),
|
|
2621
|
-
return
|
|
2620
|
+
var d = parseInt(o), u = parseInt(d / 10);
|
|
2621
|
+
return u = Math.max(0, u), u = Math.min(u, l.length - 1), l[u];
|
|
2622
2622
|
}, c.prototype._updateCss = function() {
|
|
2623
2623
|
if (this._domElement) {
|
|
2624
2624
|
var o = this.getStyleByText(this._text, this._styles);
|
|
@@ -2632,33 +2632,33 @@ var Sr = { exports: {} };
|
|
|
2632
2632
|
l.x -= Math.ceil(parseInt(o.width) / 2), l.y -= Math.ceil(parseInt(o.height) / 2), o.left = l.x + "px", o.top = l.y + "px";
|
|
2633
2633
|
}
|
|
2634
2634
|
}, c.prototype._buildCssText = function(o) {
|
|
2635
|
-
var l = o.url, d = o.size,
|
|
2635
|
+
var l = o.url, d = o.size, u = o.anchor, p = o.offset, v = o.textColor || "black", b = o.textSize || 10, y = [];
|
|
2636
2636
|
if (this._zIndex && y.push("z-index:" + this._zIndex + ";"), e.browser.ie < 7)
|
|
2637
2637
|
y.push('filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="' + l + '");');
|
|
2638
2638
|
else {
|
|
2639
2639
|
y.push("background-image:url(" + l + ");");
|
|
2640
|
-
var
|
|
2641
|
-
|
|
2640
|
+
var m = "0 0";
|
|
2641
|
+
p instanceof BMap.Size && (m = p.width + "px " + p.height + "px"), y.push("background-position:" + m + ";");
|
|
2642
2642
|
}
|
|
2643
|
-
return d instanceof BMap.Size && (
|
|
2643
|
+
return d instanceof BMap.Size && (u instanceof BMap.Size ? (u.height > 0 && u.height < d.height && y.push("height:" + (d.height - u.height) + "px; padding-top:" + u.height + "px;"), u.width > 0 && u.width < d.width && y.push("width:" + (d.width - u.width) + "px; padding-left:" + u.width + "px;")) : (y.push("height:" + d.height + "px; line-height:" + d.height + "px;"), y.push("width:" + d.width + "px; text-align:center;"))), y.push("cursor:pointer; color:" + v + "; position:absolute; font-size:" + b + "px; font-family:Arial,sans-serif; font-weight:bold"), y.join("");
|
|
2644
2644
|
}, c.prototype._bind = function() {
|
|
2645
2645
|
if (!this._domElement)
|
|
2646
2646
|
return;
|
|
2647
2647
|
var o = this, l = this._map, d = e.lang.Event;
|
|
2648
|
-
function
|
|
2649
|
-
var b =
|
|
2650
|
-
if (
|
|
2648
|
+
function u(p, v) {
|
|
2649
|
+
var b = p.srcElement || p.target, y = p.clientX || p.pageX, m = p.clientY || p.pageY;
|
|
2650
|
+
if (p && v && y && m && b) {
|
|
2651
2651
|
var h = e.dom.getPosition(l.getContainer());
|
|
2652
|
-
v.pixel = new BMap.Pixel(y - h.left,
|
|
2652
|
+
v.pixel = new BMap.Pixel(y - h.left, m - h.top), v.point = l.pixelToPoint(v.pixel);
|
|
2653
2653
|
}
|
|
2654
2654
|
return v;
|
|
2655
2655
|
}
|
|
2656
|
-
e.event.on(this._domElement, "mouseover", function(
|
|
2657
|
-
o.dispatchEvent(
|
|
2658
|
-
}), e.event.on(this._domElement, "mouseout", function(
|
|
2659
|
-
o.dispatchEvent(
|
|
2660
|
-
}), e.event.on(this._domElement, "click", function(
|
|
2661
|
-
o.dispatchEvent(
|
|
2656
|
+
e.event.on(this._domElement, "mouseover", function(p) {
|
|
2657
|
+
o.dispatchEvent(u(p, new d("onmouseover")));
|
|
2658
|
+
}), e.event.on(this._domElement, "mouseout", function(p) {
|
|
2659
|
+
o.dispatchEvent(u(p, new d("onmouseout")));
|
|
2660
|
+
}), e.event.on(this._domElement, "click", function(p) {
|
|
2661
|
+
o.dispatchEvent(u(p, new d("onclick")));
|
|
2662
2662
|
});
|
|
2663
2663
|
}, c;
|
|
2664
2664
|
});
|
|
@@ -2977,7 +2977,7 @@ class Li extends Rr {
|
|
|
2977
2977
|
constructor(e, r) {
|
|
2978
2978
|
var n;
|
|
2979
2979
|
super(e);
|
|
2980
|
-
|
|
2980
|
+
g(this, "inner");
|
|
2981
2981
|
this.inner = new x(e.innerMap, {
|
|
2982
2982
|
// baidu的构造器中的markers, 会触发重绘, 会导致使用旧的calculator计算cluster
|
|
2983
2983
|
// markers: options.markers?.map(it => (it as BaiduMarker).innerOverlay),
|
|
@@ -2999,7 +2999,7 @@ class Bi extends Rr {
|
|
|
2999
2999
|
constructor(e, r) {
|
|
3000
3000
|
var n, a;
|
|
3001
3001
|
super(e);
|
|
3002
|
-
|
|
3002
|
+
g(this, "inner");
|
|
3003
3003
|
this.inner = new wi(
|
|
3004
3004
|
e.innerMap,
|
|
3005
3005
|
// google的构造器中的markers,不会触发重绘, 第一次绘制通过监听地图的'idle'事件触发, 可以直接设置
|
|
@@ -3031,7 +3031,7 @@ class $r {
|
|
|
3031
3031
|
class Ii extends $r {
|
|
3032
3032
|
constructor(e, r) {
|
|
3033
3033
|
super();
|
|
3034
|
-
|
|
3034
|
+
g(this, "inner");
|
|
3035
3035
|
this.map = e, this.inner = new google.maps.places.PlacesService(e.innerMap);
|
|
3036
3036
|
}
|
|
3037
3037
|
search(e, r) {
|
|
@@ -3077,8 +3077,8 @@ class Ii extends $r {
|
|
|
3077
3077
|
class Si extends $r {
|
|
3078
3078
|
constructor(e, r) {
|
|
3079
3079
|
super();
|
|
3080
|
-
|
|
3081
|
-
|
|
3080
|
+
g(this, "searchRequestMap", /* @__PURE__ */ new Map());
|
|
3081
|
+
g(this, "currentSearch");
|
|
3082
3082
|
this.map = e;
|
|
3083
3083
|
}
|
|
3084
3084
|
get inner() {
|
|
@@ -3112,16 +3112,16 @@ class Si extends $r {
|
|
|
3112
3112
|
case BMAP_STATUS_SUCCESS: {
|
|
3113
3113
|
const l = [];
|
|
3114
3114
|
for (let d = 0; d < c.getCurrentNumPois(); d++) {
|
|
3115
|
-
const
|
|
3115
|
+
const u = c.getPoi(d);
|
|
3116
3116
|
l.push({
|
|
3117
|
-
id:
|
|
3118
|
-
city:
|
|
3117
|
+
id: u.uid,
|
|
3118
|
+
city: u.city,
|
|
3119
3119
|
country: "",
|
|
3120
3120
|
// 百度地图只支持中国
|
|
3121
|
-
position: O.fromBaidu(
|
|
3122
|
-
province:
|
|
3123
|
-
title:
|
|
3124
|
-
address:
|
|
3121
|
+
position: O.fromBaidu(u.point, this.map.coordType),
|
|
3122
|
+
province: u.province,
|
|
3123
|
+
title: u.title,
|
|
3124
|
+
address: u.address
|
|
3125
3125
|
});
|
|
3126
3126
|
}
|
|
3127
3127
|
s(l);
|
|
@@ -3142,8 +3142,8 @@ class Si extends $r {
|
|
|
3142
3142
|
}
|
|
3143
3143
|
class zr {
|
|
3144
3144
|
constructor(t, e) {
|
|
3145
|
-
|
|
3146
|
-
|
|
3145
|
+
g(this, "onData");
|
|
3146
|
+
g(this, "onError");
|
|
3147
3147
|
this.map = t, this.input = e;
|
|
3148
3148
|
}
|
|
3149
3149
|
/**
|
|
@@ -3158,7 +3158,7 @@ class zr {
|
|
|
3158
3158
|
class ki extends zr {
|
|
3159
3159
|
constructor(e, r) {
|
|
3160
3160
|
super(e, r.input);
|
|
3161
|
-
|
|
3161
|
+
g(this, "searchBox");
|
|
3162
3162
|
this.searchBox = new google.maps.places.SearchBox(r.input), this.searchBox.bindTo("bounds", e.innerMap);
|
|
3163
3163
|
}
|
|
3164
3164
|
setSearchListener(e, r) {
|
|
@@ -3174,8 +3174,8 @@ class ki extends zr {
|
|
|
3174
3174
|
class Ai extends zr {
|
|
3175
3175
|
constructor(e, r) {
|
|
3176
3176
|
super(e, r.input);
|
|
3177
|
-
|
|
3178
|
-
|
|
3177
|
+
g(this, "autocomplete");
|
|
3178
|
+
g(this, "placesService");
|
|
3179
3179
|
this.autocomplete = e.createAutocomplete({ input: r.input, bindToMap: !0 }), this.placesService = e.createPlacesService({});
|
|
3180
3180
|
}
|
|
3181
3181
|
setSearchListener(e, r) {
|
|
@@ -3193,9 +3193,9 @@ class Ai extends zr {
|
|
|
3193
3193
|
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 || {});
|
|
3194
3194
|
class Nt {
|
|
3195
3195
|
constructor(t) {
|
|
3196
|
-
|
|
3196
|
+
g(this, "latestInfoWindow");
|
|
3197
3197
|
/** 使用{@link setEventTargetDelegate}初始化 */
|
|
3198
|
-
|
|
3198
|
+
g(this, "delegate", void 0);
|
|
3199
3199
|
this.element = t, process.env.NODE_ENV !== "production" && setTimeout(() => {
|
|
3200
3200
|
this.delegate || console.warn(`${this.constructor.name}继承了AbstractMap, 但未调用setEventTargetDelegate(delegate)`);
|
|
3201
3201
|
});
|
|
@@ -3333,47 +3333,47 @@ function Zr(i) {
|
|
|
3333
3333
|
}
|
|
3334
3334
|
var ce;
|
|
3335
3335
|
((i) => {
|
|
3336
|
-
function t(d,
|
|
3337
|
-
return d.reduce((
|
|
3336
|
+
function t(d, u) {
|
|
3337
|
+
return d.reduce((p, v) => (p[u(v)] = v, p), {});
|
|
3338
3338
|
}
|
|
3339
3339
|
i.fromArray = t;
|
|
3340
3340
|
function e(d) {
|
|
3341
|
-
return d.reduce((
|
|
3341
|
+
return d.reduce((u, p) => (u[p[0]] = p[1], u), {});
|
|
3342
3342
|
}
|
|
3343
3343
|
i.fromEntries = e;
|
|
3344
3344
|
function r(d) {
|
|
3345
|
-
return JSON.stringify(d, (
|
|
3345
|
+
return JSON.stringify(d, (u, p) => typeof p == "object" && Object.getPrototypeOf(p) !== Object.prototype ? p.toString !== Object.prototype.toString ? p.toString() : `[object ${Object.getPrototypeOf(p).constructor.name}]` : p);
|
|
3346
3346
|
}
|
|
3347
3347
|
i.toJsonSafely = r;
|
|
3348
3348
|
function s(d) {
|
|
3349
|
-
Zr(d) && Object.keys(d).forEach((
|
|
3350
|
-
d[
|
|
3349
|
+
Zr(d) && Object.keys(d).forEach((u) => {
|
|
3350
|
+
d[u] === void 0 ? delete d[u] : s(d[u]);
|
|
3351
3351
|
});
|
|
3352
3352
|
}
|
|
3353
3353
|
i.deleteUndefinedPropertyOnPlainObjectDeeply = s;
|
|
3354
|
-
function n(d,
|
|
3355
|
-
let v = d[
|
|
3356
|
-
return v === void 0 && (v =
|
|
3354
|
+
function n(d, u, p) {
|
|
3355
|
+
let v = d[u];
|
|
3356
|
+
return v === void 0 && (v = p(), d[u] = v), v;
|
|
3357
3357
|
}
|
|
3358
3358
|
i.putIfAbsent = n;
|
|
3359
|
-
function a(d, ...
|
|
3360
|
-
const
|
|
3359
|
+
function a(d, ...u) {
|
|
3360
|
+
const p = ur(u), v = {};
|
|
3361
3361
|
for (const b in d)
|
|
3362
|
-
|
|
3362
|
+
p(b) || (v[b] = d[b]);
|
|
3363
3363
|
return v;
|
|
3364
3364
|
}
|
|
3365
3365
|
i.omit = a;
|
|
3366
|
-
function c(d, ...
|
|
3367
|
-
const
|
|
3366
|
+
function c(d, ...u) {
|
|
3367
|
+
const p = ur(u), v = {};
|
|
3368
3368
|
for (const b in d)
|
|
3369
|
-
|
|
3369
|
+
p(b) && (v[b] = d[b]);
|
|
3370
3370
|
return v;
|
|
3371
3371
|
}
|
|
3372
3372
|
i.pick = c;
|
|
3373
|
-
function o(d,
|
|
3374
|
-
const
|
|
3373
|
+
function o(d, u) {
|
|
3374
|
+
const p = typeof u == "string" ? u.split(".") : u;
|
|
3375
3375
|
let v = d;
|
|
3376
|
-
for (const b of
|
|
3376
|
+
for (const b of p) {
|
|
3377
3377
|
if (v == null)
|
|
3378
3378
|
return;
|
|
3379
3379
|
v = v[b];
|
|
@@ -3381,8 +3381,8 @@ var ce;
|
|
|
3381
3381
|
return v;
|
|
3382
3382
|
}
|
|
3383
3383
|
i.get = o;
|
|
3384
|
-
function l(d,
|
|
3385
|
-
const
|
|
3384
|
+
function l(d, u) {
|
|
3385
|
+
const p = typeof u == "string" ? u.split(".") : u, v = o(d, p.slice(0, -1)), b = p[p.length - 1];
|
|
3386
3386
|
v != null && delete v[b];
|
|
3387
3387
|
}
|
|
3388
3388
|
i.del = l;
|
|
@@ -3410,7 +3410,7 @@ var ee = /* @__PURE__ */ ((i) => (i.auto = "auto", i.none = "none", i.greedy = "
|
|
|
3410
3410
|
})(Ct || (Ct = {}));
|
|
3411
3411
|
class Wr {
|
|
3412
3412
|
constructor(t, e) {
|
|
3413
|
-
|
|
3413
|
+
g(this, "_delegate");
|
|
3414
3414
|
this.innerOverlay = t, this.coordType = e;
|
|
3415
3415
|
}
|
|
3416
3416
|
get delegate() {
|
|
@@ -3494,7 +3494,7 @@ const Ae = class Ae extends lt {
|
|
|
3494
3494
|
* - 透明度为0.7和0.8时, 在maintain的发布模式下, polyline的线条会不可见 (原因未知, 在tg-map中无法复现)
|
|
3495
3495
|
* 故统一加个0.001, 规避这些问题...
|
|
3496
3496
|
*/
|
|
3497
|
-
|
|
3497
|
+
g(Ae, "OPACITY_DELTA", 1e-3);
|
|
3498
3498
|
let j = Ae;
|
|
3499
3499
|
class ht extends Gt {
|
|
3500
3500
|
isEditable() {
|
|
@@ -3522,22 +3522,22 @@ class ht extends Gt {
|
|
|
3522
3522
|
class Zt extends j {
|
|
3523
3523
|
constructor() {
|
|
3524
3524
|
super(...arguments);
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3525
|
+
g(this, "prevCenter");
|
|
3526
|
+
g(this, "prevRadius");
|
|
3527
|
+
g(this, "isDoingSetCenter", !1);
|
|
3528
|
+
g(this, "isDoingSetRadius", !1);
|
|
3529
|
+
g(this, "eventHubDelegate");
|
|
3530
|
+
g(this, "onRadiusChanged", () => {
|
|
3531
3531
|
var r;
|
|
3532
3532
|
const e = this.innerOverlay.getRadius();
|
|
3533
3533
|
this.prevRadius !== e && (this.isDoingSetRadius || (r = this.eventHubDelegate) == null || r.notify({ type: "radius-changed", target: this }), this.prevRadius = e);
|
|
3534
3534
|
});
|
|
3535
|
-
|
|
3535
|
+
g(this, "onCenterChanged", () => {
|
|
3536
3536
|
var r;
|
|
3537
3537
|
const e = this.innerOverlay.getCenter();
|
|
3538
3538
|
this.prevCenter !== e && (this.isDoingSetCenter || (r = this.eventHubDelegate) == null || r.notify({ type: "center-changed", target: this }), this.prevCenter = e);
|
|
3539
3539
|
});
|
|
3540
|
-
|
|
3540
|
+
g(this, "resetEditableTimeoutId");
|
|
3541
3541
|
}
|
|
3542
3542
|
static create(e) {
|
|
3543
3543
|
const r = this.coordType, s = new BMap.Circle(e.center.toBaidu(r), e.radius, {
|
|
@@ -3634,18 +3634,20 @@ function Qi() {
|
|
|
3634
3634
|
constructor(r, s = i, n = le.ZERO, a, c = 654, o = "") {
|
|
3635
3635
|
super();
|
|
3636
3636
|
// 类表达式不能有私有成员, 故改成public
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3637
|
+
g(this, "container");
|
|
3638
|
+
g(this, "border");
|
|
3639
|
+
g(this, "inner");
|
|
3640
|
+
g(this, "map");
|
|
3641
|
+
g(this, "marker");
|
|
3642
3642
|
this.content = r, this.position = s, this.offset = n;
|
|
3643
3643
|
const l = "baidu-info-box-container";
|
|
3644
|
-
this.container = document.createElement("div"), this.container.className = l, this.container.style.position = "absolute"
|
|
3645
|
-
const d =
|
|
3646
|
-
|
|
3644
|
+
this.container = document.createElement("div"), this.container.className = l, this.container.style.position = "absolute";
|
|
3645
|
+
const d = (p) => p.stopPropagation();
|
|
3646
|
+
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 = `${l}__border ${o}`, this.inner = document.createElement("div"), this.inner.className = l + "__inner";
|
|
3647
|
+
const u = document.createElement("span");
|
|
3648
|
+
u.className = l + "__close", u.addEventListener("click", () => {
|
|
3647
3649
|
this.close(), this.dispatchEvent({ type: "onclickclose" });
|
|
3648
|
-
}), this.inner.appendChild(r), this.border.appendChild(this.inner), this.border.appendChild(
|
|
3650
|
+
}), this.inner.appendChild(r), this.border.appendChild(this.inner), this.border.appendChild(u), this.container.appendChild(this.border), a && this.setZIndex(a), this.setMaxWidth(c), this.onMarkerPositionChanged = this.onMarkerPositionChanged.bind(this);
|
|
3649
3651
|
}
|
|
3650
3652
|
initialize(r) {
|
|
3651
3653
|
return this.map = r, r.getPanes().floatPane.appendChild(this.container), this.container;
|
|
@@ -3737,8 +3739,8 @@ class Vt extends Ht {
|
|
|
3737
3739
|
class jt extends Ht {
|
|
3738
3740
|
constructor(e, r) {
|
|
3739
3741
|
super(new ye(e, r));
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
+
g(this, "eventHub", new Tr());
|
|
3743
|
+
g(this, "isOpened", !1);
|
|
3742
3744
|
this.inner = e, this.map = r, e.addListener("closeclick", () => {
|
|
3743
3745
|
this.isOpened = !1, this.eventHub.hasListener("close") && this.eventHub.notify({ type: "close", target: this });
|
|
3744
3746
|
}), e.addListener("map_changed", () => {
|
|
@@ -3936,11 +3938,11 @@ var Ne = /* @__PURE__ */ ((i) => (i.map = "map", i.overlay = "overlay", i.overla
|
|
|
3936
3938
|
})(Ge || (Ge = {}));
|
|
3937
3939
|
class ts {
|
|
3938
3940
|
constructor(t, e) {
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3941
|
+
g(this, "baidu");
|
|
3942
|
+
g(this, "google");
|
|
3943
|
+
g(this, "projection");
|
|
3944
|
+
g(this, "element", void 0);
|
|
3945
|
+
g(this, "mapPane");
|
|
3944
3946
|
this.map = t, this.mapPane = e.mapPane;
|
|
3945
3947
|
}
|
|
3946
3948
|
create() {
|
|
@@ -4015,7 +4017,7 @@ function is() {
|
|
|
4015
4017
|
return class extends google.maps.OverlayView {
|
|
4016
4018
|
constructor(e, r, s, n = Ne.overlayMouseTarget, a) {
|
|
4017
4019
|
super();
|
|
4018
|
-
|
|
4020
|
+
g(this, "container");
|
|
4019
4021
|
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", () => {
|
|
4020
4022
|
google.maps.event.trigger(this, "click");
|
|
4021
4023
|
}), this.setElement(e);
|
|
@@ -4083,10 +4085,10 @@ var Te;
|
|
|
4083
4085
|
class Yt extends lt {
|
|
4084
4086
|
constructor(e, r, s, n) {
|
|
4085
4087
|
super(e, r, s);
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4088
|
+
g(this, "icon");
|
|
4089
|
+
g(this, "iconAnchor");
|
|
4090
|
+
g(this, "content", void 0);
|
|
4091
|
+
g(this, "contentObserver");
|
|
4090
4092
|
this.setContentInternal(n, !0);
|
|
4091
4093
|
}
|
|
4092
4094
|
static create(e) {
|
|
@@ -4152,7 +4154,7 @@ class Yt extends lt {
|
|
|
4152
4154
|
width: e.style.anchor.width + o.x,
|
|
4153
4155
|
height: e.style.anchor.height + o.y
|
|
4154
4156
|
}, process.env.NODE_ENV !== "production" && setTimeout(() => {
|
|
4155
|
-
var
|
|
4157
|
+
var u, p;
|
|
4156
4158
|
if (me(e.__icon__, `${e}必须是由'SymbolIcon.toBaidu()'创建的`), !e.anchor) {
|
|
4157
4159
|
console.log("BaiduLabelOverlay.attachIcon", "Bmap.Symbol.anchor尚未计算完成");
|
|
4158
4160
|
return;
|
|
@@ -4160,8 +4162,8 @@ class Yt extends lt {
|
|
|
4160
4162
|
const l = e.anchor.width - e.style.anchor.width, d = e.anchor.height - e.style.anchor.height;
|
|
4161
4163
|
if (o.x !== l || o.y !== d) {
|
|
4162
4164
|
const v = [
|
|
4163
|
-
(
|
|
4164
|
-
(
|
|
4165
|
+
(u = e.__icon__.anchor) == null ? void 0 : u.x,
|
|
4166
|
+
(p = e.__icon__.anchor) == null ? void 0 : p.y,
|
|
4165
4167
|
e.__icon__.rotation,
|
|
4166
4168
|
e.__icon__.scale,
|
|
4167
4169
|
e.__icon__.strokeWeight
|
|
@@ -4371,10 +4373,10 @@ class Ze extends lt {
|
|
|
4371
4373
|
class Kt extends Gt {
|
|
4372
4374
|
constructor() {
|
|
4373
4375
|
super(...arguments);
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4376
|
+
g(this, "label");
|
|
4377
|
+
g(this, "labelPositionListener");
|
|
4378
|
+
g(this, "labelVisibleListener");
|
|
4379
|
+
g(this, "labelMapChangedListener");
|
|
4378
4380
|
}
|
|
4379
4381
|
static create(e) {
|
|
4380
4382
|
const r = this.coordType, s = e.icon, n = {
|
|
@@ -4447,10 +4449,10 @@ class Kt extends Gt {
|
|
|
4447
4449
|
class Xt extends j {
|
|
4448
4450
|
constructor() {
|
|
4449
4451
|
super(...arguments);
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4452
|
+
g(this, "eventHubDelegate");
|
|
4453
|
+
g(this, "prevPath");
|
|
4454
|
+
g(this, "isDoingSetPath", !1);
|
|
4455
|
+
g(this, "onLineUpdate", () => {
|
|
4454
4456
|
var r;
|
|
4455
4457
|
const e = this.innerOverlay.getPath();
|
|
4456
4458
|
e !== this.prevPath && (this.isDoingSetPath || (r = this.eventHubDelegate) == null || r.notify({
|
|
@@ -4483,7 +4485,7 @@ class Xt extends j {
|
|
|
4483
4485
|
class Jt extends Xt {
|
|
4484
4486
|
constructor() {
|
|
4485
4487
|
super(...arguments);
|
|
4486
|
-
|
|
4488
|
+
g(this, "pathEditedEventType", "path-edited");
|
|
4487
4489
|
}
|
|
4488
4490
|
static create(e) {
|
|
4489
4491
|
var n, a;
|
|
@@ -4526,8 +4528,8 @@ class Jt extends Xt {
|
|
|
4526
4528
|
class Qt extends ht {
|
|
4527
4529
|
constructor() {
|
|
4528
4530
|
super(...arguments);
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
+
g(this, "pathChangedListeners");
|
|
4532
|
+
g(this, "eventHubDelegate");
|
|
4531
4533
|
}
|
|
4532
4534
|
static create(e) {
|
|
4533
4535
|
var n;
|
|
@@ -4575,7 +4577,7 @@ class Qt extends ht {
|
|
|
4575
4577
|
class er extends Xt {
|
|
4576
4578
|
constructor() {
|
|
4577
4579
|
super(...arguments);
|
|
4578
|
-
|
|
4580
|
+
g(this, "pathEditedEventType", "paths-edited");
|
|
4579
4581
|
}
|
|
4580
4582
|
static create(e) {
|
|
4581
4583
|
const r = this.coordType;
|
|
@@ -4601,8 +4603,8 @@ class er extends Xt {
|
|
|
4601
4603
|
class tr extends ht {
|
|
4602
4604
|
constructor() {
|
|
4603
4605
|
super(...arguments);
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
+
g(this, "pathChangedListeners");
|
|
4607
|
+
g(this, "eventHubDelegate");
|
|
4606
4608
|
}
|
|
4607
4609
|
static create(e) {
|
|
4608
4610
|
const r = this.coordType, s = new google.maps.Polygon({
|
|
@@ -4655,9 +4657,9 @@ class tr extends ht {
|
|
|
4655
4657
|
class rr extends Xt {
|
|
4656
4658
|
constructor(e, r, s, n) {
|
|
4657
4659
|
super(e, r, s, n);
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4660
|
+
g(this, "pathEditedEventType", "bounds-changed");
|
|
4661
|
+
g(this, "isDoingUpdateRectangle", !1);
|
|
4662
|
+
g(this, "onBoundsChanged", ({ originalEvent: e }) => {
|
|
4661
4663
|
if (this.isDoingUpdateRectangle)
|
|
4662
4664
|
return;
|
|
4663
4665
|
const r = e.prevPath ?? [], s = e.path;
|
|
@@ -4668,9 +4670,9 @@ class rr extends Xt {
|
|
|
4668
4670
|
if (a > r.length) {
|
|
4669
4671
|
for (let o = 0; o < a; o++)
|
|
4670
4672
|
if (r[o] == null || !pr.equals(s[o], r[o])) {
|
|
4671
|
-
const l = s[(o - 2 + a) % a], d = s[(o - 1 + a) % a],
|
|
4673
|
+
const l = s[(o - 2 + a) % a], d = s[(o - 1 + a) % a], u = s[o], p = s[(o + 1) % a], v = s[(o + 2) % a];
|
|
4672
4674
|
let b;
|
|
4673
|
-
d.lat ===
|
|
4675
|
+
d.lat === p.lat ? b = new BMap.Point(d.lng, u.lat) : d.lng === p.lng ? b = new BMap.Point(u.lng, d.lat) : b = u, n = [l, v, b];
|
|
4674
4676
|
break;
|
|
4675
4677
|
}
|
|
4676
4678
|
} else if (a === r.length) {
|
|
@@ -4740,21 +4742,21 @@ class ss extends Nt {
|
|
|
4740
4742
|
constructor(e, r) {
|
|
4741
4743
|
var s;
|
|
4742
4744
|
super(e);
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4745
|
+
g(this, "buildInMapTypeId2BIMT");
|
|
4746
|
+
g(this, "baiduMapType2BIMT");
|
|
4747
|
+
g(this, "map");
|
|
4748
|
+
g(this, "createLabel", Yt.create);
|
|
4749
|
+
g(this, "createCircle", Zt.create);
|
|
4750
|
+
g(this, "createPolygon", er.create);
|
|
4751
|
+
g(this, "createPolyline", Jt.create);
|
|
4752
|
+
g(this, "createRectangle", rr.create);
|
|
4753
|
+
g(this, "createInfoWindow", Vt.create);
|
|
4754
|
+
g(this, "createInfoBox", Ft.create);
|
|
4755
|
+
g(this, "createMarker", Ze.create);
|
|
4756
|
+
g(this, "createMapTypeControl", It.create);
|
|
4757
|
+
g(this, "createZoomControl", Rt.create);
|
|
4758
|
+
g(this, "createStreetViewControl", At.create);
|
|
4759
|
+
g(this, "createScaleControl", St.create);
|
|
4758
4760
|
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, {
|
|
4759
4761
|
minZoom: r.minZoom && r.minZoom + de,
|
|
4760
4762
|
maxZoom: r.maxZoom && r.maxZoom + de,
|
|
@@ -4888,8 +4890,8 @@ class ss extends Nt {
|
|
|
4888
4890
|
const r = class extends BMap.Control {
|
|
4889
4891
|
constructor() {
|
|
4890
4892
|
super(...arguments);
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
+
g(this, "defaultAnchor", U.getBaidu().toValue(e.position));
|
|
4894
|
+
g(this, "defaultOffset", new BMap.Size(0, 0));
|
|
4893
4895
|
}
|
|
4894
4896
|
initialize(n) {
|
|
4895
4897
|
const a = e.onCreateElement();
|
|
@@ -4925,21 +4927,21 @@ class ns extends Nt {
|
|
|
4925
4927
|
constructor(e, r) {
|
|
4926
4928
|
var n, a;
|
|
4927
4929
|
super(e);
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
|
|
4930
|
+
g(this, "buildInMapTypeId2BIMT");
|
|
4931
|
+
g(this, "googleMapTypeId2BIMT");
|
|
4932
|
+
g(this, "map");
|
|
4933
|
+
g(this, "createLabel", qt.create);
|
|
4934
|
+
g(this, "createCircle", Wt.create);
|
|
4935
|
+
g(this, "createPolygon", tr.create);
|
|
4936
|
+
g(this, "createPolyline", Qt.create);
|
|
4937
|
+
g(this, "createRectangle", ir.create);
|
|
4938
|
+
g(this, "createInfoWindow", jt.create);
|
|
4939
|
+
g(this, "createInfoBox", Ut.create);
|
|
4940
|
+
g(this, "createMarker", Kt.create);
|
|
4941
|
+
g(this, "createMapTypeControl", Tt.create);
|
|
4942
|
+
g(this, "createZoomControl", $t.create);
|
|
4943
|
+
g(this, "createStreetViewControl", Dt.create);
|
|
4944
|
+
g(this, "createScaleControl", kt.create);
|
|
4943
4945
|
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);
|
|
4944
4946
|
const s = r.buildInMapTypeId && this.buildInMapTypeId2BIMT.get(r.buildInMapTypeId);
|
|
4945
4947
|
this.map = new google.maps.Map(e, {
|
|
@@ -5119,8 +5121,8 @@ class ls extends Nt {
|
|
|
5119
5121
|
constructor(e, r) {
|
|
5120
5122
|
var a;
|
|
5121
5123
|
super(e);
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
+
g(this, "map");
|
|
5125
|
+
g(this, "defaultLayers");
|
|
5124
5126
|
this.mapOptions = r;
|
|
5125
5127
|
const s = jr().here;
|
|
5126
5128
|
tt.includes(s.version) || B(`不支持${s.version}, HereMap当前只支持如下版本: ${tt}`);
|
|
@@ -6700,21 +6702,21 @@ function rn(i, t) {
|
|
|
6700
6702
|
let n = Math.sin(r), a = Math.sin(s), c = Math.sin(e);
|
|
6701
6703
|
const o = tn, l = 1 / 298.257;
|
|
6702
6704
|
n = n * n, a = a * a, c = c * c;
|
|
6703
|
-
const d = n * (1 - a) + (1 - c) * a,
|
|
6704
|
-
return b * (1 + l * (y * c * (1 - n) -
|
|
6705
|
+
const d = n * (1 - a) + (1 - c) * a, u = (1 - n) * (1 - a) + c * a, p = Math.atan(Math.sqrt(d / u)), v = Math.sqrt(d * u) / p, b = 2 * p * o, y = (3 * v - 1) / 2 / u, m = (3 * v + 1) / 2 / d;
|
|
6706
|
+
return b * (1 + l * (y * c * (1 - n) - m * (1 - c) * n));
|
|
6705
6707
|
}
|
|
6706
6708
|
function sn(i, t, e) {
|
|
6707
|
-
const s = 63567523142e-4, n = 1 / 298.257223563, a = Ie(t), c = Math.sin(a), o = Math.cos(a), l = (1 - n) * Math.tan(Ie(i.lat)), d = 1 / Math.sqrt(1 + l * l),
|
|
6708
|
-
let f = 0, M = 0, T = 0, C = e / (s *
|
|
6709
|
+
const s = 63567523142e-4, n = 1 / 298.257223563, a = Ie(t), c = Math.sin(a), o = Math.cos(a), l = (1 - n) * Math.tan(Ie(i.lat)), d = 1 / Math.sqrt(1 + l * l), u = l * d, p = Math.atan2(l, o), v = d * c, b = 1 - v * v, y = b * (6378137 * 6378137 - s * s) / (s * s), m = 1 + y / 16384 * (4096 + y * (-768 + y * (320 - 175 * y))), h = y / 1024 * (256 + y * (-128 + y * (74 - 47 * y)));
|
|
6710
|
+
let f = 0, M = 0, T = 0, C = e / (s * m), w = 2 * Math.PI;
|
|
6709
6711
|
for (; Math.abs(C - w) > 1e-12; ) {
|
|
6710
|
-
f = Math.cos(2 *
|
|
6712
|
+
f = Math.cos(2 * p + C), M = Math.sin(C), T = Math.cos(C);
|
|
6711
6713
|
const G = h * M * (f + h / 4 * (T * (-1 + 2 * f * f) - h / 6 * f * (-3 + 4 * M * M) * (-3 + 4 * f * f)));
|
|
6712
|
-
w = C, C = e / (s *
|
|
6714
|
+
w = C, C = e / (s * m) + G;
|
|
6713
6715
|
}
|
|
6714
|
-
const E =
|
|
6715
|
-
|
|
6716
|
+
const E = u * M - d * T * o, D = Math.atan2(
|
|
6717
|
+
u * T + d * M * o,
|
|
6716
6718
|
(1 - n) * Math.sqrt(v * v + E * E)
|
|
6717
|
-
), N = Math.atan2(M * c, d * T -
|
|
6719
|
+
), N = Math.atan2(M * c, d * T - u * M * o), L = n / 16 * b * (4 + n * (4 - 3 * b)), J = N - (1 - L) * n * v * (C + L * M * (f + L * T * (-1 + 2 * f * f)));
|
|
6718
6720
|
return { lng: i.lng + mr(J), lat: mr(D) };
|
|
6719
6721
|
}
|
|
6720
6722
|
const xn = {
|