tg-map-vue3 3.6.4 → 3.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/dist/src/components/overlays/TgMarker.vue.d.ts +6 -0
- package/dist/src/map/lat-lng.d.ts +27 -1
- package/dist/src/map/map/extra/marker-clusterer.d.ts +5 -1
- package/dist/src/map/map/overlay/marker.d.ts +10 -0
- package/dist/tg-map.js +232 -195
- package/dist/tg-map.js.map +1 -1
- package/dist/tg-map.umd.cjs +3 -3
- package/dist/tg-map.umd.cjs.map +1 -1
- package/package.json +2 -2
package/dist/tg-map.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
var Ir = Object.defineProperty;
|
|
3
3
|
var Sr = (i, t, e) => t in i ? Ir(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
4
4
|
var c = (i, t, e) => (Sr(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
5
|
-
import { createCommentVNode as Je, computed as Yt, defineComponent as w, markRaw as Ar, watch as qt, openBlock as V, createElementBlock as F, mergeProps as ue, createElementVNode as Rr, normalizeClass as Ze, renderSlot as W, normalizeStyle as $r, getCurrentInstance as
|
|
5
|
+
import { createCommentVNode as Je, computed as Yt, defineComponent as w, markRaw as Ar, watch as qt, openBlock as V, createElementBlock as F, mergeProps as ue, createElementVNode as Rr, normalizeClass as Ze, renderSlot as W, normalizeStyle as $r, getCurrentInstance as zr, inject as Dr, onMounted as Nr, onBeforeUnmount as Gr, toRaw as We, withDirectives as Zr, vShow as Wr } from "vue";
|
|
6
6
|
function U(i, t, e) {
|
|
7
7
|
Object.keys(i).forEach((r) => {
|
|
8
8
|
r.startsWith("update:") || e != null && e.includes(r) || t.addEventListener(r, i[r]);
|
|
@@ -58,12 +58,12 @@ var Xt = { exports: {} };
|
|
|
58
58
|
return !1;
|
|
59
59
|
}
|
|
60
60
|
function l(g, f) {
|
|
61
|
-
var v = g - 65e-4, O = f - 6e-3,
|
|
61
|
+
var v = g - 65e-4, O = f - 6e-3, P = Math.sqrt(v * v + O * O) - 2e-5 * Math.sin(O * t), E = Math.atan2(O, v) - 3e-6 * Math.cos(v * t), Q = P * Math.cos(E), ie = P * Math.sin(E);
|
|
62
62
|
return [Q, ie];
|
|
63
63
|
}
|
|
64
64
|
function d(g, f) {
|
|
65
|
-
var v = Math.sqrt(g * g + f * f) + 2e-5 * Math.sin(f * t), O = Math.atan2(f, g) + 3e-6 * Math.cos(g * t),
|
|
66
|
-
return [
|
|
65
|
+
var v = Math.sqrt(g * g + f * f) + 2e-5 * Math.sin(f * t), O = Math.atan2(f, g) + 3e-6 * Math.cos(g * t), P = v * Math.cos(O) + 65e-4, E = v * Math.sin(O) + 6e-3;
|
|
66
|
+
return [P, E];
|
|
67
67
|
}
|
|
68
68
|
function u(g, f) {
|
|
69
69
|
return o(g, f) ? b(g, f) : [g, f];
|
|
@@ -75,10 +75,10 @@ var Xt = { exports: {} };
|
|
|
75
75
|
return [g * 2 - v[0], f * 2 - v[1]];
|
|
76
76
|
}
|
|
77
77
|
function b(g, f) {
|
|
78
|
-
var v = _(g - 105, f - 35), O = T(g - 105, f - 35),
|
|
78
|
+
var v = _(g - 105, f - 35), O = T(g - 105, f - 35), P = f / 180 * e, E = Math.sin(P);
|
|
79
79
|
E = 1 - s * E * E;
|
|
80
80
|
var Q = Math.sqrt(E);
|
|
81
|
-
v = v * 180 / (r * (1 - s) / (E * Q) * e), O = O * 180 / (r / Q * Math.cos(
|
|
81
|
+
v = v * 180 / (r * (1 - s) / (E * Q) * e), O = O * 180 / (r / Q * Math.cos(P) * e);
|
|
82
82
|
var ie = f + v, Ue = g + O;
|
|
83
83
|
return [Ue, ie];
|
|
84
84
|
}
|
|
@@ -153,7 +153,7 @@ function ot(i, t, e) {
|
|
|
153
153
|
r = r.$parent;
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function zs(i) {
|
|
157
157
|
return i;
|
|
158
158
|
}
|
|
159
159
|
function C(i) {
|
|
@@ -162,7 +162,7 @@ function C(i) {
|
|
|
162
162
|
function at(i) {
|
|
163
163
|
throw new Error(`Unsupported: ${i}`);
|
|
164
164
|
}
|
|
165
|
-
function
|
|
165
|
+
function Ds(i) {
|
|
166
166
|
throw new Error(`todo: ${i}`);
|
|
167
167
|
}
|
|
168
168
|
function Ns(i) {
|
|
@@ -176,30 +176,46 @@ function Gs(i) {
|
|
|
176
176
|
function Qt(i) {
|
|
177
177
|
return i[1] != null;
|
|
178
178
|
}
|
|
179
|
-
var
|
|
180
|
-
const qe = "wgs84",
|
|
179
|
+
var S = /* @__PURE__ */ ((i) => (i.wgs84 = "wgs84", i.gcj02 = "gcj02", i.bd09 = "bd09", i))(S || {});
|
|
180
|
+
const qe = "wgs84", k = class {
|
|
181
181
|
constructor(t, e, r) {
|
|
182
182
|
this.lat = t, this.lng = e, this.coord = r;
|
|
183
183
|
}
|
|
184
|
+
/**
|
|
185
|
+
* {@template latlng_normalize}
|
|
186
|
+
*
|
|
187
|
+
* 对经纬度进行标准化, 参考google的实现
|
|
188
|
+
*
|
|
189
|
+
* ## 行为不一致
|
|
190
|
+
* - google: google.maps.LatLng的构造器会对经纬度进行标准化, 所有点都能正常显示
|
|
191
|
+
* - baidu: BMap.Point的构造器不会对经纬度进行标准化, 超出范围的点显示到(0, 0)位置
|
|
192
|
+
*
|
|
193
|
+
* {@endtemplate}
|
|
194
|
+
*/
|
|
195
|
+
/* private */
|
|
196
|
+
static _normalize(t, e) {
|
|
197
|
+
const r = e > 90 ? 90 : e < -90 ? -90 : e;
|
|
198
|
+
return [t > 180 ? (t + 180) % 360 - 180 : t < -180 ? (t - 180) % 360 + 180 : t, r];
|
|
199
|
+
}
|
|
184
200
|
/** @param coord Baidu Map的坐标一般都是bd09 */
|
|
185
201
|
static fromBaidu(t, e) {
|
|
186
|
-
return new
|
|
202
|
+
return new k(t.lat, t.lng, e);
|
|
187
203
|
}
|
|
188
204
|
/** @param coord Google Map的坐标依据地图类型不同是不一样的 */
|
|
189
205
|
static fromGoogle(t, e) {
|
|
190
|
-
return new
|
|
206
|
+
return new k(t.lat(), t.lng(), e);
|
|
191
207
|
}
|
|
192
208
|
static fromHere(t, e) {
|
|
193
|
-
return new
|
|
209
|
+
return new k(t.lat, t.lng, e);
|
|
194
210
|
}
|
|
195
211
|
static fromLiteral(t) {
|
|
196
|
-
return new
|
|
212
|
+
return new k(t.lat, t.lng, t.coord || qe);
|
|
197
213
|
}
|
|
198
214
|
static fromLngLat(t, e, r = qe) {
|
|
199
|
-
return new
|
|
215
|
+
return new k(e, t, r);
|
|
200
216
|
}
|
|
201
217
|
static create(t, e, r = qe) {
|
|
202
|
-
return new
|
|
218
|
+
return new k(t, e, r);
|
|
203
219
|
}
|
|
204
220
|
/** 转换坐标到指定坐标系 */
|
|
205
221
|
to(t) {
|
|
@@ -207,12 +223,21 @@ const qe = "wgs84", N = class {
|
|
|
207
223
|
if (this.coord === e)
|
|
208
224
|
return this;
|
|
209
225
|
const [r, s] = this._convert(e);
|
|
210
|
-
return new
|
|
226
|
+
return new k(s, r, e);
|
|
211
227
|
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
228
|
+
/**
|
|
229
|
+
* 转换成baidu的经纬度
|
|
230
|
+
* @param normalize 转换时是否进行标准化, 默认false
|
|
231
|
+
* @see _normalize {@macro latlng_normalize}
|
|
232
|
+
*/
|
|
233
|
+
toBaidu(t, e = !1) {
|
|
234
|
+
let r = this.lat, s = this.lng;
|
|
235
|
+
return this.coord !== t && ([s, r] = this._convert(t)), e && ([s, r] = k._normalize(s, r)), new BMap.Point(s, r);
|
|
215
236
|
}
|
|
237
|
+
/**
|
|
238
|
+
* 转换成google的经纬度, 内部会自动进行标准化
|
|
239
|
+
* @see _normalize {@macro latlng_normalize}
|
|
240
|
+
*/
|
|
216
241
|
toGoogle(t) {
|
|
217
242
|
let e = this.lat, r = this.lng;
|
|
218
243
|
return this.coord !== t && ([r, e] = this._convert(t)), new google.maps.LatLng(e, r);
|
|
@@ -241,6 +266,14 @@ const qe = "wgs84", N = class {
|
|
|
241
266
|
}
|
|
242
267
|
throw new Error(`不支持的坐标转换: ${this.coord}=>${t}`);
|
|
243
268
|
}
|
|
269
|
+
/**
|
|
270
|
+
* 标准化, 返回合法的坐标点
|
|
271
|
+
* @see _normalize {@macro latlng_normalize}
|
|
272
|
+
*/
|
|
273
|
+
normalize() {
|
|
274
|
+
const [t, e] = k._normalize(this.lng, this.lat);
|
|
275
|
+
return e === this.lat && t === this.lng ? this : new k(e, t, this.coord);
|
|
276
|
+
}
|
|
244
277
|
equals(t) {
|
|
245
278
|
return this === t ? !0 : this.lat === t.lat && this.lng === t.lng && this.coord === t.coord;
|
|
246
279
|
}
|
|
@@ -248,8 +281,8 @@ const qe = "wgs84", N = class {
|
|
|
248
281
|
return JSON.stringify(this);
|
|
249
282
|
}
|
|
250
283
|
};
|
|
251
|
-
let y =
|
|
252
|
-
c(y, "ZERO",
|
|
284
|
+
let y = k;
|
|
285
|
+
c(y, "ZERO", k.create(0, 0));
|
|
253
286
|
const te = class {
|
|
254
287
|
/**
|
|
255
288
|
* 不推荐直接创建LatLngBounds, sw和ne的大小关系可能没法保证, 推荐用LatLngBounds.Builder或者LatLngBounds.from等静态方法来创建
|
|
@@ -331,8 +364,8 @@ const te = class {
|
|
|
331
364
|
return [this.sw.toBaidu(t), this.ne.toBaidu(t)];
|
|
332
365
|
}
|
|
333
366
|
};
|
|
334
|
-
let
|
|
335
|
-
c(
|
|
367
|
+
let R = te;
|
|
368
|
+
c(R, "EMPTY", new te(y.ZERO, y.ZERO));
|
|
336
369
|
((i) => {
|
|
337
370
|
class t {
|
|
338
371
|
constructor(r) {
|
|
@@ -360,7 +393,7 @@ c(A, "EMPTY", new te(y.ZERO, y.ZERO));
|
|
|
360
393
|
}
|
|
361
394
|
}
|
|
362
395
|
i.Builder = t;
|
|
363
|
-
})(
|
|
396
|
+
})(R || (R = {}));
|
|
364
397
|
var K;
|
|
365
398
|
((i) => {
|
|
366
399
|
function t(r, s) {
|
|
@@ -740,7 +773,7 @@ class fe {
|
|
|
740
773
|
return this.value === void 0 && (this.value = this.creator()), this.value;
|
|
741
774
|
}
|
|
742
775
|
}
|
|
743
|
-
var
|
|
776
|
+
var I = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-center", i.TOP_RIGHT = "top-right", i.BOTTOM_LEFT = "bottom-left", i.BOTTOM_CENTER = "bottom-center", i.BOTTOM_RIGHT = "bottom-right", i.LEFT_TOP = "left-top", i.LEFT_CENTER = "left-center", i.LEFT_BOTTOM = "left-bottom", i.RIGHT_TOP = "right-top", i.RIGHT_CENTER = "right-center", i.RIGHT_BOTTOM = "right-bottom", i))(I || {}), z;
|
|
744
777
|
((i) => {
|
|
745
778
|
let t, e;
|
|
746
779
|
const r = [
|
|
@@ -805,7 +838,7 @@ var B = /* @__PURE__ */ ((i) => (i.TOP_LEFT = "top-left", i.TOP_CENTER = "top-ce
|
|
|
805
838
|
])), e;
|
|
806
839
|
}
|
|
807
840
|
i.getGoogle = n;
|
|
808
|
-
})(
|
|
841
|
+
})(z || (z = {}));
|
|
809
842
|
class di {
|
|
810
843
|
constructor(t) {
|
|
811
844
|
/** 实际添加到地图中的control对象 */
|
|
@@ -826,10 +859,10 @@ class lt extends ar {
|
|
|
826
859
|
t ? this.inner.show() : this.inner.hide();
|
|
827
860
|
}
|
|
828
861
|
getPosition() {
|
|
829
|
-
return this.position ??
|
|
862
|
+
return this.position ?? z.getBaidu().toKey(this.inner.getAnchor());
|
|
830
863
|
}
|
|
831
864
|
setPosition(t) {
|
|
832
|
-
this.position = t, this.inner.setAnchor(
|
|
865
|
+
this.position = t, this.inner.setAnchor(z.getBaidu().toValue(t));
|
|
833
866
|
}
|
|
834
867
|
addTo(t) {
|
|
835
868
|
t.innerMap.addControl(this.inner);
|
|
@@ -865,7 +898,7 @@ class ht extends ar {
|
|
|
865
898
|
}
|
|
866
899
|
onCreateOptions() {
|
|
867
900
|
return {
|
|
868
|
-
position:
|
|
901
|
+
position: z.getGoogle().toValue(this.position)
|
|
869
902
|
};
|
|
870
903
|
}
|
|
871
904
|
tryUpdateOptions() {
|
|
@@ -876,7 +909,7 @@ class ht extends ar {
|
|
|
876
909
|
}
|
|
877
910
|
}
|
|
878
911
|
var lr = /* @__PURE__ */ ((i) => (i.normal = "normal", i.satellite = "satellite", i.hybrid = "hybrid", i))(lr || {});
|
|
879
|
-
class
|
|
912
|
+
class A {
|
|
880
913
|
constructor(t, e, r, s) {
|
|
881
914
|
this.id = t, this.baidu = e, this.google = r, this.googleCoordType = s;
|
|
882
915
|
}
|
|
@@ -884,7 +917,7 @@ class S {
|
|
|
884
917
|
return this.id;
|
|
885
918
|
}
|
|
886
919
|
getBaiduCoordType() {
|
|
887
|
-
return
|
|
920
|
+
return S.bd09;
|
|
888
921
|
}
|
|
889
922
|
asBaiduMapType() {
|
|
890
923
|
return this.baidu();
|
|
@@ -964,18 +997,18 @@ class ui {
|
|
|
964
997
|
return this.googleCache.get();
|
|
965
998
|
}
|
|
966
999
|
}
|
|
967
|
-
var
|
|
1000
|
+
var $;
|
|
968
1001
|
((i) => {
|
|
969
|
-
i.NORMAL = new
|
|
1002
|
+
i.NORMAL = new A("normal", () => BMAP_NORMAL_MAP, () => google.maps.MapTypeId.ROADMAP, S.gcj02), i.SATELLITE = new A("satellite", () => BMAP_SATELLITE_MAP, () => google.maps.MapTypeId.SATELLITE, S.wgs84), i.HYBRID = new A("hybrid", () => BMAP_HYBRID_MAP, () => google.maps.MapTypeId.HYBRID, S.gcj02), i.TERRAIN = new A("terrain", () => (
|
|
970
1003
|
/* 三维 */
|
|
971
1004
|
BMAP_PERSPECTIVE_MAP
|
|
972
1005
|
), () => (
|
|
973
1006
|
/* 地形 */
|
|
974
1007
|
google.maps.MapTypeId.TERRAIN
|
|
975
|
-
),
|
|
976
|
-
})(
|
|
1008
|
+
), S.wgs84), i.BUILD_IN_MAP_TYPES = new ci([i.NORMAL, i.SATELLITE, i.HYBRID, i.TERRAIN]);
|
|
1009
|
+
})($ || ($ = {}));
|
|
977
1010
|
var hr = /* @__PURE__ */ ((i) => (i.DEFAULT = "default", i.HORIZONTAL = "horizontal", i.DROPDOWN = "dropdown", i))(hr || {});
|
|
978
|
-
const cr = [
|
|
1011
|
+
const cr = [$.NORMAL, $.SATELLITE, $.HYBRID];
|
|
979
1012
|
class ct extends lt {
|
|
980
1013
|
static create(t) {
|
|
981
1014
|
const e = t.mapTypes ?? cr, r = {
|
|
@@ -986,11 +1019,11 @@ class ct extends lt {
|
|
|
986
1019
|
type: t.type && r[t.type],
|
|
987
1020
|
mapTypes: e.map((n) => n.asBaiduMapType())
|
|
988
1021
|
});
|
|
989
|
-
return t.position && s.setAnchor(
|
|
1022
|
+
return t.position && s.setAnchor(z.getBaidu().toValue(t.position)), new ct(s, t.position);
|
|
990
1023
|
}
|
|
991
1024
|
}
|
|
992
1025
|
const ne = class extends ht {
|
|
993
|
-
constructor(t = "default", e =
|
|
1026
|
+
constructor(t = "default", e = I.TOP_LEFT, r = cr) {
|
|
994
1027
|
super("mapType", e), this.type = t, this.mapTypes = r, ne.type2google || (ne.type2google = {
|
|
995
1028
|
default: google.maps.MapTypeControlStyle.DEFAULT,
|
|
996
1029
|
horizontal: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
|
|
@@ -1002,11 +1035,11 @@ const ne = class extends ht {
|
|
|
1002
1035
|
}
|
|
1003
1036
|
onCreateOptions() {
|
|
1004
1037
|
const t = super.onCreateOptions();
|
|
1005
|
-
return t.style = ne.type2google[this.type], t.mapTypeIds = this.mapTypes.map((e) => e instanceof
|
|
1038
|
+
return t.style = ne.type2google[this.type], t.mapTypeIds = this.mapTypes.map((e) => e instanceof A ? e.getGoogleMapTypeId() : e.id), t;
|
|
1006
1039
|
}
|
|
1007
1040
|
addTo(t) {
|
|
1008
1041
|
super.addTo(t), this.mapTypes.forEach((e) => {
|
|
1009
|
-
e instanceof
|
|
1042
|
+
e instanceof A || t.innerMap.mapTypes.set(e.id, e.asGoogleMapType());
|
|
1010
1043
|
});
|
|
1011
1044
|
}
|
|
1012
1045
|
};
|
|
@@ -1015,7 +1048,7 @@ c(ke, "type2google");
|
|
|
1015
1048
|
class dt extends lt {
|
|
1016
1049
|
static create(t) {
|
|
1017
1050
|
const e = new BMap.ScaleControl({
|
|
1018
|
-
anchor: t.position &&
|
|
1051
|
+
anchor: t.position && z.getBaidu().toValue(t.position)
|
|
1019
1052
|
});
|
|
1020
1053
|
return new dt(e, t.position);
|
|
1021
1054
|
}
|
|
@@ -1024,7 +1057,7 @@ class ut extends ht {
|
|
|
1024
1057
|
static create(t) {
|
|
1025
1058
|
return new ut(t.position);
|
|
1026
1059
|
}
|
|
1027
|
-
constructor(t =
|
|
1060
|
+
constructor(t = I.BOTTOM_RIGHT) {
|
|
1028
1061
|
super("scale", t);
|
|
1029
1062
|
}
|
|
1030
1063
|
}
|
|
@@ -1033,7 +1066,7 @@ class pt extends lt {
|
|
|
1033
1066
|
const e = new BMap.NavigationControl({
|
|
1034
1067
|
type: BMAP_NAVIGATION_CONTROL_ZOOM,
|
|
1035
1068
|
// enableGeolocation: true,
|
|
1036
|
-
anchor: t.position &&
|
|
1069
|
+
anchor: t.position && z.getBaidu().toValue(t.position)
|
|
1037
1070
|
});
|
|
1038
1071
|
return new pt(e, t.position);
|
|
1039
1072
|
}
|
|
@@ -1042,7 +1075,7 @@ class gt extends ht {
|
|
|
1042
1075
|
static create(t) {
|
|
1043
1076
|
return new gt(t.position);
|
|
1044
1077
|
}
|
|
1045
|
-
constructor(t =
|
|
1078
|
+
constructor(t = I.RIGHT_BOTTOM) {
|
|
1046
1079
|
super("zoom", t);
|
|
1047
1080
|
}
|
|
1048
1081
|
}
|
|
@@ -1187,29 +1220,29 @@ class gr {
|
|
|
1187
1220
|
this.options = t;
|
|
1188
1221
|
}
|
|
1189
1222
|
}
|
|
1190
|
-
const
|
|
1223
|
+
const zt = class extends gr {
|
|
1191
1224
|
/** @see https://developers.google.com/maps/documentation/urls/get-started#directions-action */
|
|
1192
1225
|
directions(t, e, r) {
|
|
1193
|
-
const s = new URL("dir/",
|
|
1226
|
+
const s = new URL("dir/", zt.BASE_URL), n = new URLSearchParams(Object.entries({
|
|
1194
1227
|
api: "1",
|
|
1195
|
-
origin: K.toString(t,
|
|
1196
|
-
destination: K.toString(e,
|
|
1228
|
+
origin: K.toString(t, S.wgs84),
|
|
1229
|
+
destination: K.toString(e, S.wgs84),
|
|
1197
1230
|
travelmode: r
|
|
1198
1231
|
}).filter(Qt));
|
|
1199
1232
|
return s.search = "?" + n.toString(), s;
|
|
1200
1233
|
}
|
|
1201
1234
|
};
|
|
1202
|
-
let Be =
|
|
1235
|
+
let Be = zt;
|
|
1203
1236
|
c(Be, "BASE_URL", "https://www.google.com/maps/");
|
|
1204
|
-
const
|
|
1237
|
+
const Dt = class extends gr {
|
|
1205
1238
|
/** @see https://lbsyun.baidu.com/faq/api?title=webapi/uri/web#:~:text=%E6%9C%8D%E5%8A%A1%E5%9C%B0%E5%9D%80-,http%3A//api.map.baidu.com/direction,-//PC%26Webapp%E6%9C%8D%E5%8A%A1 */
|
|
1206
1239
|
directions(t, e, r = "driving") {
|
|
1207
|
-
const s = new URL("direction",
|
|
1240
|
+
const s = new URL("direction", Dt.BASE_URL), n = K.getCoordType(e) ?? K.getCoordType(t) ?? S.bd09, a = K.toString(e, n), h = new URLSearchParams(Object.entries({
|
|
1208
1241
|
// baidu地图, 一定要有起点, 故这里用终点当起点, 防止导航失败
|
|
1209
1242
|
origin: K.toString(t, n) ?? (typeof e != "string" ? `name:请选择起点|latlng:${a}` : a),
|
|
1210
1243
|
destination: a,
|
|
1211
1244
|
// 默认就是bd09
|
|
1212
|
-
coord_type: n ===
|
|
1245
|
+
coord_type: n === S.bd09 ? void 0 : n,
|
|
1213
1246
|
mode: r,
|
|
1214
1247
|
output: "html",
|
|
1215
1248
|
region: "中国",
|
|
@@ -1218,7 +1251,7 @@ const zt = class extends gr {
|
|
|
1218
1251
|
return s.search = "?" + h.toString(), s;
|
|
1219
1252
|
}
|
|
1220
1253
|
};
|
|
1221
|
-
let Ie =
|
|
1254
|
+
let Ie = Dt;
|
|
1222
1255
|
c(Ie, "BASE_URL", "https://api.map.baidu.com/");
|
|
1223
1256
|
let vi = class mr {
|
|
1224
1257
|
constructor(t, e, r) {
|
|
@@ -2130,9 +2163,9 @@ var yr = function(i, t, e) {
|
|
|
2130
2163
|
var n = i.pixelToPoint(r), a = i.pixelToPoint(s);
|
|
2131
2164
|
return new BMap.Bounds(a, n);
|
|
2132
2165
|
}, Ti = function(i) {
|
|
2133
|
-
var t =
|
|
2166
|
+
var t = Pe(i.getNorthEast().lng, -180, 180), e = Pe(i.getSouthWest().lng, -180, 180), r = Pe(i.getNorthEast().lat, -74, 74), s = Pe(i.getSouthWest().lat, -74, 74);
|
|
2134
2167
|
return new BMap.Bounds(new BMap.Point(e, s), new BMap.Point(t, r));
|
|
2135
|
-
},
|
|
2168
|
+
}, Pe = function(i, t, e) {
|
|
2136
2169
|
return t && (i = Math.max(i, t)), e && (i = Math.min(i, e)), i;
|
|
2137
2170
|
}, vr = function(i) {
|
|
2138
2171
|
return Object.prototype.toString.call(i) === "[object Array]";
|
|
@@ -2205,7 +2238,7 @@ M.prototype._addToClosestCluster = function(i) {
|
|
|
2205
2238
|
if (e && e.isMarkerInClusterBounds(i))
|
|
2206
2239
|
e.addMarker(i);
|
|
2207
2240
|
else {
|
|
2208
|
-
var s = new
|
|
2241
|
+
var s = new N(this);
|
|
2209
2242
|
s.addMarker(i), this._clusters.push(s);
|
|
2210
2243
|
}
|
|
2211
2244
|
};
|
|
@@ -2300,7 +2333,7 @@ M.prototype.setTextCalculator = function(i) {
|
|
|
2300
2333
|
M.prototype.setStylesIndexCalculator = function(i) {
|
|
2301
2334
|
this._stylesIndexCalculator = i;
|
|
2302
2335
|
};
|
|
2303
|
-
function
|
|
2336
|
+
function N(i) {
|
|
2304
2337
|
var t = this;
|
|
2305
2338
|
this._markerClusterer = i, this._map = i.getMap(), this._minClusterSize = i.getMinClusterSize(), this._isAverageCenter = i.isAverageCenter(), this._center = null, this._markers = [], this._gridBounds = null, this._isReal = !1, this._clusterMarker = new Wt(this._center, this._markers.length, {
|
|
2306
2339
|
styles: this._markerClusterer.getStyles(),
|
|
@@ -2315,7 +2348,7 @@ function z(i) {
|
|
|
2315
2348
|
t._map.setViewport(t.getBounds());
|
|
2316
2349
|
});
|
|
2317
2350
|
}
|
|
2318
|
-
|
|
2351
|
+
N.prototype.addMarker = function(i) {
|
|
2319
2352
|
if (this.isMarkerInCluster(i))
|
|
2320
2353
|
return !1;
|
|
2321
2354
|
if (!this._center)
|
|
@@ -2326,7 +2359,7 @@ z.prototype.addMarker = function(i) {
|
|
|
2326
2359
|
}
|
|
2327
2360
|
return i.isInCluster = !0, this._markers.push(i), !0;
|
|
2328
2361
|
};
|
|
2329
|
-
|
|
2362
|
+
N.prototype.render = function() {
|
|
2330
2363
|
var i = this._markers.length;
|
|
2331
2364
|
if (i < this._minClusterSize)
|
|
2332
2365
|
for (var t = 0; t < i; t++)
|
|
@@ -2334,7 +2367,7 @@ z.prototype.render = function() {
|
|
|
2334
2367
|
else
|
|
2335
2368
|
this._map.addOverlay(this._clusterMarker), this._isReal = !0, this.updateClusterMarker();
|
|
2336
2369
|
};
|
|
2337
|
-
|
|
2370
|
+
N.prototype.isMarkerInCluster = function(i) {
|
|
2338
2371
|
if (this._markers.indexOf)
|
|
2339
2372
|
return this._markers.indexOf(i) != -1;
|
|
2340
2373
|
for (var t = 0, e; e = this._markers[t]; t++)
|
|
@@ -2342,17 +2375,17 @@ z.prototype.isMarkerInCluster = function(i) {
|
|
|
2342
2375
|
return !0;
|
|
2343
2376
|
return !1;
|
|
2344
2377
|
};
|
|
2345
|
-
|
|
2378
|
+
N.prototype.isMarkerInClusterBounds = function(i) {
|
|
2346
2379
|
return this._gridBounds.containsPoint(i.getPosition());
|
|
2347
2380
|
};
|
|
2348
|
-
|
|
2381
|
+
N.prototype.isReal = function(i) {
|
|
2349
2382
|
return this._isReal;
|
|
2350
2383
|
};
|
|
2351
|
-
|
|
2384
|
+
N.prototype.updateGridBounds = function() {
|
|
2352
2385
|
var i = new BMap.Bounds(this._center, this._center);
|
|
2353
2386
|
this._gridBounds = yr(this._map, i, this._markerClusterer.getGridSize());
|
|
2354
2387
|
};
|
|
2355
|
-
|
|
2388
|
+
N.prototype.updateClusterMarker = function() {
|
|
2356
2389
|
if (this._map.getZoom() > this._markerClusterer.getMaxZoom()) {
|
|
2357
2390
|
this._clusterMarker && this._map.removeOverlay(this._clusterMarker);
|
|
2358
2391
|
for (var i = 0, t; t = this._markers[i]; i++)
|
|
@@ -2365,19 +2398,19 @@ z.prototype.updateClusterMarker = function() {
|
|
|
2365
2398
|
}
|
|
2366
2399
|
this._clusterMarker.setPosition(this._center), this._clusterMarker.setText(this._markerClusterer._textCalculator(this._markers));
|
|
2367
2400
|
};
|
|
2368
|
-
|
|
2401
|
+
N.prototype.remove = function() {
|
|
2369
2402
|
for (var i = 0, t; t = this._markers[i]; i++) {
|
|
2370
2403
|
var e = this._markers[i].getLabel();
|
|
2371
2404
|
this._markers[i].getMap() && this._map.removeOverlay(this._markers[i]), this._markers[i].setLabel(e);
|
|
2372
2405
|
}
|
|
2373
2406
|
this._map.removeOverlay(this._clusterMarker), this._markers.length = 0, delete this._markers;
|
|
2374
2407
|
};
|
|
2375
|
-
|
|
2408
|
+
N.prototype.getBounds = function() {
|
|
2376
2409
|
for (var i = new BMap.Bounds(this._center, this._center), t = 0, e; e = this._markers[t]; t++)
|
|
2377
2410
|
i.extend(e.getPosition());
|
|
2378
2411
|
return i;
|
|
2379
2412
|
};
|
|
2380
|
-
|
|
2413
|
+
N.prototype.getCenter = function() {
|
|
2381
2414
|
return this._center;
|
|
2382
2415
|
};
|
|
2383
2416
|
var Re;
|
|
@@ -2408,7 +2441,6 @@ var Re;
|
|
|
2408
2441
|
})(Re || (Re = {}));
|
|
2409
2442
|
class br {
|
|
2410
2443
|
constructor(t) {
|
|
2411
|
-
c(this, "inner");
|
|
2412
2444
|
this.map = t;
|
|
2413
2445
|
}
|
|
2414
2446
|
/** baidu/google 拥有相同的函数名 */
|
|
@@ -2433,46 +2465,50 @@ class br {
|
|
|
2433
2465
|
}
|
|
2434
2466
|
}
|
|
2435
2467
|
class Mi extends br {
|
|
2436
|
-
constructor(
|
|
2437
|
-
var
|
|
2438
|
-
super(
|
|
2468
|
+
constructor(e, r) {
|
|
2469
|
+
var n;
|
|
2470
|
+
super(e);
|
|
2471
|
+
c(this, "inner");
|
|
2472
|
+
this.inner = new M(e.innerMap, {
|
|
2439
2473
|
// baidu的构造器中的markers, 会触发重绘, 会导致使用旧的calculator计算cluster
|
|
2440
2474
|
// markers: options.markers?.map(it => (it as BaiduMarker).innerOverlay),
|
|
2441
|
-
gridSize:
|
|
2442
|
-
maxZoom:
|
|
2443
|
-
minClusterSize:
|
|
2444
|
-
isAverageCenter:
|
|
2445
|
-
styles: (
|
|
2446
|
-
zIndex:
|
|
2475
|
+
gridSize: r.gridSize,
|
|
2476
|
+
maxZoom: r.maxZoom,
|
|
2477
|
+
minClusterSize: r.minClusterSize,
|
|
2478
|
+
isAverageCenter: r.averageCenter,
|
|
2479
|
+
styles: (n = r.styles) == null ? void 0 : n.map((a) => Re.toBaidu(a)),
|
|
2480
|
+
zIndex: r.zIndex
|
|
2447
2481
|
});
|
|
2448
|
-
const
|
|
2449
|
-
|
|
2482
|
+
const s = r.stylesIndexCalculator;
|
|
2483
|
+
s && this.inner.setStylesIndexCalculator((a, h) => s(a.length, h)), r.markers && this.addMarkers(r.markers);
|
|
2450
2484
|
}
|
|
2451
2485
|
recreate() {
|
|
2452
2486
|
this.inner._redraw();
|
|
2453
2487
|
}
|
|
2454
2488
|
}
|
|
2455
2489
|
class Oi extends br {
|
|
2456
|
-
constructor(
|
|
2457
|
-
var
|
|
2458
|
-
super(
|
|
2459
|
-
|
|
2490
|
+
constructor(e, r) {
|
|
2491
|
+
var n, a;
|
|
2492
|
+
super(e);
|
|
2493
|
+
c(this, "inner");
|
|
2494
|
+
this.inner = new vi(
|
|
2495
|
+
e.innerMap,
|
|
2460
2496
|
// google的构造器中的markers,不会触发重绘, 第一次绘制通过监听地图的'idle'事件触发, 可以直接设置
|
|
2461
|
-
(
|
|
2497
|
+
(n = r.markers) == null ? void 0 : n.map((h) => h.innerOverlay),
|
|
2462
2498
|
{
|
|
2463
|
-
gridSize:
|
|
2464
|
-
maxZoom:
|
|
2465
|
-
minimumClusterSize:
|
|
2466
|
-
averageCenter:
|
|
2467
|
-
styles: (
|
|
2468
|
-
zIndex:
|
|
2499
|
+
gridSize: r.gridSize,
|
|
2500
|
+
maxZoom: r.maxZoom,
|
|
2501
|
+
minimumClusterSize: r.minClusterSize,
|
|
2502
|
+
averageCenter: r.averageCenter,
|
|
2503
|
+
styles: (a = r.styles) == null ? void 0 : a.map((h) => Re.toGoogle(h)),
|
|
2504
|
+
zIndex: r.zIndex
|
|
2469
2505
|
}
|
|
2470
2506
|
);
|
|
2471
|
-
const
|
|
2472
|
-
|
|
2473
|
-
text:
|
|
2507
|
+
const s = r.stylesIndexCalculator;
|
|
2508
|
+
s && this.inner.setCalculator((h, o) => ({
|
|
2509
|
+
text: h.length,
|
|
2474
2510
|
// google内部, 取index时, 会`-1`...故我们这里`+1`, 抵消掉它
|
|
2475
|
-
index:
|
|
2511
|
+
index: s(h.length, o) + 1
|
|
2476
2512
|
}));
|
|
2477
2513
|
}
|
|
2478
2514
|
recreate() {
|
|
@@ -2645,7 +2681,7 @@ class Li extends Mr {
|
|
|
2645
2681
|
this.placesService.search(e).then(this.onData, this.onError);
|
|
2646
2682
|
}
|
|
2647
2683
|
}
|
|
2648
|
-
var
|
|
2684
|
+
var Pi = /* @__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))(Pi || {});
|
|
2649
2685
|
class ft {
|
|
2650
2686
|
constructor(t) {
|
|
2651
2687
|
c(this, "latestInfoWindow");
|
|
@@ -2699,7 +2735,7 @@ class ft {
|
|
|
2699
2735
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
2700
2736
|
* Released under the MIT License.
|
|
2701
2737
|
*/
|
|
2702
|
-
function
|
|
2738
|
+
function xi(i) {
|
|
2703
2739
|
return i != null && typeof i == "object" && Array.isArray(i) === !1;
|
|
2704
2740
|
}
|
|
2705
2741
|
/*!
|
|
@@ -2709,7 +2745,7 @@ function Pi(i) {
|
|
|
2709
2745
|
* Released under the MIT License.
|
|
2710
2746
|
*/
|
|
2711
2747
|
function Ht(i) {
|
|
2712
|
-
return
|
|
2748
|
+
return xi(i) === !0 && Object.prototype.toString.call(i) === "[object Object]";
|
|
2713
2749
|
}
|
|
2714
2750
|
function Or(i) {
|
|
2715
2751
|
var t, e;
|
|
@@ -2851,14 +2887,14 @@ const Ge = class extends je {
|
|
|
2851
2887
|
this.innerOverlay.setFillOpacity(t + Ge.OPACITY_DELTA);
|
|
2852
2888
|
}
|
|
2853
2889
|
};
|
|
2854
|
-
let
|
|
2890
|
+
let B = Ge;
|
|
2855
2891
|
/**
|
|
2856
2892
|
* baidu地图的透明度属性有如下问题:
|
|
2857
2893
|
* - 在透明度为0时, 无法隐藏掉颜色
|
|
2858
2894
|
* - 透明度为0.7和0.8时, 在maintain的发布模式下, polyline的线条会不可见 (原因未知, 在tg-map中无法复现)
|
|
2859
2895
|
* 故统一加个0.001, 规避这些问题...
|
|
2860
2896
|
*/
|
|
2861
|
-
c(
|
|
2897
|
+
c(B, "OPACITY_DELTA", 1e-3);
|
|
2862
2898
|
class Ve extends yt {
|
|
2863
2899
|
isEditable() {
|
|
2864
2900
|
return this.innerOverlay.getEditable();
|
|
@@ -2882,7 +2918,7 @@ class Ve extends yt {
|
|
|
2882
2918
|
this.innerOverlay.setOptions({ fillOpacity: t });
|
|
2883
2919
|
}
|
|
2884
2920
|
}
|
|
2885
|
-
class vt extends
|
|
2921
|
+
class vt extends B {
|
|
2886
2922
|
constructor() {
|
|
2887
2923
|
super(...arguments);
|
|
2888
2924
|
c(this, "prevCenter");
|
|
@@ -2909,10 +2945,10 @@ class vt extends k {
|
|
|
2909
2945
|
enableEditing: !1,
|
|
2910
2946
|
// options.editable,
|
|
2911
2947
|
strokeColor: e.strokeColor,
|
|
2912
|
-
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity +
|
|
2948
|
+
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity + B.OPACITY_DELTA : void 0,
|
|
2913
2949
|
strokeWeight: e.strokeWeight,
|
|
2914
2950
|
fillColor: e.fillColor,
|
|
2915
|
-
fillOpacity: e.fillOpacity != null ? e.fillOpacity +
|
|
2951
|
+
fillOpacity: e.fillOpacity != null ? e.fillOpacity + B.OPACITY_DELTA : void 0
|
|
2916
2952
|
}), n = new vt(s, r, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
2917
2953
|
return n.state.editable && setTimeout(() => {
|
|
2918
2954
|
n.state.editable && s.enableEditing();
|
|
@@ -3572,10 +3608,10 @@ class Et extends yt {
|
|
|
3572
3608
|
}
|
|
3573
3609
|
}
|
|
3574
3610
|
const $e = {
|
|
3575
|
-
toGoogle: (i) => "url" in i ?
|
|
3576
|
-
toBaidu: (i) => "url" in i ?
|
|
3611
|
+
toGoogle: (i) => "url" in i ? ze.toGoogle(i) : De.toGoogle(i),
|
|
3612
|
+
toBaidu: (i) => "url" in i ? ze.toBaidu(i) : De.toBaidu(i)
|
|
3577
3613
|
};
|
|
3578
|
-
var
|
|
3614
|
+
var ze;
|
|
3579
3615
|
((i) => {
|
|
3580
3616
|
function t(r) {
|
|
3581
3617
|
return {
|
|
@@ -3599,8 +3635,8 @@ var De;
|
|
|
3599
3635
|
});
|
|
3600
3636
|
}
|
|
3601
3637
|
i.toBaidu = e;
|
|
3602
|
-
})(
|
|
3603
|
-
var
|
|
3638
|
+
})(ze || (ze = {}));
|
|
3639
|
+
var De;
|
|
3604
3640
|
((i) => {
|
|
3605
3641
|
function t(r) {
|
|
3606
3642
|
return {
|
|
@@ -3631,7 +3667,7 @@ var ze;
|
|
|
3631
3667
|
return s.__icon__ = r, s;
|
|
3632
3668
|
}
|
|
3633
3669
|
i.toBaidu = e;
|
|
3634
|
-
})(
|
|
3670
|
+
})(De || (De = {}));
|
|
3635
3671
|
const Vs = {
|
|
3636
3672
|
CIRCLE: { baidu: () => BMap_Symbol_SHAPE_CIRCLE, google: () => google.maps.SymbolPath.CIRCLE },
|
|
3637
3673
|
BACKWARD_CLOSED_ARROW: { baidu: () => BMap_Symbol_SHAPE_BACKWARD_CLOSED_ARROW, google: () => google.maps.SymbolPath.BACKWARD_CLOSED_ARROW },
|
|
@@ -3652,17 +3688,17 @@ class Ce extends je {
|
|
|
3652
3688
|
// baidu的raiseOnDrag属性, 默认为false, 而我们的options.crossOnDrag默认为true, 故这里需要转换下
|
|
3653
3689
|
raiseOnDrag: t.crossOnDrag === void 0 ? !0 : t.crossOnDrag,
|
|
3654
3690
|
draggingCursor: t.cursor
|
|
3655
|
-
}, n = new BMap.Marker(t.position.toBaidu(e), s);
|
|
3691
|
+
}, n = new BMap.Marker(t.position.toBaidu(e, t.normalizePositionForBaidu), s);
|
|
3656
3692
|
t.zIndex !== void 0 && n.setZIndex(t.zIndex);
|
|
3657
3693
|
const a = t.clickable === void 0 ? !0 : t.clickable, h = !!t.draggable;
|
|
3658
|
-
return new Ce(n, e, this, { clickable: a, draggable: h, zIndex: t.zIndex }).visibleOptionInternal(t.visible);
|
|
3694
|
+
return new Ce(n, e, this, { clickable: a, draggable: h, zIndex: t.zIndex, normalize: t.normalizePositionForBaidu }).visibleOptionInternal(t.visible);
|
|
3659
3695
|
}
|
|
3660
3696
|
getPosition() {
|
|
3661
3697
|
return y.fromBaidu(this.innerOverlay.getPosition(), this.coordType);
|
|
3662
3698
|
}
|
|
3663
3699
|
setPosition(t) {
|
|
3664
3700
|
var e;
|
|
3665
|
-
this.coordType = this.map.coordType, this.innerOverlay.setPosition(t.toBaidu(this.coordType)), (e = this.innerOverlay.__info_box__) == null || e.onMarkerPositionChanged();
|
|
3701
|
+
this.coordType = this.map.coordType, this.innerOverlay.setPosition(t.toBaidu(this.coordType, this.state.normalize)), (e = this.innerOverlay.__info_box__) == null || e.onMarkerPositionChanged();
|
|
3666
3702
|
}
|
|
3667
3703
|
setTitle(t) {
|
|
3668
3704
|
this.innerOverlay.setTitle(t);
|
|
@@ -3782,7 +3818,7 @@ class Lt extends yt {
|
|
|
3782
3818
|
this.label = void 0, this.labelPositionListener = void 0, this.labelVisibleListener = void 0, this.labelMapChangedListener = void 0;
|
|
3783
3819
|
}
|
|
3784
3820
|
}
|
|
3785
|
-
class
|
|
3821
|
+
class Pt extends B {
|
|
3786
3822
|
constructor() {
|
|
3787
3823
|
super(...arguments);
|
|
3788
3824
|
c(this, "eventHubDelegate");
|
|
@@ -3818,7 +3854,7 @@ class xt extends k {
|
|
|
3818
3854
|
});
|
|
3819
3855
|
}
|
|
3820
3856
|
}
|
|
3821
|
-
class
|
|
3857
|
+
class xt extends Pt {
|
|
3822
3858
|
constructor() {
|
|
3823
3859
|
super(...arguments);
|
|
3824
3860
|
c(this, "pathEditedEventType", "path-edited");
|
|
@@ -3828,10 +3864,10 @@ class Pt extends xt {
|
|
|
3828
3864
|
enableClicking: e.clickable,
|
|
3829
3865
|
enableEditing: e.editable,
|
|
3830
3866
|
strokeColor: e.strokeColor,
|
|
3831
|
-
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity +
|
|
3867
|
+
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity + B.OPACITY_DELTA : void 0,
|
|
3832
3868
|
strokeWeight: e.strokeWeight
|
|
3833
3869
|
});
|
|
3834
|
-
return new
|
|
3870
|
+
return new xt(s, r, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
3835
3871
|
}
|
|
3836
3872
|
getPath() {
|
|
3837
3873
|
return this.innerOverlay.getPath().map((e) => y.fromBaidu(e, this.coordType));
|
|
@@ -3887,7 +3923,7 @@ class kt extends Ve {
|
|
|
3887
3923
|
this.coordType = this.map.coordType, this.innerOverlay.setPath(e.map((s) => s.toGoogle(this.coordType))), (r = this.eventHubDelegate) != null && r.hasListener("path-edited") && this.setupPathChangedListeners();
|
|
3888
3924
|
}
|
|
3889
3925
|
}
|
|
3890
|
-
class Bt extends
|
|
3926
|
+
class Bt extends Pt {
|
|
3891
3927
|
constructor() {
|
|
3892
3928
|
super(...arguments);
|
|
3893
3929
|
c(this, "pathEditedEventType", "paths-edited");
|
|
@@ -3899,10 +3935,10 @@ class Bt extends xt {
|
|
|
3899
3935
|
enableClicking: e.clickable,
|
|
3900
3936
|
enableEditing: e.editable,
|
|
3901
3937
|
strokeColor: e.strokeColor,
|
|
3902
|
-
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity +
|
|
3938
|
+
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity + B.OPACITY_DELTA : void 0,
|
|
3903
3939
|
strokeWeight: e.strokeWeight,
|
|
3904
3940
|
fillColor: e.fillColor,
|
|
3905
|
-
fillOpacity: e.fillOpacity != null ? e.fillOpacity +
|
|
3941
|
+
fillOpacity: e.fillOpacity != null ? e.fillOpacity + B.OPACITY_DELTA : void 0
|
|
3906
3942
|
});
|
|
3907
3943
|
return new Bt(n, r, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
3908
3944
|
}
|
|
@@ -3967,7 +4003,7 @@ class It extends Ve {
|
|
|
3967
4003
|
this.coordType = this.map.coordType, this.innerOverlay.setPaths(e.map((s) => s.map((n) => n.toGoogle(this.coordType)))), (r = this.eventHubDelegate) != null && r.hasListener("paths-edited") && this.setupPathChangedListeners();
|
|
3968
4004
|
}
|
|
3969
4005
|
}
|
|
3970
|
-
class St extends
|
|
4006
|
+
class St extends Pt {
|
|
3971
4007
|
constructor(e, r, s, n) {
|
|
3972
4008
|
super(e, r, s, n);
|
|
3973
4009
|
c(this, "pathEditedEventType", "bounds-changed");
|
|
@@ -3999,7 +4035,7 @@ class St extends xt {
|
|
|
3999
4035
|
}
|
|
4000
4036
|
} else
|
|
4001
4037
|
a < r.length;
|
|
4002
|
-
const h =
|
|
4038
|
+
const h = R.fromArray(n.map((o) => y.fromBaidu(o, this.coordType)));
|
|
4003
4039
|
h && (this.isDoingUpdateRectangle = !0, this.innerOverlay.setPath(h.toRectArray().map((o) => o.toBaidu(this.coordType))), this.isDoingUpdateRectangle = !1);
|
|
4004
4040
|
}, 0);
|
|
4005
4041
|
});
|
|
@@ -4010,15 +4046,15 @@ class St extends xt {
|
|
|
4010
4046
|
enableClicking: e.clickable,
|
|
4011
4047
|
enableEditing: e.editable,
|
|
4012
4048
|
strokeColor: e.strokeColor,
|
|
4013
|
-
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity +
|
|
4049
|
+
strokeOpacity: e.strokeOpacity != null ? e.strokeOpacity + B.OPACITY_DELTA : void 0,
|
|
4014
4050
|
strokeWeight: e.strokeWeight,
|
|
4015
4051
|
fillColor: e.fillColor,
|
|
4016
|
-
fillOpacity: e.fillOpacity != null ? e.fillOpacity +
|
|
4052
|
+
fillOpacity: e.fillOpacity != null ? e.fillOpacity + B.OPACITY_DELTA : void 0
|
|
4017
4053
|
});
|
|
4018
4054
|
return new St(s, r, this, { editable: !!e.editable }).visibleOptionInternal(e.visible);
|
|
4019
4055
|
}
|
|
4020
4056
|
getBounds() {
|
|
4021
|
-
return
|
|
4057
|
+
return R.fromBaidu(this.innerOverlay.getBounds(), this.coordType);
|
|
4022
4058
|
}
|
|
4023
4059
|
setBounds(e) {
|
|
4024
4060
|
const r = e.toRectArray();
|
|
@@ -4043,7 +4079,7 @@ class At extends Ve {
|
|
|
4043
4079
|
return new At(r, e, this);
|
|
4044
4080
|
}
|
|
4045
4081
|
getBounds() {
|
|
4046
|
-
return
|
|
4082
|
+
return R.fromGoogle(this.innerOverlay.getBounds() ?? J.BOUNDS_ZERO, this.coordType);
|
|
4047
4083
|
}
|
|
4048
4084
|
setBounds(t) {
|
|
4049
4085
|
const e = t.toGoogle(this.coordType);
|
|
@@ -4051,7 +4087,7 @@ class At extends Ve {
|
|
|
4051
4087
|
}
|
|
4052
4088
|
}
|
|
4053
4089
|
const ee = 1;
|
|
4054
|
-
class
|
|
4090
|
+
class zi extends ft {
|
|
4055
4091
|
constructor(e, r) {
|
|
4056
4092
|
var s;
|
|
4057
4093
|
super(e);
|
|
@@ -4061,7 +4097,7 @@ class Di extends ft {
|
|
|
4061
4097
|
c(this, "createLabel", wt.create);
|
|
4062
4098
|
c(this, "createCircle", vt.create);
|
|
4063
4099
|
c(this, "createPolygon", Bt.create);
|
|
4064
|
-
c(this, "createPolyline",
|
|
4100
|
+
c(this, "createPolyline", xt.create);
|
|
4065
4101
|
c(this, "createRectangle", St.create);
|
|
4066
4102
|
c(this, "createInfoWindow", Tt.create);
|
|
4067
4103
|
c(this, "createInfoBox", Ot.create);
|
|
@@ -4069,7 +4105,7 @@ class Di extends ft {
|
|
|
4069
4105
|
c(this, "createMapTypeControl", ct.create);
|
|
4070
4106
|
c(this, "createZoomControl", pt.create);
|
|
4071
4107
|
c(this, "createScaleControl", dt.create);
|
|
4072
|
-
this.buildInMapTypeId2BIMT =
|
|
4108
|
+
this.buildInMapTypeId2BIMT = $.BUILD_IN_MAP_TYPES.getValueMap(A.prototype.getId), this.baiduMapType2BIMT = $.BUILD_IN_MAP_TYPES.getValueMap(A.prototype.asBaiduMapType), this.map = new BMap.Map(e, {
|
|
4073
4109
|
minZoom: r.minZoom && r.minZoom + ee,
|
|
4074
4110
|
maxZoom: r.maxZoom && r.maxZoom + ee,
|
|
4075
4111
|
mapType: r.buildInMapTypeId && ((s = this.buildInMapTypeId2BIMT.get(r.buildInMapTypeId)) == null ? void 0 : s.asBaiduMapType()),
|
|
@@ -4183,7 +4219,7 @@ class Di extends ft {
|
|
|
4183
4219
|
});
|
|
4184
4220
|
}
|
|
4185
4221
|
getBounds() {
|
|
4186
|
-
return
|
|
4222
|
+
return R.fromBaidu(this.map.getBounds(), this.coordType);
|
|
4187
4223
|
}
|
|
4188
4224
|
addElementOverlay(e) {
|
|
4189
4225
|
this.map.addOverlay(e.asBaidu());
|
|
@@ -4202,7 +4238,7 @@ class Di extends ft {
|
|
|
4202
4238
|
const r = class extends BMap.Control {
|
|
4203
4239
|
constructor() {
|
|
4204
4240
|
super(...arguments);
|
|
4205
|
-
c(this, "defaultAnchor",
|
|
4241
|
+
c(this, "defaultAnchor", z.getBaidu().toValue(e.position));
|
|
4206
4242
|
c(this, "defaultOffset", new BMap.Size(0, 0));
|
|
4207
4243
|
}
|
|
4208
4244
|
initialize(n) {
|
|
@@ -4232,7 +4268,7 @@ class Di extends ft {
|
|
|
4232
4268
|
return new Ie(e);
|
|
4233
4269
|
}
|
|
4234
4270
|
}
|
|
4235
|
-
class
|
|
4271
|
+
class Di extends ft {
|
|
4236
4272
|
constructor(e, r) {
|
|
4237
4273
|
var n;
|
|
4238
4274
|
super(e);
|
|
@@ -4250,10 +4286,10 @@ class zi extends ft {
|
|
|
4250
4286
|
c(this, "createMapTypeControl", ke.create);
|
|
4251
4287
|
c(this, "createZoomControl", gt.create);
|
|
4252
4288
|
c(this, "createScaleControl", ut.create);
|
|
4253
|
-
this.mapOptions = r, this.buildInMapTypeId2BIMT =
|
|
4289
|
+
this.mapOptions = r, this.buildInMapTypeId2BIMT = $.BUILD_IN_MAP_TYPES.getValueMap(A.prototype.getId), this.googleMapTypeId2BIMT = $.BUILD_IN_MAP_TYPES.getValueMap(A.prototype.getGoogleMapTypeId);
|
|
4254
4290
|
const s = r.buildInMapTypeId && this.buildInMapTypeId2BIMT.get(r.buildInMapTypeId);
|
|
4255
4291
|
this.map = new google.maps.Map(e, {
|
|
4256
|
-
center: r.center.toGoogle((s ??
|
|
4292
|
+
center: r.center.toGoogle((s ?? $.NORMAL).getGoogleCoordType()),
|
|
4257
4293
|
zoom: r.zoom,
|
|
4258
4294
|
disableDefaultUI: !0,
|
|
4259
4295
|
streetViewControl: !0,
|
|
@@ -4325,7 +4361,7 @@ class zi extends ft {
|
|
|
4325
4361
|
this.map.setMapTypeId(r ?? C("理论上来说不可能为空"));
|
|
4326
4362
|
}
|
|
4327
4363
|
setMapType(e) {
|
|
4328
|
-
e instanceof
|
|
4364
|
+
e instanceof A ? this.map.setMapTypeId(e.getGoogleMapTypeId()) : (this.map.mapTypes.set(e.id, e.asGoogleMapType()), this.map.setMapTypeId(e.id));
|
|
4329
4365
|
}
|
|
4330
4366
|
getMapType() {
|
|
4331
4367
|
const e = this.map.getMapTypeId() ?? google.maps.MapTypeId.ROADMAP, r = this.googleMapTypeId2BIMT.get(e);
|
|
@@ -4354,7 +4390,7 @@ class zi extends ft {
|
|
|
4354
4390
|
}
|
|
4355
4391
|
getBounds() {
|
|
4356
4392
|
const e = this.map.getBounds();
|
|
4357
|
-
return e ?
|
|
4393
|
+
return e ? R.fromGoogle(e, this.coordType) : R.EMPTY;
|
|
4358
4394
|
}
|
|
4359
4395
|
addElementOverlay(e) {
|
|
4360
4396
|
e.asGoogle().setMap(this.map);
|
|
@@ -4369,11 +4405,11 @@ class zi extends ft {
|
|
|
4369
4405
|
e.innerOverlay.setMap(null);
|
|
4370
4406
|
}
|
|
4371
4407
|
addCustomControl(e) {
|
|
4372
|
-
e.inner || (e.inner = e.onCreateElement(), this.map.controls[
|
|
4408
|
+
e.inner || (e.inner = e.onCreateElement(), this.map.controls[z.getGoogle().toValue(e.position)].push(e.inner));
|
|
4373
4409
|
}
|
|
4374
4410
|
removeCustomControl(e) {
|
|
4375
4411
|
if (e.inner) {
|
|
4376
|
-
const r = this.map.controls[
|
|
4412
|
+
const r = this.map.controls[z.getGoogle().toValue(e.position)];
|
|
4377
4413
|
ce.remove(r, e.inner);
|
|
4378
4414
|
}
|
|
4379
4415
|
}
|
|
@@ -4415,7 +4451,7 @@ class Ni extends ft {
|
|
|
4415
4451
|
return this.map;
|
|
4416
4452
|
}
|
|
4417
4453
|
get coordType() {
|
|
4418
|
-
return
|
|
4454
|
+
return S.wgs84;
|
|
4419
4455
|
}
|
|
4420
4456
|
getCenter() {
|
|
4421
4457
|
return y.fromHere(this.map.getCenter(), this.coordType);
|
|
@@ -4551,9 +4587,9 @@ var G = /* @__PURE__ */ ((i) => (i.google = "google", i.baidu = "baidu", i.here
|
|
|
4551
4587
|
const n = it.create(s);
|
|
4552
4588
|
switch (e) {
|
|
4553
4589
|
case "google":
|
|
4554
|
-
return new zi(r, n);
|
|
4555
|
-
case "baidu":
|
|
4556
4590
|
return new Di(r, n);
|
|
4591
|
+
case "baidu":
|
|
4592
|
+
return new zi(r, n);
|
|
4557
4593
|
case "here":
|
|
4558
4594
|
return new Ni(r, n);
|
|
4559
4595
|
}
|
|
@@ -4675,7 +4711,7 @@ function Us(i) {
|
|
|
4675
4711
|
function Er() {
|
|
4676
4712
|
return Je();
|
|
4677
4713
|
}
|
|
4678
|
-
function
|
|
4714
|
+
function xe(i, t) {
|
|
4679
4715
|
const e = i.$options[t];
|
|
4680
4716
|
if (e)
|
|
4681
4717
|
for (const r of e)
|
|
@@ -4724,17 +4760,17 @@ const Ks = () => {
|
|
|
4724
4760
|
((s && s.type) !== i || Date.now() - (t ?? 0) > 1e3) && e(s);
|
|
4725
4761
|
}
|
|
4726
4762
|
return { eventLog: e, eventLogLess: r };
|
|
4727
|
-
}, Rt = "$map", we = "onCreate", Ee = "onDestroy",
|
|
4763
|
+
}, Rt = "$map", we = "onCreate", Ee = "onDestroy", x = w({
|
|
4728
4764
|
inject: [Rt],
|
|
4729
4765
|
mounted() {
|
|
4730
|
-
|
|
4766
|
+
xe(this, we);
|
|
4731
4767
|
},
|
|
4732
4768
|
beforeUnmount() {
|
|
4733
|
-
|
|
4769
|
+
xe(this, Ee);
|
|
4734
4770
|
},
|
|
4735
4771
|
methods: {
|
|
4736
4772
|
recreate() {
|
|
4737
|
-
|
|
4773
|
+
xe(this, Ee), xe(this, we);
|
|
4738
4774
|
}
|
|
4739
4775
|
},
|
|
4740
4776
|
render() {
|
|
@@ -4841,7 +4877,7 @@ const Ks = () => {
|
|
|
4841
4877
|
},
|
|
4842
4878
|
mapType(i) {
|
|
4843
4879
|
var t;
|
|
4844
|
-
(t = this.map) == null || t.setMapType(i ??
|
|
4880
|
+
(t = this.map) == null || t.setMapType(i ?? $.NORMAL);
|
|
4845
4881
|
}
|
|
4846
4882
|
},
|
|
4847
4883
|
async mounted() {
|
|
@@ -4975,9 +5011,9 @@ function Ki(i, t, e, r, s, n) {
|
|
|
4975
5011
|
}
|
|
4976
5012
|
const Xi = /* @__PURE__ */ q(qi, [["render", Ki]]), Ji = w({
|
|
4977
5013
|
name: "tg-custom-control",
|
|
4978
|
-
mixins: [
|
|
5014
|
+
mixins: [x],
|
|
4979
5015
|
props: {
|
|
4980
|
-
position: Z(
|
|
5016
|
+
position: Z(I, I.RIGHT_BOTTOM)
|
|
4981
5017
|
},
|
|
4982
5018
|
setup() {
|
|
4983
5019
|
return {
|
|
@@ -5011,9 +5047,9 @@ function Qi(i, t, e, r, s, n) {
|
|
|
5011
5047
|
}
|
|
5012
5048
|
const es = /* @__PURE__ */ q(Ji, [["render", Qi]]), ts = w({
|
|
5013
5049
|
name: "tg-map-type-control",
|
|
5014
|
-
mixins: [
|
|
5050
|
+
mixins: [x],
|
|
5015
5051
|
props: {
|
|
5016
|
-
position: Z(
|
|
5052
|
+
position: Z(I, I.TOP_LEFT),
|
|
5017
5053
|
type: Z(hr),
|
|
5018
5054
|
mapTypes: m(Array)
|
|
5019
5055
|
},
|
|
@@ -5044,9 +5080,9 @@ const es = /* @__PURE__ */ q(Ji, [["render", Qi]]), ts = w({
|
|
|
5044
5080
|
}
|
|
5045
5081
|
}), rs = w({
|
|
5046
5082
|
name: "tg-scale-control",
|
|
5047
|
-
mixins: [
|
|
5083
|
+
mixins: [x],
|
|
5048
5084
|
props: {
|
|
5049
|
-
position: Z(
|
|
5085
|
+
position: Z(I, I.BOTTOM_RIGHT)
|
|
5050
5086
|
},
|
|
5051
5087
|
setup() {
|
|
5052
5088
|
return {
|
|
@@ -5067,7 +5103,7 @@ const es = /* @__PURE__ */ q(Ji, [["render", Qi]]), ts = w({
|
|
|
5067
5103
|
});
|
|
5068
5104
|
function Lr() {
|
|
5069
5105
|
var e;
|
|
5070
|
-
const i = (e =
|
|
5106
|
+
const i = (e = zr()) == null ? void 0 : e.type;
|
|
5071
5107
|
let t = (i == null ? void 0 : i.name) ?? (i == null ? void 0 : i.__name);
|
|
5072
5108
|
if (!t) {
|
|
5073
5109
|
const r = i == null ? void 0 : i.__file;
|
|
@@ -5076,7 +5112,7 @@ function Lr() {
|
|
|
5076
5112
|
return t;
|
|
5077
5113
|
}
|
|
5078
5114
|
function is() {
|
|
5079
|
-
const i =
|
|
5115
|
+
const i = Dr(Rt);
|
|
5080
5116
|
let t, e;
|
|
5081
5117
|
return i == null && C(`<${Lr() || "unknown"}>必须作为<tg-map>的子代组件`), {
|
|
5082
5118
|
mapRef: i,
|
|
@@ -5101,7 +5137,7 @@ function is() {
|
|
|
5101
5137
|
const ss = w({
|
|
5102
5138
|
name: "tg-zoom-control",
|
|
5103
5139
|
props: {
|
|
5104
|
-
position: Z(
|
|
5140
|
+
position: Z(I, I.RIGHT_BOTTOM)
|
|
5105
5141
|
},
|
|
5106
5142
|
setup(i) {
|
|
5107
5143
|
let t = void 0;
|
|
@@ -5116,7 +5152,7 @@ const ss = w({
|
|
|
5116
5152
|
}
|
|
5117
5153
|
}), ns = w({
|
|
5118
5154
|
name: "tg-marker-clusterer",
|
|
5119
|
-
mixins: [
|
|
5155
|
+
mixins: [x],
|
|
5120
5156
|
// markers从this.$children中读取, 故需要省略(Omit)
|
|
5121
5157
|
props: {
|
|
5122
5158
|
gridSize: m(Number),
|
|
@@ -5185,9 +5221,9 @@ function os(i, t, e, r, s, n) {
|
|
|
5185
5221
|
W(i.$slots, "default")
|
|
5186
5222
|
], 2);
|
|
5187
5223
|
}
|
|
5188
|
-
const
|
|
5224
|
+
const Pr = /* @__PURE__ */ q(ns, [["render", os]]), as = w({
|
|
5189
5225
|
name: "tg-traffic-layer",
|
|
5190
|
-
mixins: [
|
|
5226
|
+
mixins: [x],
|
|
5191
5227
|
// 请直接使用v-if来控制它的显隐
|
|
5192
5228
|
// 没有属性时, 写`{}`类型推断会有问题, 故注释掉
|
|
5193
5229
|
// props: {} satisfies Props<{}>,
|
|
@@ -5205,7 +5241,7 @@ const xr = /* @__PURE__ */ q(ns, [["render", os]]), as = w({
|
|
|
5205
5241
|
}
|
|
5206
5242
|
}), ls = w({
|
|
5207
5243
|
name: "tg-circle",
|
|
5208
|
-
mixins: [
|
|
5244
|
+
mixins: [x],
|
|
5209
5245
|
inheritAttrs: !1,
|
|
5210
5246
|
props: {
|
|
5211
5247
|
center: D(y),
|
|
@@ -5300,7 +5336,7 @@ class hs extends Ai {
|
|
|
5300
5336
|
}
|
|
5301
5337
|
const cs = w({
|
|
5302
5338
|
name: "tg-element-overlay",
|
|
5303
|
-
mixins: [
|
|
5339
|
+
mixins: [x],
|
|
5304
5340
|
props: {
|
|
5305
5341
|
mapPane: Z(Me, Me.overlayMouseTarget),
|
|
5306
5342
|
position: D(y)
|
|
@@ -5339,7 +5375,7 @@ function ds(i, t, e, r, s, n) {
|
|
|
5339
5375
|
}
|
|
5340
5376
|
const us = /* @__PURE__ */ q(cs, [["render", ds]]), ps = w({
|
|
5341
5377
|
name: "tg-marker",
|
|
5342
|
-
mixins: [
|
|
5378
|
+
mixins: [x],
|
|
5343
5379
|
inheritAttrs: !1,
|
|
5344
5380
|
props: {
|
|
5345
5381
|
position: D(y),
|
|
@@ -5351,6 +5387,7 @@ const us = /* @__PURE__ */ q(cs, [["render", ds]]), ps = w({
|
|
|
5351
5387
|
cursor: m(String),
|
|
5352
5388
|
zIndex: m(Number),
|
|
5353
5389
|
visible: m(Boolean),
|
|
5390
|
+
normalizePositionForBaidu: m(Boolean),
|
|
5354
5391
|
"onUpdate:position": L()
|
|
5355
5392
|
},
|
|
5356
5393
|
emits: void 0,
|
|
@@ -5407,7 +5444,7 @@ const us = /* @__PURE__ */ q(cs, [["render", ds]]), ps = w({
|
|
|
5407
5444
|
},
|
|
5408
5445
|
methods: {
|
|
5409
5446
|
$clusterer() {
|
|
5410
|
-
return Jt(this.$parent,
|
|
5447
|
+
return Jt(this.$parent, Pr);
|
|
5411
5448
|
},
|
|
5412
5449
|
onAddLabel(i) {
|
|
5413
5450
|
this.label = i, this.marker && this.marker.setLabel(i.overlay);
|
|
@@ -5435,7 +5472,7 @@ function gs(i, t, e, r, s, n) {
|
|
|
5435
5472
|
}
|
|
5436
5473
|
const Fe = /* @__PURE__ */ q(ps, [["render", gs]]), ms = w({
|
|
5437
5474
|
name: "tg-info-box",
|
|
5438
|
-
mixins: [
|
|
5475
|
+
mixins: [x],
|
|
5439
5476
|
inheritAttrs: !1,
|
|
5440
5477
|
props: {
|
|
5441
5478
|
show: D(Boolean),
|
|
@@ -5515,7 +5552,7 @@ function fs(i, t, e, r, s, n) {
|
|
|
5515
5552
|
}
|
|
5516
5553
|
const ys = /* @__PURE__ */ q(ms, [["render", fs]]), vs = w({
|
|
5517
5554
|
name: "tg-info-window",
|
|
5518
|
-
mixins: [
|
|
5555
|
+
mixins: [x],
|
|
5519
5556
|
inheritAttrs: !1,
|
|
5520
5557
|
props: {
|
|
5521
5558
|
show: D(Boolean),
|
|
@@ -5588,7 +5625,7 @@ function _s(i, t, e, r, s, n) {
|
|
|
5588
5625
|
}
|
|
5589
5626
|
const bs = /* @__PURE__ */ q(vs, [["render", _s]]), Ts = w({
|
|
5590
5627
|
name: "tg-label",
|
|
5591
|
-
mixins: [
|
|
5628
|
+
mixins: [x],
|
|
5592
5629
|
inheritAttrs: !1,
|
|
5593
5630
|
props: {
|
|
5594
5631
|
position: m(y),
|
|
@@ -5657,7 +5694,7 @@ function Ms(i, t, e, r, s, n) {
|
|
|
5657
5694
|
}
|
|
5658
5695
|
const Os = /* @__PURE__ */ q(Ts, [["render", Ms]]), Cs = w({
|
|
5659
5696
|
name: "tg-polygon",
|
|
5660
|
-
mixins: [
|
|
5697
|
+
mixins: [x],
|
|
5661
5698
|
inheritAttrs: !1,
|
|
5662
5699
|
props: {
|
|
5663
5700
|
paths: D(Array),
|
|
@@ -5726,7 +5763,7 @@ const Os = /* @__PURE__ */ q(Ts, [["render", Ms]]), Cs = w({
|
|
|
5726
5763
|
}
|
|
5727
5764
|
}), ws = w({
|
|
5728
5765
|
name: "tg-polyline",
|
|
5729
|
-
mixins: [
|
|
5766
|
+
mixins: [x],
|
|
5730
5767
|
inheritAttrs: !1,
|
|
5731
5768
|
props: {
|
|
5732
5769
|
path: D(Array),
|
|
@@ -5787,7 +5824,7 @@ const Os = /* @__PURE__ */ q(Ts, [["render", Ms]]), Cs = w({
|
|
|
5787
5824
|
}
|
|
5788
5825
|
}), Es = w({
|
|
5789
5826
|
name: "tg-rectangle",
|
|
5790
|
-
mixins: [
|
|
5827
|
+
mixins: [x],
|
|
5791
5828
|
inheritAttrs: !1,
|
|
5792
5829
|
props: {
|
|
5793
5830
|
bounds: D(Object),
|
|
@@ -5897,44 +5934,44 @@ const Os = /* @__PURE__ */ q(Ts, [["render", Ms]]), Cs = w({
|
|
|
5897
5934
|
i.mixin(e);
|
|
5898
5935
|
}
|
|
5899
5936
|
}
|
|
5900
|
-
},
|
|
5937
|
+
}, Ps = 6378137;
|
|
5901
5938
|
function ye(i) {
|
|
5902
5939
|
return i * Math.PI / 180;
|
|
5903
5940
|
}
|
|
5904
5941
|
function Ut(i) {
|
|
5905
5942
|
return i * 180 / Math.PI;
|
|
5906
5943
|
}
|
|
5907
|
-
function
|
|
5944
|
+
function xs(i, t) {
|
|
5908
5945
|
if (i.lat === t.lat && i.lng === t.lng)
|
|
5909
5946
|
return 0;
|
|
5910
5947
|
const e = ye((i.lat + t.lat) / 2), r = ye((i.lat - t.lat) / 2), s = ye((i.lng - t.lng) / 2);
|
|
5911
5948
|
let n = Math.sin(r), a = Math.sin(s), h = Math.sin(e);
|
|
5912
|
-
const o =
|
|
5949
|
+
const o = Ps, l = 1 / 298.257;
|
|
5913
5950
|
n = n * n, a = a * a, h = h * h;
|
|
5914
5951
|
const d = n * (1 - a) + (1 - h) * a, u = (1 - n) * (1 - a) + h * a, p = Math.atan(Math.sqrt(d / u)), b = Math.sqrt(d * u) / p, _ = 2 * p * o, T = (3 * b - 1) / 2 / u, g = (3 * b + 1) / 2 / d;
|
|
5915
5952
|
return _ * (1 + l * (T * h * (1 - n) - g * (1 - h) * n));
|
|
5916
5953
|
}
|
|
5917
5954
|
function ks(i, t, e) {
|
|
5918
5955
|
const s = 63567523142e-4, n = 1 / 298.257223563, a = ye(t), h = Math.sin(a), o = Math.cos(a), l = (1 - n) * Math.tan(ye(i.lat)), d = 1 / Math.sqrt(1 + l * l), u = l * d, p = Math.atan2(l, o), b = d * h, _ = 1 - b * b, T = _ * (6378137 * 6378137 - s * s) / (s * s), g = 1 + T / 16384 * (4096 + T * (-768 + T * (320 - 175 * T))), f = T / 1024 * (256 + T * (-128 + T * (74 - 47 * T)));
|
|
5919
|
-
let v = 0, O = 0,
|
|
5956
|
+
let v = 0, O = 0, P = 0, E = e / (s * g), Q = 2 * Math.PI;
|
|
5920
5957
|
for (; Math.abs(E - Q) > 1e-12; ) {
|
|
5921
|
-
v = Math.cos(2 * p + E), O = Math.sin(E),
|
|
5922
|
-
const Br = f * O * (v + f / 4 * (
|
|
5958
|
+
v = Math.cos(2 * p + E), O = Math.sin(E), P = Math.cos(E);
|
|
5959
|
+
const Br = f * O * (v + f / 4 * (P * (-1 + 2 * v * v) - f / 6 * v * (-3 + 4 * O * O) * (-3 + 4 * v * v)));
|
|
5923
5960
|
Q = E, E = e / (s * g) + Br;
|
|
5924
5961
|
}
|
|
5925
|
-
const ie = u * O - d *
|
|
5926
|
-
u *
|
|
5962
|
+
const ie = u * O - d * P * o, Ue = Math.atan2(
|
|
5963
|
+
u * P + d * O * o,
|
|
5927
5964
|
(1 - n) * Math.sqrt(b * b + ie * ie)
|
|
5928
|
-
),
|
|
5965
|
+
), xr = Math.atan2(O * h, d * P - u * O * o), Ye = n / 16 * _ * (4 + n * (4 - 3 * _)), kr = xr - (1 - Ye) * n * b * (E + Ye * O * (v + Ye * P * (-1 + 2 * v * v)));
|
|
5929
5966
|
return { lng: i.lng + Ut(kr), lat: Ut(Ue) };
|
|
5930
5967
|
}
|
|
5931
5968
|
const Js = {
|
|
5932
|
-
getDistance:
|
|
5969
|
+
getDistance: xs,
|
|
5933
5970
|
getDestination: ks
|
|
5934
5971
|
}, Qs = {
|
|
5935
5972
|
install(i, t) {
|
|
5936
5973
|
if (ai(t), {}.VITE_FALSE) {
|
|
5937
|
-
const r = /* @__PURE__ */ Object.assign({ "./TgMap.vue": Le, "./TgMapWidget.vue": Xi, "./controls/TgCustomControl.vue": es, "./controls/TgMapTypeControl.vue": ts, "./controls/TgScaleControl.vue": rs, "./controls/TgZoomControl.vue": ss, "./extra/TgMarkerClusterer.vue":
|
|
5974
|
+
const r = /* @__PURE__ */ Object.assign({ "./TgMap.vue": Le, "./TgMapWidget.vue": Xi, "./controls/TgCustomControl.vue": es, "./controls/TgMapTypeControl.vue": ts, "./controls/TgScaleControl.vue": rs, "./controls/TgZoomControl.vue": ss, "./extra/TgMarkerClusterer.vue": Pr, "./layers/TgTrafficLayer.vue": as, "./overlays/TgCircle.vue": ls, "./overlays/TgElementOverlay.vue": us, "./overlays/TgInfoBox.vue": ys, "./overlays/TgInfoWindow.vue": bs, "./overlays/TgLabel.vue": Os, "./overlays/TgMarker.vue": Fe, "./overlays/TgPolygon.vue": Cs, "./overlays/TgPolyline.vue": ws, "./overlays/TgRectangle.vue": Es });
|
|
5938
5975
|
Object.keys(r).forEach((s) => {
|
|
5939
5976
|
const n = r[s];
|
|
5940
5977
|
i.component(n.name ?? C(`Tg开头的组件必须设置name: ${s}`), n);
|
|
@@ -5960,19 +5997,19 @@ export {
|
|
|
5960
5997
|
Mi as BaiduMarkerClusterer,
|
|
5961
5998
|
je as BaiduOverlay,
|
|
5962
5999
|
wi as BaiduPlacesService,
|
|
5963
|
-
|
|
6000
|
+
Pt as BaiduPolyShape,
|
|
5964
6001
|
Bt as BaiduPolygon,
|
|
5965
|
-
|
|
6002
|
+
xt as BaiduPolyline,
|
|
5966
6003
|
St as BaiduRectangle,
|
|
5967
6004
|
dt as BaiduScaleControl,
|
|
5968
6005
|
Li as BaiduSearchBox,
|
|
5969
6006
|
pt as BaiduZoomControl,
|
|
5970
|
-
|
|
6007
|
+
A as BuildInMapType,
|
|
5971
6008
|
lr as BuildInMapTypeId,
|
|
5972
6009
|
fe as CachedValue,
|
|
5973
|
-
|
|
5974
|
-
|
|
5975
|
-
|
|
6010
|
+
I as ControlPosition,
|
|
6011
|
+
z as ControlPositionConverter,
|
|
6012
|
+
S as CoordType,
|
|
5976
6013
|
di as CustomControl,
|
|
5977
6014
|
ci as FastFindValues,
|
|
5978
6015
|
fi as GoogleAutocomplete,
|
|
@@ -5992,23 +6029,23 @@ export {
|
|
|
5992
6029
|
ut as GoogleScaleControl,
|
|
5993
6030
|
Ei as GoogleSearchBox,
|
|
5994
6031
|
gt as GoogleZoomControl,
|
|
5995
|
-
|
|
6032
|
+
ze as Icon,
|
|
5996
6033
|
Zs as ImageMapType,
|
|
5997
6034
|
bt as InfoWindow,
|
|
5998
6035
|
Zt as KeyValue,
|
|
5999
6036
|
y as LatLng,
|
|
6000
|
-
|
|
6037
|
+
R as LatLngBounds,
|
|
6001
6038
|
Xs as LifecycleLogPlugin,
|
|
6002
6039
|
K as Location,
|
|
6003
6040
|
we as MIXIN_HOOK_CREATE,
|
|
6004
6041
|
Ee as MIXIN_HOOK_DESTROY,
|
|
6005
6042
|
Rt as MIXIN_MAP_NAME,
|
|
6006
6043
|
ce as MVCArrays,
|
|
6007
|
-
|
|
6008
|
-
|
|
6044
|
+
x as MapMixin,
|
|
6045
|
+
$ as MapType,
|
|
6009
6046
|
hr as MapTypeControlType,
|
|
6010
6047
|
gr as MapUrls,
|
|
6011
|
-
|
|
6048
|
+
Pi as MapZoom,
|
|
6012
6049
|
br as MarkerClusterer,
|
|
6013
6050
|
be as Objects,
|
|
6014
6051
|
Cr as Overlay,
|
|
@@ -6017,7 +6054,7 @@ export {
|
|
|
6017
6054
|
Mr as SearchBox,
|
|
6018
6055
|
Js as SphericalUtils,
|
|
6019
6056
|
Te as Strings,
|
|
6020
|
-
|
|
6057
|
+
De as SymbolIcon,
|
|
6021
6058
|
Vs as SymbolPath,
|
|
6022
6059
|
ls as TgCircle,
|
|
6023
6060
|
es as TgCustomControl,
|
|
@@ -6031,7 +6068,7 @@ export {
|
|
|
6031
6068
|
ts as TgMapTypeControl,
|
|
6032
6069
|
Xi as TgMapWidget,
|
|
6033
6070
|
Fe as TgMarker,
|
|
6034
|
-
|
|
6071
|
+
Pr as TgMarkerClusterer,
|
|
6035
6072
|
Cs as TgPolygon,
|
|
6036
6073
|
ws as TgPolyline,
|
|
6037
6074
|
Es as TgRectangle,
|
|
@@ -6042,7 +6079,7 @@ export {
|
|
|
6042
6079
|
$e as UnionIcon,
|
|
6043
6080
|
oe as assert,
|
|
6044
6081
|
Qe as assertNever,
|
|
6045
|
-
|
|
6082
|
+
xe as callHook,
|
|
6046
6083
|
Fs as computedSaveOnThis,
|
|
6047
6084
|
Er as createEmptyVNode,
|
|
6048
6085
|
ji as createPropertyObject,
|
|
@@ -6072,9 +6109,9 @@ export {
|
|
|
6072
6109
|
Hi as stringUnionPropFromValues,
|
|
6073
6110
|
C as throwError,
|
|
6074
6111
|
at as throwUnsupported,
|
|
6075
|
-
|
|
6112
|
+
Ds as todo,
|
|
6076
6113
|
et as typed,
|
|
6077
|
-
|
|
6114
|
+
zs as unwrapStringEnumValue,
|
|
6078
6115
|
Ks as useEventLogMethods,
|
|
6079
6116
|
Y as useSplittedAttrs,
|
|
6080
6117
|
is as useTgMapInner
|