tg-map-vue3 3.4.6 → 3.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/map/lat-lng.d.ts +8 -0
- package/dist/src/utils/arrays.d.ts +6 -1
- package/dist/tg-map.js +22 -18
- package/dist/tg-map.js.map +1 -1
- package/dist/tg-map.umd.cjs +2 -2
- package/dist/tg-map.umd.cjs.map +1 -1
- package/package.json +1 -1
|
@@ -74,6 +74,14 @@ export declare class LatLngBounds {
|
|
|
74
74
|
ne: LatLng;
|
|
75
75
|
static EMPTY: LatLngBounds;
|
|
76
76
|
static isBetweenLng(minLng: number, maxLng: number, lng: number): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* 从数组创建bounds
|
|
79
|
+
*
|
|
80
|
+
* 只有{@link positions}为空时, 才会返回`undefined`, 可以借助{@link Arrays.isNotEmpty}协助进行类型推断
|
|
81
|
+
*/
|
|
82
|
+
static fromArray(positions: readonly []): undefined;
|
|
83
|
+
/** @see Arrays.isNotEmpty */
|
|
84
|
+
static fromArray(positions: readonly [LatLng, ...LatLng[]]): LatLngBounds;
|
|
77
85
|
static fromArray(positions: readonly LatLng[]): LatLngBounds | undefined;
|
|
78
86
|
static from(...positions: LatLng[]): LatLngBounds;
|
|
79
87
|
static fromGoogle(bounds: google.maps.LatLngBounds, coord: CoordType): LatLngBounds;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="google.maps" />
|
|
2
|
-
import type
|
|
2
|
+
import { type AnyFunction, type Constructor } from '../components';
|
|
3
3
|
export declare namespace Arrays {
|
|
4
4
|
/**
|
|
5
5
|
* 浅层比较
|
|
@@ -14,6 +14,11 @@ export declare namespace Arrays {
|
|
|
14
14
|
function at<T>(arr: T[], index: number, value: T): void;
|
|
15
15
|
/** 获取 指定位置的值 */
|
|
16
16
|
function at<T>(arr: T[], index: number): T | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* 判断并推断数组非空
|
|
19
|
+
* @see https://stackoverflow.com/questions/56006111/is-it-possible-to-define-a-non-empty-array-type-in-typescript
|
|
20
|
+
*/
|
|
21
|
+
function isNotEmpty<T>(arr: T[]): arr is [T, ...T[]];
|
|
17
22
|
}
|
|
18
23
|
export declare namespace MVCArrays {
|
|
19
24
|
function indexOf<T>(arr: google.maps.MVCArray<T>, item: T): number;
|
package/dist/tg-map.js
CHANGED
|
@@ -430,33 +430,37 @@ var Ve;
|
|
|
430
430
|
})(Ve || (Ve = {}));
|
|
431
431
|
var ae;
|
|
432
432
|
((i) => {
|
|
433
|
-
function t(
|
|
434
|
-
return
|
|
433
|
+
function t(h, o) {
|
|
434
|
+
return h.length === o.length && h.every((l, d) => l === o[d]);
|
|
435
435
|
}
|
|
436
436
|
i.equals = t;
|
|
437
|
-
function e(
|
|
438
|
-
const
|
|
439
|
-
if (
|
|
440
|
-
return
|
|
437
|
+
function e(h, o) {
|
|
438
|
+
const l = h.indexOf(o);
|
|
439
|
+
if (l !== -1)
|
|
440
|
+
return h.splice(l, 1)[0];
|
|
441
441
|
}
|
|
442
442
|
i.remove = e;
|
|
443
|
-
function r(
|
|
444
|
-
for (const
|
|
445
|
-
if (
|
|
446
|
-
return
|
|
443
|
+
function r(h, o) {
|
|
444
|
+
for (const l of h)
|
|
445
|
+
if (l instanceof o)
|
|
446
|
+
return l;
|
|
447
447
|
}
|
|
448
448
|
i.findByType = r;
|
|
449
|
-
function s(
|
|
450
|
-
return
|
|
449
|
+
function s(h, o) {
|
|
450
|
+
return h.includes(o);
|
|
451
451
|
}
|
|
452
452
|
i.includesTyped = s;
|
|
453
|
-
function n(
|
|
454
|
-
const
|
|
455
|
-
if (
|
|
456
|
-
return
|
|
457
|
-
|
|
453
|
+
function n(h, o, l) {
|
|
454
|
+
const d = o >= 0 ? o : h.length + o;
|
|
455
|
+
if (l === void 0)
|
|
456
|
+
return h[d];
|
|
457
|
+
h[d] = l;
|
|
458
458
|
}
|
|
459
459
|
i.at = n;
|
|
460
|
+
function a(h) {
|
|
461
|
+
return h.length > 0;
|
|
462
|
+
}
|
|
463
|
+
i.isNotEmpty = a;
|
|
460
464
|
})(ae || (ae = {}));
|
|
461
465
|
var le;
|
|
462
466
|
((i) => {
|
|
@@ -5778,7 +5782,7 @@ const Gs = {
|
|
|
5778
5782
|
getDestination: ns
|
|
5779
5783
|
}, Zs = {
|
|
5780
5784
|
install(i, t) {
|
|
5781
|
-
qr(t)
|
|
5785
|
+
qr(t);
|
|
5782
5786
|
const e = i.config.optionMergeStrategies;
|
|
5783
5787
|
e[be] = e[Me] = (r, s) => r ? [...new Set([].concat(r, s))] : Array.isArray(s) ? s : [s];
|
|
5784
5788
|
}
|