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