@aibee/crc-bmap 0.14.20 → 0.14.22
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/lib/index.cjs +19 -19
- package/lib/index.esm.min.js +20 -20
- package/lib/meta.json +254 -34
- package/lib/src/elements/base-svg.d.ts +1 -1
- package/lib/src/elements/svg-line.d.ts +1 -0
- package/lib/src/elements/svg-polygon.d.ts +1 -0
- package/lib/src/factory/unique-key.d.ts +1 -0
- package/lib/src/plugins/car-inertial-position/car-inertial-position.d.ts +1 -0
- package/lib/src/plugins/graphic-draw/graphic-draw.d.ts +71 -0
- package/lib/src/plugins/graphic-draw/index.d.ts +4 -0
- package/lib/src/plugins/graphic-draw/svg-drawer.d.ts +38 -0
- package/lib/src/plugins/graphic-draw/transform-box.d.ts +77 -0
- package/lib/src/plugins/graphic-draw/types.d.ts +44 -0
- package/lib/src/plugins/index.d.ts +1 -0
- package/lib/src/plugins/nav-path/nav-path.d.ts +1 -0
- package/lib/src/plugins/recommend-parking-space/recommand-parking-space.d.ts +5 -2
- package/lib/src/plugins/recommend-parking-space/recommend-core.d.ts +30 -0
- package/lib/src/plugins/recommend-parking-space/recommend.worker.d.ts +1 -5
- package/lib/src/utils/road2.d.ts +1 -0
- package/lib/worker/{path.worker-W3VDPRQY.js → path.worker-2A5W4SXQ.js} +1 -1
- package/lib/worker/{recommend.worker-DNMNFDYX.js → recommend.worker-5LGR2EOJ.js} +176 -176
- package/package.json +1 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Context } from "../../context/context";
|
|
2
|
+
import { BaseSvg } from "../../elements/base-svg";
|
|
3
|
+
import { ScreenPoint } from "./types";
|
|
4
|
+
export interface SvgDrawerOptions {
|
|
5
|
+
strokeColor: string;
|
|
6
|
+
strokeOpacity: number;
|
|
7
|
+
fillColor: string;
|
|
8
|
+
fillOpacity: number;
|
|
9
|
+
pointColor: string;
|
|
10
|
+
pointRadius: number;
|
|
11
|
+
}
|
|
12
|
+
export declare class SvgDrawer extends BaseSvg {
|
|
13
|
+
previewElement: SVGElement | null;
|
|
14
|
+
previewFillElement: SVGElement | null;
|
|
15
|
+
controlPoints: SVGElement[];
|
|
16
|
+
lines: SVGElement[];
|
|
17
|
+
lastLine: SVGElement | null;
|
|
18
|
+
points: ScreenPoint[];
|
|
19
|
+
private polygonFillElement;
|
|
20
|
+
private currentMousePoint;
|
|
21
|
+
private options;
|
|
22
|
+
private adsorbRadius;
|
|
23
|
+
constructor(context: Context, options: SvgDrawerOptions & {
|
|
24
|
+
adsorbRadius?: number;
|
|
25
|
+
});
|
|
26
|
+
updateRectPreview(start: ScreenPoint, end: ScreenPoint, showFill?: boolean): void;
|
|
27
|
+
private updateRectPreviewFill;
|
|
28
|
+
updateCirclePreview(center: ScreenPoint, radius: number): void;
|
|
29
|
+
updateCirclePreviewFill(center: ScreenPoint, radius: number): void;
|
|
30
|
+
addPolygonPoint(point: ScreenPoint): void;
|
|
31
|
+
updatePolygonPreview(mousePoint: ScreenPoint): void;
|
|
32
|
+
checkAdsorb(mousePoint: ScreenPoint): boolean;
|
|
33
|
+
private updatePolygonFill;
|
|
34
|
+
clear(): void;
|
|
35
|
+
getLastPoint(): ScreenPoint | undefined;
|
|
36
|
+
getFirstPoint(): ScreenPoint | undefined;
|
|
37
|
+
dispose(): void;
|
|
38
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Context } from "../../context/context";
|
|
2
|
+
import { BaseSvg } from "../../elements/base-svg";
|
|
3
|
+
import { Box3 } from "three";
|
|
4
|
+
import { Graphic } from "../../elements/graphic";
|
|
5
|
+
export type TransformAction = 'move' | 'scale-left' | 'scale-right' | 'scale-top' | 'scale-bottom' | 'scale-left-top' | 'scale-right-top' | 'scale-left-bottom' | 'scale-right-bottom' | 'rotate';
|
|
6
|
+
export interface TransformBoxEventMap {
|
|
7
|
+
'transform-start': {
|
|
8
|
+
action: TransformAction;
|
|
9
|
+
point: {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
'transform': {
|
|
15
|
+
action: TransformAction;
|
|
16
|
+
delta: {
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
};
|
|
20
|
+
currentPoint: {
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
'transform-end': {
|
|
26
|
+
action: TransformAction;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export interface BoundingBoxInfo {
|
|
30
|
+
min: {
|
|
31
|
+
x: number;
|
|
32
|
+
y: number;
|
|
33
|
+
};
|
|
34
|
+
max: {
|
|
35
|
+
x: number;
|
|
36
|
+
y: number;
|
|
37
|
+
};
|
|
38
|
+
width: number;
|
|
39
|
+
height: number;
|
|
40
|
+
centerX: number;
|
|
41
|
+
centerY: number;
|
|
42
|
+
}
|
|
43
|
+
export declare class TransformBox extends BaseSvg<TransformBoxEventMap> {
|
|
44
|
+
scalePoints: SVGElement[];
|
|
45
|
+
rotateHandle: SVGElement;
|
|
46
|
+
moveArea: SVGElement;
|
|
47
|
+
outline: SVGElement;
|
|
48
|
+
outlineLines: SVGElement[];
|
|
49
|
+
isTransforming: boolean;
|
|
50
|
+
private selectedGraphic;
|
|
51
|
+
private currentAction;
|
|
52
|
+
private startPoint;
|
|
53
|
+
private boundingBox;
|
|
54
|
+
private readonly SCALE_POINT_SIZE;
|
|
55
|
+
private readonly ROTATE_HANDLE_RADIUS;
|
|
56
|
+
private readonly ROTATE_HANDLE_OFFSET;
|
|
57
|
+
private readonly STROKE_COLOR;
|
|
58
|
+
private readonly FILL_COLOR;
|
|
59
|
+
constructor(context: Context);
|
|
60
|
+
private initElements;
|
|
61
|
+
private getCursorForPoint;
|
|
62
|
+
private registryEvent;
|
|
63
|
+
private unRegistryEvent;
|
|
64
|
+
private onUpdate;
|
|
65
|
+
getBoundingBoxInfo(): BoundingBoxInfo | null;
|
|
66
|
+
show(graphic: Graphic): void;
|
|
67
|
+
hide(): void;
|
|
68
|
+
updatePosition(): void;
|
|
69
|
+
private clearControlPoints;
|
|
70
|
+
getBoundingBox(): Box3 | null;
|
|
71
|
+
private getActionFromTarget;
|
|
72
|
+
private getContainerPoint;
|
|
73
|
+
private onPointerDown;
|
|
74
|
+
private onPointerMove;
|
|
75
|
+
private onPointerUp;
|
|
76
|
+
dispose(): void;
|
|
77
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export interface ScreenPoint {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
}
|
|
5
|
+
export interface GraphicDrawOptions {
|
|
6
|
+
strokeColor: string;
|
|
7
|
+
strokeOpacity: number;
|
|
8
|
+
strokeWidth: number;
|
|
9
|
+
fillColor: string;
|
|
10
|
+
fillOpacity: number;
|
|
11
|
+
pointColor: string;
|
|
12
|
+
pointOpacity: number;
|
|
13
|
+
pointRadius: number;
|
|
14
|
+
height: number;
|
|
15
|
+
circleSegments: number;
|
|
16
|
+
adsorbRadius: number;
|
|
17
|
+
autoSelect: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare const defaultGraphicDrawOptions: GraphicDrawOptions;
|
|
20
|
+
export type DrawingState = 'idle' | 'polygon' | 'rect' | 'circle';
|
|
21
|
+
export interface GraphicDrawEventMap {
|
|
22
|
+
'finish': {
|
|
23
|
+
graphic: import("../../elements/graphic").Graphic;
|
|
24
|
+
drawType: 'polygon' | 'rect' | 'circle';
|
|
25
|
+
};
|
|
26
|
+
'cancel': {};
|
|
27
|
+
'start': {
|
|
28
|
+
drawType: 'polygon' | 'rect' | 'circle';
|
|
29
|
+
};
|
|
30
|
+
'select': {
|
|
31
|
+
graphic: import("../../elements/graphic").Graphic;
|
|
32
|
+
};
|
|
33
|
+
'deselect': {
|
|
34
|
+
graphic: import("../../elements/graphic").Graphic | null;
|
|
35
|
+
};
|
|
36
|
+
'graphic-click': {
|
|
37
|
+
graphic: import("../../elements/graphic").Graphic | null;
|
|
38
|
+
};
|
|
39
|
+
'change': {
|
|
40
|
+
action: 'add' | 'update' | 'remove' | 'move' | 'rotate' | 'resize';
|
|
41
|
+
graphic?: import("../../elements/graphic").Graphic;
|
|
42
|
+
id?: string;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { type CarLotStatus } from './recommend.worker';
|
|
2
2
|
import { End2, Facility, RoadData2, Start2 } from '../../utils';
|
|
3
3
|
import { ParkingType } from '../../types';
|
|
4
|
+
import { RecommendCore } from './recommend-core';
|
|
4
5
|
interface RecommendParkingSpaceOptions {
|
|
5
6
|
placeId: string | number;
|
|
6
7
|
catLotStatusApi: string;
|
|
8
|
+
useWorker: boolean;
|
|
7
9
|
filterCarLotStatus?: (carLotStatus: CarLotStatus[]) => CarLotStatus[];
|
|
8
10
|
}
|
|
9
11
|
export declare class RecommendParkingSpace {
|
|
10
|
-
worker: Worker;
|
|
12
|
+
worker: Worker | null;
|
|
13
|
+
recommendCore: RecommendCore | null;
|
|
11
14
|
options: RecommendParkingSpaceOptions;
|
|
12
15
|
constructor(options?: Partial<RecommendParkingSpaceOptions>);
|
|
13
|
-
setRoadData(roadData: RoadData2, facilities: Facility[]): Promise<any>;
|
|
16
|
+
setRoadData(roadData: RoadData2[], facilities: Facility[]): Promise<any>;
|
|
14
17
|
recommend(data: {
|
|
15
18
|
start: Start2;
|
|
16
19
|
end?: End2;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ParkingType } from "../../types";
|
|
2
|
+
import { Facility, RoadNetwork2, End2, Start2, RoadData2 } from "../../utils/road2";
|
|
3
|
+
export type CarLotStatus = {
|
|
4
|
+
floor: string;
|
|
5
|
+
lot_id: string;
|
|
6
|
+
status: number;
|
|
7
|
+
};
|
|
8
|
+
export interface RecommendParkingSpaceDest {
|
|
9
|
+
floor: string;
|
|
10
|
+
spaceNo: string;
|
|
11
|
+
distance: number;
|
|
12
|
+
}
|
|
13
|
+
export declare class RecommendCore {
|
|
14
|
+
private roadNetwork;
|
|
15
|
+
private roadReadyResolve;
|
|
16
|
+
private roadReadyPromise;
|
|
17
|
+
constructor();
|
|
18
|
+
setRoadData(roadData: RoadData2[], facilities: Facility[]): void;
|
|
19
|
+
setRoadNetwork(roadNetwork: RoadNetwork2): void;
|
|
20
|
+
recommend(start: Start2, carLotStatus: CarLotStatus[], end?: End2, travelDirection?: number, parkingType?: ParkingType): Promise<RecommendParkingSpaceDest | null>;
|
|
21
|
+
dispose(): void;
|
|
22
|
+
private getFloorCarByDistance;
|
|
23
|
+
private recommendByStart;
|
|
24
|
+
private recommendByStartNearFloor;
|
|
25
|
+
private recommendByEnd;
|
|
26
|
+
private recommendFloorCarByEndDistance;
|
|
27
|
+
private recommendByStartNearFloorAndEnd;
|
|
28
|
+
private transformStart;
|
|
29
|
+
private transformEnd;
|
|
30
|
+
}
|