twcpt 0.0.14 → 0.0.16
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/components/j-tw-amap/composables/useAMapCore.d.ts +19 -0
- package/dist/components/j-tw-amap/composables/useAMapPoints.d.ts +277 -0
- package/dist/components/j-tw-amap/composables/useAMapPolyline.d.ts +16 -0
- package/dist/components/j-tw-amap/composables/useAMapTrack.d.ts +159 -0
- package/dist/components/j-tw-amap/constants.d.ts +23 -0
- package/dist/components/j-tw-amap/index.d.ts +175 -0
- package/dist/components/j-tw-amap/types.d.ts +44 -0
- package/dist/components/j-tw-amap/utils/coordinate.d.ts +17 -0
- package/dist/components/j-tw-amap/utils/loader.d.ts +12 -0
- package/dist/components/j-tw-amap/utils/parse.d.ts +17 -0
- package/dist/components/j-tw-datetime-picker/index.d.ts +1645 -0
- package/dist/components/j-tw-datetime-picker/types.d.ts +70 -0
- package/dist/components/j-tw-dialog/index.d.ts +28 -0
- package/dist/components/j-tw-dialog/types.d.ts +12 -0
- package/dist/global.d.ts +20 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/twcpt-styles.css +1 -1
- package/dist/twcpt.cjs.js +63 -5
- package/dist/twcpt.es.js +6751 -2550
- package/dist/types/coordtransform.d.ts +49 -0
- package/dist/utils/init.d.ts +4 -0
- package/dist/utils/useRAFPolling.d.ts +13 -0
- package/package.json +10 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AMapComponent 公共类型定义
|
|
3
|
+
*/
|
|
4
|
+
/** 经纬度 [lng, lat] */
|
|
5
|
+
export type LngLat = [number, number];
|
|
6
|
+
/** 路径:单条为 LngLat[],多航线为 LngLat[][] */
|
|
7
|
+
export type PathInput = LngLat[] | LngLat[][];
|
|
8
|
+
/** 地图类型 */
|
|
9
|
+
export type MapType = 'normal' | 'satellite';
|
|
10
|
+
/** 视图模式 */
|
|
11
|
+
export type ViewMode = '2D' | '3D';
|
|
12
|
+
/** 点位类型 */
|
|
13
|
+
export type PointType = 'drone' | 'base';
|
|
14
|
+
/** 点位数据(支持多种字段名) */
|
|
15
|
+
export interface MapPointItem {
|
|
16
|
+
longitude?: number;
|
|
17
|
+
latitude?: number;
|
|
18
|
+
name?: string;
|
|
19
|
+
nickName?: string;
|
|
20
|
+
label?: string;
|
|
21
|
+
link?: string;
|
|
22
|
+
url?: string;
|
|
23
|
+
onClick?: (point: MapPointItem) => void;
|
|
24
|
+
[key: string]: unknown;
|
|
25
|
+
}
|
|
26
|
+
/** 组件 Props 类型(供 composable 使用) */
|
|
27
|
+
export interface AMapProps {
|
|
28
|
+
lineArr: PathInput;
|
|
29
|
+
points: MapPointItem[];
|
|
30
|
+
pointType: PointType;
|
|
31
|
+
label: string[];
|
|
32
|
+
center: LngLat;
|
|
33
|
+
zoom: number;
|
|
34
|
+
circleRadius: number;
|
|
35
|
+
trackPoints: LngLat[];
|
|
36
|
+
mapType: MapType;
|
|
37
|
+
highlightLineIndex: number;
|
|
38
|
+
highlightStrokeColor: string;
|
|
39
|
+
mapLineArr: LngLat[][];
|
|
40
|
+
trackLineArr: LngLat[][];
|
|
41
|
+
routeCompletedList: (boolean | number)[];
|
|
42
|
+
viewMode: ViewMode;
|
|
43
|
+
elevationDimensionalId: string;
|
|
44
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { LngLat } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* 验证坐标是否有效 [lng, lat]
|
|
4
|
+
*/
|
|
5
|
+
export declare function isValidCoordinate(coord: unknown): coord is LngLat;
|
|
6
|
+
/**
|
|
7
|
+
* 将路径点数组转为高德坐标(WGS84 → GCJ02)
|
|
8
|
+
*/
|
|
9
|
+
export declare function toValidPath(path: LngLat[] | unknown): LngLat[];
|
|
10
|
+
/**
|
|
11
|
+
* 判断是否为多航线数据(lineArr 为 [ [ [lng,lat], ... ], ... ])
|
|
12
|
+
*/
|
|
13
|
+
export declare function isMultiRoute(arr: unknown): arr is LngLat[][];
|
|
14
|
+
/**
|
|
15
|
+
* 单点 WGS84 → GCJ02,无效时返回 null
|
|
16
|
+
*/
|
|
17
|
+
export declare function wgs84ToGcj02(lng: number, lat: number): LngLat | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface LoadAmapOptions {
|
|
2
|
+
plugins?: string[];
|
|
3
|
+
withLoca?: boolean;
|
|
4
|
+
}
|
|
5
|
+
/** 设置高德地图配置 */
|
|
6
|
+
export declare function setAmapConfig(config: {
|
|
7
|
+
key: string;
|
|
8
|
+
securityCode: string;
|
|
9
|
+
}): void;
|
|
10
|
+
export declare function loadAmap(options?: LoadAmapOptions): Promise<typeof AMap>;
|
|
11
|
+
export declare function loadLocaOnly(): Promise<void>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** 解析结果:合并点列 + 带状多段线 + 面状外轮廓(测区) */
|
|
2
|
+
export interface ParsedKmzRoute {
|
|
3
|
+
/** 用于中心点、兼容旧逻辑的合并轨迹点(WGS84) */
|
|
4
|
+
points: [number, number][];
|
|
5
|
+
/** 多 Folder 航迹(带状常见),每段一条折线 */
|
|
6
|
+
polylines: [number, number][][];
|
|
7
|
+
/** template.kml 中测区多边形外轮廓(闭合,面状测区) */
|
|
8
|
+
polygonOutline?: [number, number][];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 完整解析 KMZ:优先 wpmz/waylines.wpml,其次 wpmz/template.kml(面轮廓),再尝试任意 .kml + togeojson
|
|
12
|
+
*/
|
|
13
|
+
export declare function parseKMZRouteFromUrl(url: string): Promise<ParsedKmzRoute>;
|
|
14
|
+
/**
|
|
15
|
+
* 兼容旧调用:仅返回合并后的轨迹点(WGS84)
|
|
16
|
+
*/
|
|
17
|
+
export declare const parseKMZFromUrl: (url: string) => Promise<[number, number][]>;
|