tg-map-vue3 3.4.6 → 3.5.0
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 +5 -0
- package/dist/src/components/controls/TgZoomControl.vue.d.ts +1 -1
- package/dist/src/components/map-hooks.d.ts +1 -1
- package/dist/src/components/map-mixin.d.ts +1 -1
- package/dist/src/map/lat-lng.d.ts +8 -0
- package/dist/src/utils/arrays.d.ts +6 -1
- package/dist/tg-map.js +23 -19
- 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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# 更新日志
|
|
2
2
|
|
|
3
|
+
## 3.5.x
|
|
4
|
+
|
|
5
|
+
- ***BREAKING CHANGE***: `useTgMap` -> [useTgMapInner]
|
|
6
|
+
|
|
3
7
|
## 3.4.x
|
|
4
8
|
|
|
5
9
|
- feat: 添加矩形[TgRectangle]
|
|
@@ -38,3 +42,4 @@
|
|
|
38
42
|
[PlacesService]: src/map/map/extra/places-service.ts "位置服务"
|
|
39
43
|
[Autocomplete]: src/map/map/extra/autocomplete.ts "自动完成"
|
|
40
44
|
[SearchBox]: src/map/map/extra/search-box.ts "搜索框"
|
|
45
|
+
[useTgMapInner]: src/components/map-hooks.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createEmptyVNode } from '../../utils/vue-utils';
|
|
2
1
|
import { ControlPosition } from '../../map/map/controls/control';
|
|
2
|
+
import { createEmptyVNode } from '../../utils/vue-utils';
|
|
3
3
|
declare const _default: import("vue").DefineComponent<{
|
|
4
4
|
position: {
|
|
5
5
|
type: import("vue").PropType<import("../../utils/mapped-types").StringEnumValue<typeof ControlPosition>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Ref } from 'vue';
|
|
2
2
|
import { type AbstractMap } from '.';
|
|
3
3
|
/** 作为Vue3下, `MapMixin`的替代 */
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function useTgMapInner(): {
|
|
5
5
|
mapRef: Ref<AbstractMap | undefined>;
|
|
6
6
|
/** 读取map对象, 只要放在<tg-map>里面的组件(除#overlay插槽外)都能够立即读取到map对象 */
|
|
7
7
|
readonly map: AbstractMap;
|
|
@@ -14,7 +14,7 @@ declare module 'vue' {
|
|
|
14
14
|
[MIXIN_HOOK_DESTROY]?(): void;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
/** @deprecated 使用{@link
|
|
17
|
+
/** @deprecated 使用{@link useTgMapInner}替代 */
|
|
18
18
|
declare const MapMixin: import("vue").DefineComponent<{}, {}, {}, {}, {
|
|
19
19
|
recreate(): void;
|
|
20
20
|
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
|
@@ -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
|
}
|
|
@@ -5904,6 +5908,6 @@ export {
|
|
|
5904
5908
|
ms as unwrapStringEnumValue,
|
|
5905
5909
|
Cs as useEventLogMethods,
|
|
5906
5910
|
F as useSplittedAttrs,
|
|
5907
|
-
Gi as
|
|
5911
|
+
Gi as useTgMapInner
|
|
5908
5912
|
};
|
|
5909
5913
|
//# sourceMappingURL=tg-map.js.map
|