twcpt 0.0.13 → 0.0.15
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-dialog/index.d.ts +25 -0
- package/dist/components/j-tw-dialog/types.d.ts +12 -0
- package/dist/components/j-tw-pagination/index.d.ts +189 -0
- package/dist/components/j-tw-pagination/types.d.ts +40 -0
- package/dist/components/j-tw-table/index.d.ts +326 -237
- 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 +6687 -2669
- 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,19 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { MapType, ViewMode } from '../types';
|
|
3
|
+
export interface UseAMapCoreOptions {
|
|
4
|
+
center: Ref<[number, number]>;
|
|
5
|
+
zoom: Ref<number>;
|
|
6
|
+
viewMode: Ref<ViewMode>;
|
|
7
|
+
mapType: Ref<MapType>;
|
|
8
|
+
isDark: Ref<boolean>;
|
|
9
|
+
}
|
|
10
|
+
export interface UseAMapCoreReturn {
|
|
11
|
+
initMap: (containerEl: HTMLElement | null) => Promise<AMap.Map | null>;
|
|
12
|
+
destroyMap: () => void;
|
|
13
|
+
getMap: () => AMap.Map | null;
|
|
14
|
+
getInfoWindow: () => AMap.InfoWindow | null;
|
|
15
|
+
setMapStyle: (isDark: boolean) => void;
|
|
16
|
+
setViewMode: (mode: ViewMode) => void;
|
|
17
|
+
setMapType: (type: MapType) => void;
|
|
18
|
+
}
|
|
19
|
+
export declare function useAMapCore(options: UseAMapCoreOptions): UseAMapCoreReturn;
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { LngLat, MapPointItem } from '../types';
|
|
3
|
+
export interface UseAMapPointsOptions {
|
|
4
|
+
getMap: () => AMap.Map | null;
|
|
5
|
+
getInfoWindow: () => AMap.InfoWindow | null;
|
|
6
|
+
points: Ref<MapPointItem[]>;
|
|
7
|
+
pointType: Ref<string>;
|
|
8
|
+
circleRadius: Ref<number>;
|
|
9
|
+
isDark: Ref<boolean>;
|
|
10
|
+
pointIcon: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function useAMapPoints(options: UseAMapPointsOptions): {
|
|
13
|
+
drawPoints: () => void;
|
|
14
|
+
showActionButton: (position: LngLat, link: string, pointName: string) => void;
|
|
15
|
+
clear: () => void;
|
|
16
|
+
mapPoints: Ref<{
|
|
17
|
+
markOnAMAP: (obj?: {
|
|
18
|
+
name?: string | undefined;
|
|
19
|
+
position?: AMap.LocationValue | undefined;
|
|
20
|
+
} | undefined) => void;
|
|
21
|
+
getAnchor: () => AMap.Marker.Anchor | undefined;
|
|
22
|
+
setAnchor: (anchor?: AMap.Marker.Anchor) => void;
|
|
23
|
+
getOffset: () => AMap.Pixel;
|
|
24
|
+
setOffset: (offset: AMap.Pixel) => void;
|
|
25
|
+
setAnimation: (animate: AMap.AnimationName, prevent?: boolean) => void;
|
|
26
|
+
getAnimation: () => AMap.AnimationName;
|
|
27
|
+
setClickable: (cilckable: boolean) => void;
|
|
28
|
+
getClickable: () => boolean;
|
|
29
|
+
getPosition: () => AMap.LngLat | undefined;
|
|
30
|
+
setPosition: (position: AMap.LocationValue) => void;
|
|
31
|
+
setAngle: (angle: number) => void;
|
|
32
|
+
setLabel: (label?: AMap.Marker.Label) => void;
|
|
33
|
+
getLabel: () => AMap.Marker.Label | undefined;
|
|
34
|
+
getAngle: () => number;
|
|
35
|
+
setzIndex: (index: number) => void;
|
|
36
|
+
getzIndex: () => number;
|
|
37
|
+
setIcon: (content: string | AMap.Icon) => void;
|
|
38
|
+
getIcon: () => string | AMap.Icon | undefined;
|
|
39
|
+
setDraggable: (draggable: boolean) => void;
|
|
40
|
+
getDraggable: () => boolean;
|
|
41
|
+
setCursor: (cursor: string) => void;
|
|
42
|
+
setContent: (content: string | HTMLElement) => void;
|
|
43
|
+
getContent: () => string | HTMLElement;
|
|
44
|
+
moveAlong: (path: AMap.LngLat[], speed: number, timingFunction?: ((t: number) => number) | undefined, circleable?: boolean) => void;
|
|
45
|
+
moveTo: (lnglat: AMap.LocationValue, speed: number, timingFunction?: ((t: number) => number) | undefined) => void;
|
|
46
|
+
stopMove: () => void;
|
|
47
|
+
pauseMove: () => boolean;
|
|
48
|
+
resumeMove: () => boolean;
|
|
49
|
+
setMap: (map: null | AMap.Map) => void;
|
|
50
|
+
setTitle: (title: string) => void;
|
|
51
|
+
getTitle: () => string | undefined;
|
|
52
|
+
setTop: (isTop: boolean) => void;
|
|
53
|
+
getTop: () => boolean;
|
|
54
|
+
setShadow: (icon?: AMap.Icon | string) => void;
|
|
55
|
+
getShadow: () => AMap.Icon | undefined | string;
|
|
56
|
+
setShape: (shape?: AMap.MarkerShape) => void;
|
|
57
|
+
getShape: () => AMap.MarkerShape | undefined;
|
|
58
|
+
show: () => void;
|
|
59
|
+
hide: () => void;
|
|
60
|
+
getMap: () => AMap.Map | null | undefined;
|
|
61
|
+
setExtData: (extData: any) => void;
|
|
62
|
+
getExtData: () => any;
|
|
63
|
+
setHeight: (height?: number | string) => void;
|
|
64
|
+
getHeight: () => number | string;
|
|
65
|
+
on: <C = AMap.Marker<any>>(eventName: string, handler: (this: C, event: any) => void, context?: C | undefined, once?: boolean, unshift?: boolean) => AMap.Marker<any>;
|
|
66
|
+
off: <C = AMap.Marker<any>>(eventName: string, handler: "mv" | ((this: C, event: any) => void), context?: C | undefined) => AMap.Marker<any>;
|
|
67
|
+
emit: (eventName: string, data?: any) => AMap.Marker<any>;
|
|
68
|
+
}[], AMap.Marker<any>[] | {
|
|
69
|
+
markOnAMAP: (obj?: {
|
|
70
|
+
name?: string | undefined;
|
|
71
|
+
position?: AMap.LocationValue | undefined;
|
|
72
|
+
} | undefined) => void;
|
|
73
|
+
getAnchor: () => AMap.Marker.Anchor | undefined;
|
|
74
|
+
setAnchor: (anchor?: AMap.Marker.Anchor) => void;
|
|
75
|
+
getOffset: () => AMap.Pixel;
|
|
76
|
+
setOffset: (offset: AMap.Pixel) => void;
|
|
77
|
+
setAnimation: (animate: AMap.AnimationName, prevent?: boolean) => void;
|
|
78
|
+
getAnimation: () => AMap.AnimationName;
|
|
79
|
+
setClickable: (cilckable: boolean) => void;
|
|
80
|
+
getClickable: () => boolean;
|
|
81
|
+
getPosition: () => AMap.LngLat | undefined;
|
|
82
|
+
setPosition: (position: AMap.LocationValue) => void;
|
|
83
|
+
setAngle: (angle: number) => void;
|
|
84
|
+
setLabel: (label?: AMap.Marker.Label) => void;
|
|
85
|
+
getLabel: () => AMap.Marker.Label | undefined;
|
|
86
|
+
getAngle: () => number;
|
|
87
|
+
setzIndex: (index: number) => void;
|
|
88
|
+
getzIndex: () => number;
|
|
89
|
+
setIcon: (content: string | AMap.Icon) => void;
|
|
90
|
+
getIcon: () => string | AMap.Icon | undefined;
|
|
91
|
+
setDraggable: (draggable: boolean) => void;
|
|
92
|
+
getDraggable: () => boolean;
|
|
93
|
+
setCursor: (cursor: string) => void;
|
|
94
|
+
setContent: (content: string | HTMLElement) => void;
|
|
95
|
+
getContent: () => string | HTMLElement;
|
|
96
|
+
moveAlong: (path: AMap.LngLat[], speed: number, timingFunction?: ((t: number) => number) | undefined, circleable?: boolean) => void;
|
|
97
|
+
moveTo: (lnglat: AMap.LocationValue, speed: number, timingFunction?: ((t: number) => number) | undefined) => void;
|
|
98
|
+
stopMove: () => void;
|
|
99
|
+
pauseMove: () => boolean;
|
|
100
|
+
resumeMove: () => boolean;
|
|
101
|
+
setMap: (map: null | AMap.Map) => void;
|
|
102
|
+
setTitle: (title: string) => void;
|
|
103
|
+
getTitle: () => string | undefined;
|
|
104
|
+
setTop: (isTop: boolean) => void;
|
|
105
|
+
getTop: () => boolean;
|
|
106
|
+
setShadow: (icon?: AMap.Icon | string) => void;
|
|
107
|
+
getShadow: () => AMap.Icon | undefined | string;
|
|
108
|
+
setShape: (shape?: AMap.MarkerShape) => void;
|
|
109
|
+
getShape: () => AMap.MarkerShape | undefined;
|
|
110
|
+
show: () => void;
|
|
111
|
+
hide: () => void;
|
|
112
|
+
getMap: () => AMap.Map | null | undefined;
|
|
113
|
+
setExtData: (extData: any) => void;
|
|
114
|
+
getExtData: () => any;
|
|
115
|
+
setHeight: (height?: number | string) => void;
|
|
116
|
+
getHeight: () => number | string;
|
|
117
|
+
on: <C = AMap.Marker<any>>(eventName: string, handler: (this: C, event: any) => void, context?: C | undefined, once?: boolean, unshift?: boolean) => AMap.Marker<any>;
|
|
118
|
+
off: <C = AMap.Marker<any>>(eventName: string, handler: "mv" | ((this: C, event: any) => void), context?: C | undefined) => AMap.Marker<any>;
|
|
119
|
+
emit: (eventName: string, data?: any) => AMap.Marker<any>;
|
|
120
|
+
}[]>;
|
|
121
|
+
circles: Ref<{
|
|
122
|
+
setCenter: (center: AMap.LocationValue, preventEvent?: boolean) => void;
|
|
123
|
+
getCenter: () => AMap.LngLat | undefined;
|
|
124
|
+
getBounds: () => AMap.Bounds | null;
|
|
125
|
+
setRadius: (radius: number, preventEvent?: boolean) => void;
|
|
126
|
+
getRadius: () => number;
|
|
127
|
+
setOptions: (options?: AMap.Circle.Options<any> | undefined) => void;
|
|
128
|
+
getOptions: () => Partial<AMap.Circle.GetOptionsResult<any>>;
|
|
129
|
+
contains: (point: AMap.LocationValue) => boolean;
|
|
130
|
+
getPath: (count?: number) => AMap.LngLat[];
|
|
131
|
+
getzIndex: () => number;
|
|
132
|
+
setzIndex: (zIndex: number) => void;
|
|
133
|
+
getVisible: () => boolean;
|
|
134
|
+
setDraggable: (draggable: boolean) => void;
|
|
135
|
+
show: () => void;
|
|
136
|
+
hide: () => void;
|
|
137
|
+
getMap: () => AMap.Map | null | undefined;
|
|
138
|
+
setMap: (map: AMap.Map | null) => void;
|
|
139
|
+
setExtData: (extData: any) => void;
|
|
140
|
+
getExtData: () => any;
|
|
141
|
+
setHeight: (height?: number | string) => void;
|
|
142
|
+
getHeight: () => number | string;
|
|
143
|
+
on: <C = AMap.Circle<any>>(eventName: string, handler: (this: C, event: any) => void, context?: C | undefined, once?: boolean, unshift?: boolean) => AMap.Circle<any>;
|
|
144
|
+
off: <C = AMap.Circle<any>>(eventName: string, handler: "mv" | ((this: C, event: any) => void), context?: C | undefined) => AMap.Circle<any>;
|
|
145
|
+
emit: (eventName: string, data?: any) => AMap.Circle<any>;
|
|
146
|
+
}[], AMap.Circle<any>[] | {
|
|
147
|
+
setCenter: (center: AMap.LocationValue, preventEvent?: boolean) => void;
|
|
148
|
+
getCenter: () => AMap.LngLat | undefined;
|
|
149
|
+
getBounds: () => AMap.Bounds | null;
|
|
150
|
+
setRadius: (radius: number, preventEvent?: boolean) => void;
|
|
151
|
+
getRadius: () => number;
|
|
152
|
+
setOptions: (options?: AMap.Circle.Options<any> | undefined) => void;
|
|
153
|
+
getOptions: () => Partial<AMap.Circle.GetOptionsResult<any>>;
|
|
154
|
+
contains: (point: AMap.LocationValue) => boolean;
|
|
155
|
+
getPath: (count?: number) => AMap.LngLat[];
|
|
156
|
+
getzIndex: () => number;
|
|
157
|
+
setzIndex: (zIndex: number) => void;
|
|
158
|
+
getVisible: () => boolean;
|
|
159
|
+
setDraggable: (draggable: boolean) => void;
|
|
160
|
+
show: () => void;
|
|
161
|
+
hide: () => void;
|
|
162
|
+
getMap: () => AMap.Map | null | undefined;
|
|
163
|
+
setMap: (map: AMap.Map | null) => void;
|
|
164
|
+
setExtData: (extData: any) => void;
|
|
165
|
+
getExtData: () => any;
|
|
166
|
+
setHeight: (height?: number | string) => void;
|
|
167
|
+
getHeight: () => number | string;
|
|
168
|
+
on: <C = AMap.Circle<any>>(eventName: string, handler: (this: C, event: any) => void, context?: C | undefined, once?: boolean, unshift?: boolean) => AMap.Circle<any>;
|
|
169
|
+
off: <C = AMap.Circle<any>>(eventName: string, handler: "mv" | ((this: C, event: any) => void), context?: C | undefined) => AMap.Circle<any>;
|
|
170
|
+
emit: (eventName: string, data?: any) => AMap.Circle<any>;
|
|
171
|
+
}[]>;
|
|
172
|
+
textLabels: Ref<{
|
|
173
|
+
markOnAMAP: (obj?: {
|
|
174
|
+
name?: string | undefined;
|
|
175
|
+
position?: AMap.LocationValue | undefined;
|
|
176
|
+
} | undefined) => void;
|
|
177
|
+
getAnchor: () => AMap.Marker.Anchor | undefined;
|
|
178
|
+
setAnchor: (anchor?: AMap.Marker.Anchor) => void;
|
|
179
|
+
getOffset: () => AMap.Pixel;
|
|
180
|
+
setOffset: (offset: AMap.Pixel) => void;
|
|
181
|
+
setAnimation: (animate: AMap.AnimationName, prevent?: boolean) => void;
|
|
182
|
+
getAnimation: () => AMap.AnimationName;
|
|
183
|
+
setClickable: (cilckable: boolean) => void;
|
|
184
|
+
getClickable: () => boolean;
|
|
185
|
+
getPosition: () => AMap.LngLat | undefined;
|
|
186
|
+
setPosition: (position: AMap.LocationValue) => void;
|
|
187
|
+
setAngle: (angle: number) => void;
|
|
188
|
+
setLabel: (label?: AMap.Marker.Label) => void;
|
|
189
|
+
getLabel: () => AMap.Marker.Label | undefined;
|
|
190
|
+
getAngle: () => number;
|
|
191
|
+
setzIndex: (index: number) => void;
|
|
192
|
+
getzIndex: () => number;
|
|
193
|
+
setIcon: (content: string | AMap.Icon) => void;
|
|
194
|
+
getIcon: () => string | AMap.Icon | undefined;
|
|
195
|
+
setDraggable: (draggable: boolean) => void;
|
|
196
|
+
getDraggable: () => boolean;
|
|
197
|
+
setCursor: (cursor: string) => void;
|
|
198
|
+
setContent: (content: string | HTMLElement) => void;
|
|
199
|
+
getContent: () => string | HTMLElement;
|
|
200
|
+
moveAlong: (path: AMap.LngLat[], speed: number, timingFunction?: ((t: number) => number) | undefined, circleable?: boolean) => void;
|
|
201
|
+
moveTo: (lnglat: AMap.LocationValue, speed: number, timingFunction?: ((t: number) => number) | undefined) => void;
|
|
202
|
+
stopMove: () => void;
|
|
203
|
+
pauseMove: () => boolean;
|
|
204
|
+
resumeMove: () => boolean;
|
|
205
|
+
setMap: (map: null | AMap.Map) => void;
|
|
206
|
+
setTitle: (title: string) => void;
|
|
207
|
+
getTitle: () => string | undefined;
|
|
208
|
+
setTop: (isTop: boolean) => void;
|
|
209
|
+
getTop: () => boolean;
|
|
210
|
+
setShadow: (icon?: AMap.Icon | string) => void;
|
|
211
|
+
getShadow: () => AMap.Icon | undefined | string;
|
|
212
|
+
setShape: (shape?: AMap.MarkerShape) => void;
|
|
213
|
+
getShape: () => AMap.MarkerShape | undefined;
|
|
214
|
+
show: () => void;
|
|
215
|
+
hide: () => void;
|
|
216
|
+
getMap: () => AMap.Map | null | undefined;
|
|
217
|
+
setExtData: (extData: any) => void;
|
|
218
|
+
getExtData: () => any;
|
|
219
|
+
setHeight: (height?: number | string) => void;
|
|
220
|
+
getHeight: () => number | string;
|
|
221
|
+
on: <C = AMap.Marker<any>>(eventName: string, handler: (this: C, event: any) => void, context?: C | undefined, once?: boolean, unshift?: boolean) => AMap.Marker<any>;
|
|
222
|
+
off: <C = AMap.Marker<any>>(eventName: string, handler: "mv" | ((this: C, event: any) => void), context?: C | undefined) => AMap.Marker<any>;
|
|
223
|
+
emit: (eventName: string, data?: any) => AMap.Marker<any>;
|
|
224
|
+
}[], AMap.Marker<any>[] | {
|
|
225
|
+
markOnAMAP: (obj?: {
|
|
226
|
+
name?: string | undefined;
|
|
227
|
+
position?: AMap.LocationValue | undefined;
|
|
228
|
+
} | undefined) => void;
|
|
229
|
+
getAnchor: () => AMap.Marker.Anchor | undefined;
|
|
230
|
+
setAnchor: (anchor?: AMap.Marker.Anchor) => void;
|
|
231
|
+
getOffset: () => AMap.Pixel;
|
|
232
|
+
setOffset: (offset: AMap.Pixel) => void;
|
|
233
|
+
setAnimation: (animate: AMap.AnimationName, prevent?: boolean) => void;
|
|
234
|
+
getAnimation: () => AMap.AnimationName;
|
|
235
|
+
setClickable: (cilckable: boolean) => void;
|
|
236
|
+
getClickable: () => boolean;
|
|
237
|
+
getPosition: () => AMap.LngLat | undefined;
|
|
238
|
+
setPosition: (position: AMap.LocationValue) => void;
|
|
239
|
+
setAngle: (angle: number) => void;
|
|
240
|
+
setLabel: (label?: AMap.Marker.Label) => void;
|
|
241
|
+
getLabel: () => AMap.Marker.Label | undefined;
|
|
242
|
+
getAngle: () => number;
|
|
243
|
+
setzIndex: (index: number) => void;
|
|
244
|
+
getzIndex: () => number;
|
|
245
|
+
setIcon: (content: string | AMap.Icon) => void;
|
|
246
|
+
getIcon: () => string | AMap.Icon | undefined;
|
|
247
|
+
setDraggable: (draggable: boolean) => void;
|
|
248
|
+
getDraggable: () => boolean;
|
|
249
|
+
setCursor: (cursor: string) => void;
|
|
250
|
+
setContent: (content: string | HTMLElement) => void;
|
|
251
|
+
getContent: () => string | HTMLElement;
|
|
252
|
+
moveAlong: (path: AMap.LngLat[], speed: number, timingFunction?: ((t: number) => number) | undefined, circleable?: boolean) => void;
|
|
253
|
+
moveTo: (lnglat: AMap.LocationValue, speed: number, timingFunction?: ((t: number) => number) | undefined) => void;
|
|
254
|
+
stopMove: () => void;
|
|
255
|
+
pauseMove: () => boolean;
|
|
256
|
+
resumeMove: () => boolean;
|
|
257
|
+
setMap: (map: null | AMap.Map) => void;
|
|
258
|
+
setTitle: (title: string) => void;
|
|
259
|
+
getTitle: () => string | undefined;
|
|
260
|
+
setTop: (isTop: boolean) => void;
|
|
261
|
+
getTop: () => boolean;
|
|
262
|
+
setShadow: (icon?: AMap.Icon | string) => void;
|
|
263
|
+
getShadow: () => AMap.Icon | undefined | string;
|
|
264
|
+
setShape: (shape?: AMap.MarkerShape) => void;
|
|
265
|
+
getShape: () => AMap.MarkerShape | undefined;
|
|
266
|
+
show: () => void;
|
|
267
|
+
hide: () => void;
|
|
268
|
+
getMap: () => AMap.Map | null | undefined;
|
|
269
|
+
setExtData: (extData: any) => void;
|
|
270
|
+
getExtData: () => any;
|
|
271
|
+
setHeight: (height?: number | string) => void;
|
|
272
|
+
getHeight: () => number | string;
|
|
273
|
+
on: <C = AMap.Marker<any>>(eventName: string, handler: (this: C, event: any) => void, context?: C | undefined, once?: boolean, unshift?: boolean) => AMap.Marker<any>;
|
|
274
|
+
off: <C = AMap.Marker<any>>(eventName: string, handler: "mv" | ((this: C, event: any) => void), context?: C | undefined) => AMap.Marker<any>;
|
|
275
|
+
emit: (eventName: string, data?: any) => AMap.Marker<any>;
|
|
276
|
+
}[]>;
|
|
277
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { LngLat } from '../types';
|
|
3
|
+
export interface UseAMapPolylineOptions {
|
|
4
|
+
getMap: () => AMap.Map | null;
|
|
5
|
+
lineArr: Ref<LngLat[][] | LngLat[]>;
|
|
6
|
+
mapLineArr: Ref<LngLat[][]>;
|
|
7
|
+
trackLineArr: Ref<LngLat[][]>;
|
|
8
|
+
highlightLineIndex: Ref<number>;
|
|
9
|
+
highlightStrokeColor: Ref<string>;
|
|
10
|
+
routeCompletedList: Ref<(boolean | number)[]>;
|
|
11
|
+
startPointIcon: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function useAMapPolyline(options: UseAMapPolylineOptions): {
|
|
14
|
+
drawPolyline: () => void;
|
|
15
|
+
clear: () => void;
|
|
16
|
+
};
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { LngLat } from '../types';
|
|
3
|
+
export interface UseAMapTrackOptions {
|
|
4
|
+
getMap: () => AMap.Map | null;
|
|
5
|
+
trackPoints: Ref<LngLat[]>;
|
|
6
|
+
}
|
|
7
|
+
export declare function useAMapTrack(options: UseAMapTrackOptions): {
|
|
8
|
+
drawTrackPoints: () => void;
|
|
9
|
+
clear: () => void;
|
|
10
|
+
trackMarkers: Ref<({
|
|
11
|
+
markOnAMAP: (obj?: {
|
|
12
|
+
name?: string | undefined;
|
|
13
|
+
position?: AMap.LocationValue | undefined;
|
|
14
|
+
} | undefined) => void;
|
|
15
|
+
getAnchor: () => AMap.Marker.Anchor | undefined;
|
|
16
|
+
setAnchor: (anchor?: AMap.Marker.Anchor) => void;
|
|
17
|
+
getOffset: () => AMap.Pixel;
|
|
18
|
+
setOffset: (offset: AMap.Pixel) => void;
|
|
19
|
+
setAnimation: (animate: AMap.AnimationName, prevent?: boolean) => void;
|
|
20
|
+
getAnimation: () => AMap.AnimationName;
|
|
21
|
+
setClickable: (cilckable: boolean) => void;
|
|
22
|
+
getClickable: () => boolean;
|
|
23
|
+
getPosition: () => AMap.LngLat | undefined;
|
|
24
|
+
setPosition: (position: AMap.LocationValue) => void;
|
|
25
|
+
setAngle: (angle: number) => void;
|
|
26
|
+
setLabel: (label?: AMap.Marker.Label) => void;
|
|
27
|
+
getLabel: () => AMap.Marker.Label | undefined;
|
|
28
|
+
getAngle: () => number;
|
|
29
|
+
setzIndex: (index: number) => void;
|
|
30
|
+
getzIndex: () => number;
|
|
31
|
+
setIcon: (content: string | AMap.Icon) => void;
|
|
32
|
+
getIcon: () => string | AMap.Icon | undefined;
|
|
33
|
+
setDraggable: (draggable: boolean) => void;
|
|
34
|
+
getDraggable: () => boolean;
|
|
35
|
+
setCursor: (cursor: string) => void;
|
|
36
|
+
setContent: (content: string | HTMLElement) => void;
|
|
37
|
+
getContent: () => string | HTMLElement;
|
|
38
|
+
moveAlong: (path: AMap.LngLat[], speed: number, timingFunction?: ((t: number) => number) | undefined, circleable?: boolean) => void;
|
|
39
|
+
moveTo: (lnglat: AMap.LocationValue, speed: number, timingFunction?: ((t: number) => number) | undefined) => void;
|
|
40
|
+
stopMove: () => void;
|
|
41
|
+
pauseMove: () => boolean;
|
|
42
|
+
resumeMove: () => boolean;
|
|
43
|
+
setMap: (map: null | AMap.Map) => void;
|
|
44
|
+
setTitle: (title: string) => void;
|
|
45
|
+
getTitle: () => string | undefined;
|
|
46
|
+
setTop: (isTop: boolean) => void;
|
|
47
|
+
getTop: () => boolean;
|
|
48
|
+
setShadow: (icon?: AMap.Icon | string) => void;
|
|
49
|
+
getShadow: () => AMap.Icon | undefined | string;
|
|
50
|
+
setShape: (shape?: AMap.MarkerShape) => void;
|
|
51
|
+
getShape: () => AMap.MarkerShape | undefined;
|
|
52
|
+
show: () => void;
|
|
53
|
+
hide: () => void;
|
|
54
|
+
getMap: () => AMap.Map | null | undefined;
|
|
55
|
+
setExtData: (extData: any) => void;
|
|
56
|
+
getExtData: () => any;
|
|
57
|
+
setHeight: (height?: number | string) => void;
|
|
58
|
+
getHeight: () => number | string;
|
|
59
|
+
on: <C = AMap.Marker<any>>(eventName: string, handler: (this: C, event: any) => void, context?: C | undefined, once?: boolean, unshift?: boolean) => AMap.Marker<any>;
|
|
60
|
+
off: <C = AMap.Marker<any>>(eventName: string, handler: "mv" | ((this: C, event: any) => void), context?: C | undefined) => AMap.Marker<any>;
|
|
61
|
+
emit: (eventName: string, data?: any) => AMap.Marker<any>;
|
|
62
|
+
} | {
|
|
63
|
+
setPath: (path: AMap.LocationValue[]) => void;
|
|
64
|
+
getPath: () => AMap.LngLat[];
|
|
65
|
+
getLength: () => number;
|
|
66
|
+
setOptions: (options: AMap.Polyline.Options<any>) => void;
|
|
67
|
+
getOptions: () => Partial<AMap.Polyline.GetOptionsResult<any>>;
|
|
68
|
+
getBounds: () => AMap.Bounds | null;
|
|
69
|
+
getzIndex: () => number;
|
|
70
|
+
setzIndex: (zIndex: number) => void;
|
|
71
|
+
getVisible: () => boolean;
|
|
72
|
+
setDraggable: (draggable: boolean) => void;
|
|
73
|
+
show: () => void;
|
|
74
|
+
hide: () => void;
|
|
75
|
+
getMap: () => AMap.Map | null | undefined;
|
|
76
|
+
setMap: (map: AMap.Map | null) => void;
|
|
77
|
+
setExtData: (extData: any) => void;
|
|
78
|
+
getExtData: () => any;
|
|
79
|
+
setHeight: (height?: number | string) => void;
|
|
80
|
+
getHeight: () => number | string;
|
|
81
|
+
on: <C = AMap.Polyline<any>>(eventName: string, handler: (this: C, event: any) => void, context?: C | undefined, once?: boolean, unshift?: boolean) => AMap.Polyline<any>;
|
|
82
|
+
off: <C = AMap.Polyline<any>>(eventName: string, handler: "mv" | ((this: C, event: any) => void), context?: C | undefined) => AMap.Polyline<any>;
|
|
83
|
+
emit: (eventName: string, data?: any) => AMap.Polyline<any>;
|
|
84
|
+
})[], (AMap.Polyline<any> | AMap.Marker<any>)[] | ({
|
|
85
|
+
markOnAMAP: (obj?: {
|
|
86
|
+
name?: string | undefined;
|
|
87
|
+
position?: AMap.LocationValue | undefined;
|
|
88
|
+
} | undefined) => void;
|
|
89
|
+
getAnchor: () => AMap.Marker.Anchor | undefined;
|
|
90
|
+
setAnchor: (anchor?: AMap.Marker.Anchor) => void;
|
|
91
|
+
getOffset: () => AMap.Pixel;
|
|
92
|
+
setOffset: (offset: AMap.Pixel) => void;
|
|
93
|
+
setAnimation: (animate: AMap.AnimationName, prevent?: boolean) => void;
|
|
94
|
+
getAnimation: () => AMap.AnimationName;
|
|
95
|
+
setClickable: (cilckable: boolean) => void;
|
|
96
|
+
getClickable: () => boolean;
|
|
97
|
+
getPosition: () => AMap.LngLat | undefined;
|
|
98
|
+
setPosition: (position: AMap.LocationValue) => void;
|
|
99
|
+
setAngle: (angle: number) => void;
|
|
100
|
+
setLabel: (label?: AMap.Marker.Label) => void;
|
|
101
|
+
getLabel: () => AMap.Marker.Label | undefined;
|
|
102
|
+
getAngle: () => number;
|
|
103
|
+
setzIndex: (index: number) => void;
|
|
104
|
+
getzIndex: () => number;
|
|
105
|
+
setIcon: (content: string | AMap.Icon) => void;
|
|
106
|
+
getIcon: () => string | AMap.Icon | undefined;
|
|
107
|
+
setDraggable: (draggable: boolean) => void;
|
|
108
|
+
getDraggable: () => boolean;
|
|
109
|
+
setCursor: (cursor: string) => void;
|
|
110
|
+
setContent: (content: string | HTMLElement) => void;
|
|
111
|
+
getContent: () => string | HTMLElement;
|
|
112
|
+
moveAlong: (path: AMap.LngLat[], speed: number, timingFunction?: ((t: number) => number) | undefined, circleable?: boolean) => void;
|
|
113
|
+
moveTo: (lnglat: AMap.LocationValue, speed: number, timingFunction?: ((t: number) => number) | undefined) => void;
|
|
114
|
+
stopMove: () => void;
|
|
115
|
+
pauseMove: () => boolean;
|
|
116
|
+
resumeMove: () => boolean;
|
|
117
|
+
setMap: (map: null | AMap.Map) => void;
|
|
118
|
+
setTitle: (title: string) => void;
|
|
119
|
+
getTitle: () => string | undefined;
|
|
120
|
+
setTop: (isTop: boolean) => void;
|
|
121
|
+
getTop: () => boolean;
|
|
122
|
+
setShadow: (icon?: AMap.Icon | string) => void;
|
|
123
|
+
getShadow: () => AMap.Icon | undefined | string;
|
|
124
|
+
setShape: (shape?: AMap.MarkerShape) => void;
|
|
125
|
+
getShape: () => AMap.MarkerShape | undefined;
|
|
126
|
+
show: () => void;
|
|
127
|
+
hide: () => void;
|
|
128
|
+
getMap: () => AMap.Map | null | undefined;
|
|
129
|
+
setExtData: (extData: any) => void;
|
|
130
|
+
getExtData: () => any;
|
|
131
|
+
setHeight: (height?: number | string) => void;
|
|
132
|
+
getHeight: () => number | string;
|
|
133
|
+
on: <C = AMap.Marker<any>>(eventName: string, handler: (this: C, event: any) => void, context?: C | undefined, once?: boolean, unshift?: boolean) => AMap.Marker<any>;
|
|
134
|
+
off: <C = AMap.Marker<any>>(eventName: string, handler: "mv" | ((this: C, event: any) => void), context?: C | undefined) => AMap.Marker<any>;
|
|
135
|
+
emit: (eventName: string, data?: any) => AMap.Marker<any>;
|
|
136
|
+
} | {
|
|
137
|
+
setPath: (path: AMap.LocationValue[]) => void;
|
|
138
|
+
getPath: () => AMap.LngLat[];
|
|
139
|
+
getLength: () => number;
|
|
140
|
+
setOptions: (options: AMap.Polyline.Options<any>) => void;
|
|
141
|
+
getOptions: () => Partial<AMap.Polyline.GetOptionsResult<any>>;
|
|
142
|
+
getBounds: () => AMap.Bounds | null;
|
|
143
|
+
getzIndex: () => number;
|
|
144
|
+
setzIndex: (zIndex: number) => void;
|
|
145
|
+
getVisible: () => boolean;
|
|
146
|
+
setDraggable: (draggable: boolean) => void;
|
|
147
|
+
show: () => void;
|
|
148
|
+
hide: () => void;
|
|
149
|
+
getMap: () => AMap.Map | null | undefined;
|
|
150
|
+
setMap: (map: AMap.Map | null) => void;
|
|
151
|
+
setExtData: (extData: any) => void;
|
|
152
|
+
getExtData: () => any;
|
|
153
|
+
setHeight: (height?: number | string) => void;
|
|
154
|
+
getHeight: () => number | string;
|
|
155
|
+
on: <C = AMap.Polyline<any>>(eventName: string, handler: (this: C, event: any) => void, context?: C | undefined, once?: boolean, unshift?: boolean) => AMap.Polyline<any>;
|
|
156
|
+
off: <C = AMap.Polyline<any>>(eventName: string, handler: "mv" | ((this: C, event: any) => void), context?: C | undefined) => AMap.Polyline<any>;
|
|
157
|
+
emit: (eventName: string, data?: any) => AMap.Polyline<any>;
|
|
158
|
+
})[]>;
|
|
159
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AMapComponent 常量:颜色、zIndex、默认值等
|
|
3
|
+
*/
|
|
4
|
+
/** 默认中心点 [lng, lat] */
|
|
5
|
+
export declare const DEFAULT_CENTER: [number, number];
|
|
6
|
+
/** 航线颜色 */
|
|
7
|
+
export declare const ROUTE_COLOR: {
|
|
8
|
+
readonly completed: "#00B42A";
|
|
9
|
+
readonly notCollected: "#E6A23C";
|
|
10
|
+
readonly defaultHighlight: "#165dff";
|
|
11
|
+
readonly single: "#00B42A";
|
|
12
|
+
};
|
|
13
|
+
/** 航迹线颜色 */
|
|
14
|
+
export declare const TRACK_STROKE_COLOR = "#FF8C00";
|
|
15
|
+
/** zIndex 层级 */
|
|
16
|
+
export declare const Z_INDEX: {
|
|
17
|
+
readonly polyline: 40;
|
|
18
|
+
readonly polylineHighlight: 45;
|
|
19
|
+
readonly polylineBorder: 44;
|
|
20
|
+
readonly track: 50;
|
|
21
|
+
readonly startMarker: 60;
|
|
22
|
+
readonly pointLabel: 10;
|
|
23
|
+
};
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { PropType, DefineComponent, ExtractPropTypes, Ref, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
import { LngLat, MapType, ViewMode, PointType, MapPointItem } from './types';
|
|
3
|
+
declare const _default: DefineComponent<ExtractPropTypes<{
|
|
4
|
+
lineArr: {
|
|
5
|
+
type: PropType<LngLat[][] | LngLat[]>;
|
|
6
|
+
default: () => never[];
|
|
7
|
+
};
|
|
8
|
+
points: {
|
|
9
|
+
type: PropType<MapPointItem[]>;
|
|
10
|
+
default: () => never[];
|
|
11
|
+
};
|
|
12
|
+
pointType: {
|
|
13
|
+
type: PropType<PointType>;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
label: {
|
|
17
|
+
type: PropType<string[]>;
|
|
18
|
+
default: () => never[];
|
|
19
|
+
};
|
|
20
|
+
center: {
|
|
21
|
+
type: PropType<LngLat>;
|
|
22
|
+
default: () => [number, number];
|
|
23
|
+
};
|
|
24
|
+
zoom: {
|
|
25
|
+
type: NumberConstructor;
|
|
26
|
+
default: number;
|
|
27
|
+
};
|
|
28
|
+
circleRadius: {
|
|
29
|
+
type: NumberConstructor;
|
|
30
|
+
default: number;
|
|
31
|
+
};
|
|
32
|
+
trackPoints: {
|
|
33
|
+
type: PropType<LngLat[]>;
|
|
34
|
+
default: () => never[];
|
|
35
|
+
};
|
|
36
|
+
mapType: {
|
|
37
|
+
type: PropType<MapType>;
|
|
38
|
+
default: string;
|
|
39
|
+
validator: (v: string) => boolean;
|
|
40
|
+
};
|
|
41
|
+
highlightLineIndex: {
|
|
42
|
+
type: NumberConstructor;
|
|
43
|
+
default: number;
|
|
44
|
+
};
|
|
45
|
+
highlightStrokeColor: {
|
|
46
|
+
type: StringConstructor;
|
|
47
|
+
default: string;
|
|
48
|
+
};
|
|
49
|
+
mapLineArr: {
|
|
50
|
+
type: PropType<LngLat[][]>;
|
|
51
|
+
default: () => never[];
|
|
52
|
+
};
|
|
53
|
+
trackLineArr: {
|
|
54
|
+
type: PropType<LngLat[][]>;
|
|
55
|
+
default: () => never[];
|
|
56
|
+
};
|
|
57
|
+
routeCompletedList: {
|
|
58
|
+
type: PropType<(boolean | number)[]>;
|
|
59
|
+
default: () => never[];
|
|
60
|
+
};
|
|
61
|
+
viewMode: {
|
|
62
|
+
type: PropType<ViewMode>;
|
|
63
|
+
default: string;
|
|
64
|
+
validator: (v: string) => boolean;
|
|
65
|
+
};
|
|
66
|
+
isDark: {
|
|
67
|
+
type: BooleanConstructor;
|
|
68
|
+
default: boolean;
|
|
69
|
+
};
|
|
70
|
+
pointIcon: {
|
|
71
|
+
type: StringConstructor;
|
|
72
|
+
default: string;
|
|
73
|
+
};
|
|
74
|
+
containerStyle: {
|
|
75
|
+
type: PropType<Record<string, string | number>>;
|
|
76
|
+
default: () => {};
|
|
77
|
+
};
|
|
78
|
+
}>, {
|
|
79
|
+
mapContainer: Ref<HTMLElement | null, HTMLElement | null>;
|
|
80
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
81
|
+
lineArr: {
|
|
82
|
+
type: PropType<LngLat[][] | LngLat[]>;
|
|
83
|
+
default: () => never[];
|
|
84
|
+
};
|
|
85
|
+
points: {
|
|
86
|
+
type: PropType<MapPointItem[]>;
|
|
87
|
+
default: () => never[];
|
|
88
|
+
};
|
|
89
|
+
pointType: {
|
|
90
|
+
type: PropType<PointType>;
|
|
91
|
+
default: string;
|
|
92
|
+
};
|
|
93
|
+
label: {
|
|
94
|
+
type: PropType<string[]>;
|
|
95
|
+
default: () => never[];
|
|
96
|
+
};
|
|
97
|
+
center: {
|
|
98
|
+
type: PropType<LngLat>;
|
|
99
|
+
default: () => [number, number];
|
|
100
|
+
};
|
|
101
|
+
zoom: {
|
|
102
|
+
type: NumberConstructor;
|
|
103
|
+
default: number;
|
|
104
|
+
};
|
|
105
|
+
circleRadius: {
|
|
106
|
+
type: NumberConstructor;
|
|
107
|
+
default: number;
|
|
108
|
+
};
|
|
109
|
+
trackPoints: {
|
|
110
|
+
type: PropType<LngLat[]>;
|
|
111
|
+
default: () => never[];
|
|
112
|
+
};
|
|
113
|
+
mapType: {
|
|
114
|
+
type: PropType<MapType>;
|
|
115
|
+
default: string;
|
|
116
|
+
validator: (v: string) => boolean;
|
|
117
|
+
};
|
|
118
|
+
highlightLineIndex: {
|
|
119
|
+
type: NumberConstructor;
|
|
120
|
+
default: number;
|
|
121
|
+
};
|
|
122
|
+
highlightStrokeColor: {
|
|
123
|
+
type: StringConstructor;
|
|
124
|
+
default: string;
|
|
125
|
+
};
|
|
126
|
+
mapLineArr: {
|
|
127
|
+
type: PropType<LngLat[][]>;
|
|
128
|
+
default: () => never[];
|
|
129
|
+
};
|
|
130
|
+
trackLineArr: {
|
|
131
|
+
type: PropType<LngLat[][]>;
|
|
132
|
+
default: () => never[];
|
|
133
|
+
};
|
|
134
|
+
routeCompletedList: {
|
|
135
|
+
type: PropType<(boolean | number)[]>;
|
|
136
|
+
default: () => never[];
|
|
137
|
+
};
|
|
138
|
+
viewMode: {
|
|
139
|
+
type: PropType<ViewMode>;
|
|
140
|
+
default: string;
|
|
141
|
+
validator: (v: string) => boolean;
|
|
142
|
+
};
|
|
143
|
+
isDark: {
|
|
144
|
+
type: BooleanConstructor;
|
|
145
|
+
default: boolean;
|
|
146
|
+
};
|
|
147
|
+
pointIcon: {
|
|
148
|
+
type: StringConstructor;
|
|
149
|
+
default: string;
|
|
150
|
+
};
|
|
151
|
+
containerStyle: {
|
|
152
|
+
type: PropType<Record<string, string | number>>;
|
|
153
|
+
default: () => {};
|
|
154
|
+
};
|
|
155
|
+
}>> & Readonly<{}>, {
|
|
156
|
+
label: string[];
|
|
157
|
+
center: LngLat;
|
|
158
|
+
zoom: number;
|
|
159
|
+
viewMode: ViewMode;
|
|
160
|
+
mapType: MapType;
|
|
161
|
+
isDark: boolean;
|
|
162
|
+
lineArr: LngLat[] | LngLat[][];
|
|
163
|
+
mapLineArr: LngLat[][];
|
|
164
|
+
trackLineArr: LngLat[][];
|
|
165
|
+
highlightLineIndex: number;
|
|
166
|
+
highlightStrokeColor: string;
|
|
167
|
+
routeCompletedList: (number | boolean)[];
|
|
168
|
+
points: MapPointItem[];
|
|
169
|
+
pointType: PointType;
|
|
170
|
+
circleRadius: number;
|
|
171
|
+
pointIcon: string;
|
|
172
|
+
trackPoints: LngLat[];
|
|
173
|
+
containerStyle: Record<string, string | number>;
|
|
174
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
175
|
+
export default _default;
|