feat: expand vehicle data platform capabilities
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
import { getAMapConfig, isAMapConfigured } from '../config/appConfig';
|
||||
|
||||
export type AMapPlugin = 'AMap.Scale' | 'AMap.Geocoder' | 'AMap.ToolBar';
|
||||
export type AMapPlugin = 'AMap.Scale' | 'AMap.Geocoder' | 'AMap.ToolBar' | 'AMap.MouseTool';
|
||||
|
||||
export type AMapLngLat = {
|
||||
getLng: () => number;
|
||||
getLat: () => number;
|
||||
};
|
||||
|
||||
export type AMapMap = {
|
||||
add: (overlay: AMapOverlay | AMapOverlay[]) => void;
|
||||
@@ -28,6 +33,18 @@ export type AMapOverlay = {
|
||||
setPath?: (path: [number, number][]) => void;
|
||||
};
|
||||
|
||||
export type AMapCircleOverlay = AMapOverlay & {
|
||||
getCenter: () => AMapLngLat;
|
||||
getRadius: () => number;
|
||||
};
|
||||
|
||||
export type AMapMouseTool = {
|
||||
circle: (options?: Record<string, unknown>) => void;
|
||||
close: (clear?: boolean) => void;
|
||||
on: (eventName: 'draw', handler: (event: { obj?: AMapCircleOverlay }) => void) => void;
|
||||
off?: (eventName: 'draw', handler: (event: { obj?: AMapCircleOverlay }) => void) => void;
|
||||
};
|
||||
|
||||
export type AMapMassMarks = {
|
||||
setMap: (map: AMapMap | null) => void;
|
||||
setData: (data: AMapMassPoint[]) => void;
|
||||
@@ -107,6 +124,8 @@ export type AMapLike = {
|
||||
Map: new (container: HTMLDivElement, options: Record<string, unknown>) => AMapMap;
|
||||
Marker: new (options: Record<string, unknown>) => AMapOverlay;
|
||||
Polyline: new (options: Record<string, unknown>) => AMapOverlay;
|
||||
Circle?: new (options: Record<string, unknown>) => AMapCircleOverlay;
|
||||
MouseTool?: new (map: AMapMap) => AMapMouseTool;
|
||||
Scale: new () => unknown;
|
||||
ToolBar?: new (options?: Record<string, unknown>) => unknown;
|
||||
Size: new (width: number, height: number) => unknown;
|
||||
|
||||
Reference in New Issue
Block a user