model-action 1.0.2 → 1.0.4
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/index.d.ts +67 -4
- package/dist/index.js +4 -12
- package/dist/modules/Action.d.ts +1 -1
- package/dist/modules/Action.js +1 -6
- package/dist/modules/Poi.d.ts +17 -2
- package/dist/modules/Poi.js +60 -9
- package/dist/modules/Track.d.ts +3 -7
- package/dist/modules/Track.js +6 -15
- package/dist/modules/VideoFusion.d.ts +5 -14
- package/dist/modules/VideoFusion.js +7 -21
- package/package.json +18 -17
- package/src/modules/Action.ts +1 -1
- package/src/modules/Poi.ts +64 -3
- package/src/modules/Track.ts +7 -11
- package/src/modules/VideoFusion.ts +10 -19
- package/dist/index.js.map +0 -1
- package/dist/modules/Action.js.map +0 -1
- package/dist/modules/Poi.js.map +0 -1
- package/dist/modules/Track.js.map +0 -1
- package/dist/modules/VideoFusion.js.map +0 -1
package/dist/index.d.ts
CHANGED
@@ -1,4 +1,67 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
type RequiredSome<T, K extends keyof T> = Required<Pick<T, K>> & Omit<T, K>;
|
2
|
+
|
3
|
+
interface SendParam {
|
4
|
+
cmd: string,
|
5
|
+
action: string,
|
6
|
+
}
|
7
|
+
|
8
|
+
interface IdItem {
|
9
|
+
id: string;
|
10
|
+
}
|
11
|
+
|
12
|
+
type IdList = IdItem[];
|
13
|
+
|
14
|
+
|
15
|
+
type PathList = Array<{
|
16
|
+
location: string
|
17
|
+
}>
|
18
|
+
|
19
|
+
|
20
|
+
type PoiAction = 'show' | 'hide' | 'add' | 'delete' | 'update' | 'getInfo'
|
21
|
+
type LocationItem = `X=${number},Y=${number},Z=${number}`
|
22
|
+
type PoiType = {
|
23
|
+
action: PoiAction, //方法
|
24
|
+
id?: string, //POI点UE中的ID
|
25
|
+
type?: string, //POI类型
|
26
|
+
typeChild?: string, //POI子类型
|
27
|
+
text?: string, //POI标题
|
28
|
+
location?: LocationItem, //POI在场景中的坐标格式
|
29
|
+
place?: string, //POI所在位置
|
30
|
+
description?: string, //POI描述
|
31
|
+
linkId?: string, //POI关联设备ID
|
32
|
+
floorNum?: string, //总楼层
|
33
|
+
lowestFloor?: string //最低楼层
|
34
|
+
} & SendParam
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
type LocationList = Array<{
|
39
|
+
location: LocationItem
|
40
|
+
}>
|
41
|
+
type TrackAction = 'getRoadNet' | 'remove' | 'add'
|
42
|
+
type TrackType = {
|
43
|
+
action: TrackAction,
|
44
|
+
pathId?: string, //自定义轨迹ID
|
45
|
+
rnId?: string, //路网ID
|
46
|
+
roadNet?: string, //路网信息
|
47
|
+
type?: string,
|
48
|
+
data?: LocationList | IdList
|
49
|
+
} & SendParam
|
50
|
+
|
51
|
+
|
52
|
+
type VideoFusionAction = 'init' | 'flyTo' | 'start' | 'stop' | 'pause' | 'resume' | 'refresh'
|
53
|
+
type VideoFusionType = {
|
54
|
+
action: VideoFusionAction,
|
55
|
+
token?: string,
|
56
|
+
ip?: string,
|
57
|
+
port?: string,
|
58
|
+
isHttps?: boolean,
|
59
|
+
id?: string,
|
60
|
+
fov?: number, //视场角
|
61
|
+
backPlay?:boolean,
|
62
|
+
ids?: IdList,
|
63
|
+
isLocation?: boolean, //是否定位到第一个点,true=定位到第一个,false=不定位
|
64
|
+
videoType?: 'Video' | 'Record', //Video:实时流,Record:录像,默认实时流 Video
|
65
|
+
recordType?: 'Cloud' | 'Device',// Cloud:中心录像,Device:设备录像,默认中心录像 Cloud,videoType为 Record 时有效
|
66
|
+
|
67
|
+
} & SendParam
|
package/dist/index.js
CHANGED
@@ -1,12 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
Object.defineProperty(exports, "Action", { enumerable: true, get: function () { return Action_1.Action; } });
|
6
|
-
var VideoFusion_1 = require("./modules/VideoFusion");
|
7
|
-
Object.defineProperty(exports, "VideoFusionAction", { enumerable: true, get: function () { return VideoFusion_1.VideoFusionAction; } });
|
8
|
-
var Poi_1 = require("./modules/Poi");
|
9
|
-
Object.defineProperty(exports, "PoiAction", { enumerable: true, get: function () { return Poi_1.PoiAction; } });
|
10
|
-
var Track_1 = require("./modules/Track");
|
11
|
-
Object.defineProperty(exports, "TrackAction", { enumerable: true, get: function () { return Track_1.TrackAction; } });
|
12
|
-
//# sourceMappingURL=index.js.map
|
1
|
+
export { Action } from './modules/Action';
|
2
|
+
export { VideoFusionAction } from "./modules/VideoFusion";
|
3
|
+
export { PoiAction } from './modules/Poi';
|
4
|
+
export { TrackAction } from './modules/Track';
|
package/dist/modules/Action.d.ts
CHANGED
package/dist/modules/Action.js
CHANGED
@@ -1,7 +1,4 @@
|
|
1
|
-
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.Action = void 0;
|
4
|
-
class Action {
|
1
|
+
export class Action {
|
5
2
|
/**
|
6
3
|
* 视角初始化
|
7
4
|
*/
|
@@ -23,5 +20,3 @@ class Action {
|
|
23
20
|
(_a = window.ps) === null || _a === void 0 ? void 0 : _a.emitMessage(JSON.stringify(param));
|
24
21
|
}
|
25
22
|
}
|
26
|
-
exports.Action = Action;
|
27
|
-
//# sourceMappingURL=Action.js.map
|
package/dist/modules/Poi.d.ts
CHANGED
@@ -3,9 +3,24 @@
|
|
3
3
|
*/
|
4
4
|
import { Action } from "./Action";
|
5
5
|
export declare class PoiAction extends Action {
|
6
|
+
/**
|
7
|
+
* 添加poi
|
8
|
+
*/
|
9
|
+
static poiAdd({ type, location, text, place, description, linkId }: RequiredSome<PoiType, 'action' | 'type' | 'location'>): void;
|
6
10
|
/**
|
7
11
|
* 删除poi
|
8
|
-
* @param {string} id
|
9
12
|
*/
|
10
|
-
static poiDel(id:
|
13
|
+
static poiDel({ id }: PoiType): void;
|
14
|
+
/**
|
15
|
+
* 显示poi
|
16
|
+
*/
|
17
|
+
static poiShow({ id, type, place }: PoiType): void;
|
18
|
+
/**
|
19
|
+
* 隐藏poi
|
20
|
+
*/
|
21
|
+
static poiHide({ id, type, place }: PoiType): void;
|
22
|
+
/**
|
23
|
+
* 获取指定POI
|
24
|
+
*/
|
25
|
+
static poiGetInfo({ type }: PoiType): void;
|
11
26
|
}
|
package/dist/modules/Poi.js
CHANGED
@@ -1,16 +1,28 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.PoiAction = void 0;
|
4
1
|
/**
|
5
2
|
* POI点方法
|
6
3
|
*/
|
7
|
-
|
8
|
-
class PoiAction extends
|
4
|
+
import { Action } from "./Action";
|
5
|
+
export class PoiAction extends Action {
|
6
|
+
/**
|
7
|
+
* 添加poi
|
8
|
+
*/
|
9
|
+
static poiAdd({ type = 'Camera', location, text = '', place = '', description = '', linkId = '' }) {
|
10
|
+
const param = {
|
11
|
+
cmd: "POI",
|
12
|
+
action: "add",
|
13
|
+
type,
|
14
|
+
text,
|
15
|
+
location,
|
16
|
+
place,
|
17
|
+
description,
|
18
|
+
linkId
|
19
|
+
};
|
20
|
+
this.sendParam(param, '删除POI');
|
21
|
+
}
|
9
22
|
/**
|
10
23
|
* 删除poi
|
11
|
-
* @param {string} id
|
12
24
|
*/
|
13
|
-
static poiDel(id) {
|
25
|
+
static poiDel({ id }) {
|
14
26
|
const param = {
|
15
27
|
cmd: "POI",
|
16
28
|
action: "delete",
|
@@ -18,6 +30,45 @@ class PoiAction extends Action_1.Action {
|
|
18
30
|
};
|
19
31
|
this.sendParam(param, '删除POI');
|
20
32
|
}
|
33
|
+
/**
|
34
|
+
* 显示poi
|
35
|
+
*/
|
36
|
+
static poiShow({ id, type = "Camera", place }) {
|
37
|
+
const param = {
|
38
|
+
cmd: "POI",
|
39
|
+
action: "show",
|
40
|
+
type,
|
41
|
+
place
|
42
|
+
};
|
43
|
+
if (id) {
|
44
|
+
param['id'] = id;
|
45
|
+
}
|
46
|
+
this.sendParam(param, '显示POI');
|
47
|
+
}
|
48
|
+
/**
|
49
|
+
* 隐藏poi
|
50
|
+
*/
|
51
|
+
static poiHide({ id, type = "Camera", place }) {
|
52
|
+
const param = {
|
53
|
+
cmd: "POI",
|
54
|
+
action: "hide",
|
55
|
+
type,
|
56
|
+
place
|
57
|
+
};
|
58
|
+
if (id) {
|
59
|
+
param['id'] = id;
|
60
|
+
}
|
61
|
+
this.sendParam(param, '隐藏POI');
|
62
|
+
}
|
63
|
+
/**
|
64
|
+
* 获取指定POI
|
65
|
+
*/
|
66
|
+
static poiGetInfo({ type = 'Camera' }) {
|
67
|
+
const param = {
|
68
|
+
cmd: "POI",
|
69
|
+
action: "getInfo",
|
70
|
+
type,
|
71
|
+
};
|
72
|
+
this.sendParam(param, '获取POI信息');
|
73
|
+
}
|
21
74
|
}
|
22
|
-
exports.PoiAction = PoiAction;
|
23
|
-
//# sourceMappingURL=Poi.js.map
|
package/dist/modules/Track.d.ts
CHANGED
@@ -5,18 +5,14 @@ import { Action } from "./Action";
|
|
5
5
|
export declare class TrackAction extends Action {
|
6
6
|
/**
|
7
7
|
* 清除轨迹
|
8
|
-
* @param {string} pathId add命令生成的轨迹ID
|
9
8
|
*/
|
10
|
-
static trackRemove(pathId
|
9
|
+
static trackRemove({ pathId }: TrackType): void;
|
11
10
|
/**
|
12
11
|
* 获取三维路网坐标
|
13
|
-
* @param {IdList} data
|
14
|
-
* @param {string} rnId
|
15
12
|
*/
|
16
|
-
static trackGetRoadNet(data
|
13
|
+
static trackGetRoadNet({ data, rnId }: TrackType): void;
|
17
14
|
/**
|
18
15
|
* 请求三维绘制路网
|
19
|
-
* @param {PathList} data
|
20
16
|
*/
|
21
|
-
static trackPath(data:
|
17
|
+
static trackPath({ data, pathId }: TrackType): void;
|
22
18
|
}
|
package/dist/modules/Track.js
CHANGED
@@ -1,16 +1,12 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.TrackAction = void 0;
|
4
1
|
/**
|
5
2
|
* 轨迹方法
|
6
3
|
*/
|
7
|
-
|
8
|
-
class TrackAction extends
|
4
|
+
import { Action } from "./Action";
|
5
|
+
export class TrackAction extends Action {
|
9
6
|
/**
|
10
7
|
* 清除轨迹
|
11
|
-
* @param {string} pathId add命令生成的轨迹ID
|
12
8
|
*/
|
13
|
-
static trackRemove(pathId = "CameraTrack") {
|
9
|
+
static trackRemove({ pathId = "CameraTrack" }) {
|
14
10
|
const param = {
|
15
11
|
cmd: "path",
|
16
12
|
action: "remove",
|
@@ -20,10 +16,8 @@ class TrackAction extends Action_1.Action {
|
|
20
16
|
}
|
21
17
|
/**
|
22
18
|
* 获取三维路网坐标
|
23
|
-
* @param {IdList} data
|
24
|
-
* @param {string} rnId
|
25
19
|
*/
|
26
|
-
static trackGetRoadNet(data, rnId = 'RN-1') {
|
20
|
+
static trackGetRoadNet({ data, rnId = 'RN-1' }) {
|
27
21
|
const param = {
|
28
22
|
cmd: "path",
|
29
23
|
action: "getRoadNet",
|
@@ -34,18 +28,15 @@ class TrackAction extends Action_1.Action {
|
|
34
28
|
}
|
35
29
|
/**
|
36
30
|
* 请求三维绘制路网
|
37
|
-
* @param {PathList} data
|
38
31
|
*/
|
39
|
-
static trackPath(data) {
|
32
|
+
static trackPath({ data, pathId = "CameraTrack" }) {
|
40
33
|
const param = {
|
41
34
|
cmd: "path",
|
42
35
|
action: "add",
|
43
|
-
pathId
|
36
|
+
pathId,
|
44
37
|
type: "BaseOnRoadNet",
|
45
38
|
data
|
46
39
|
};
|
47
40
|
this.sendParam(param, '请求三维绘制路径');
|
48
41
|
}
|
49
42
|
}
|
50
|
-
exports.TrackAction = TrackAction;
|
51
|
-
//# sourceMappingURL=Track.js.map
|
@@ -5,31 +5,22 @@ import { Action } from "./Action";
|
|
5
5
|
export declare class VideoFusionAction extends Action {
|
6
6
|
/**
|
7
7
|
* 视频融合初始化
|
8
|
-
* @param {string} token
|
9
|
-
* @param {string} ip
|
10
|
-
* @param {string} port
|
11
|
-
* @param {boolean} isHttps
|
12
8
|
*/
|
13
|
-
static videoFusionInit(token
|
9
|
+
static videoFusionInit({ token, ip, port, isHttps }: VideoFusionType): void;
|
14
10
|
/**
|
15
11
|
* 飞行到视频融合点位
|
16
|
-
* @param {string} id 点ID
|
17
|
-
* @param {number} fov 视场角
|
18
12
|
*/
|
19
|
-
static videoFusionFlyTo(id
|
13
|
+
static videoFusionFlyTo({ id, fov }: VideoFusionType): void;
|
20
14
|
/**
|
21
15
|
* 开启视频融合
|
22
|
-
* @param {IdList} ids 点列表
|
23
16
|
*/
|
24
|
-
static videoFusionStart(ids:
|
17
|
+
static videoFusionStart({ ids }: VideoFusionType): void;
|
25
18
|
/**
|
26
19
|
* 关闭视频融合
|
27
|
-
* @param {IdList} ids 点列表
|
28
20
|
*/
|
29
|
-
static videoFusionStop(ids:
|
21
|
+
static videoFusionStop({ ids }: VideoFusionType): void;
|
30
22
|
/**
|
31
23
|
* 刷新视频融合
|
32
|
-
* @param {string} token
|
33
24
|
*/
|
34
|
-
static videoFusionRefresh(token:
|
25
|
+
static videoFusionRefresh({ token }: VideoFusionType): void;
|
35
26
|
}
|
@@ -1,19 +1,12 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.VideoFusionAction = void 0;
|
4
1
|
/**
|
5
2
|
* 视频融合方法
|
6
3
|
*/
|
7
|
-
|
8
|
-
class VideoFusionAction extends
|
4
|
+
import { Action } from "./Action";
|
5
|
+
export class VideoFusionAction extends Action {
|
9
6
|
/**
|
10
7
|
* 视频融合初始化
|
11
|
-
* @param {string} token
|
12
|
-
* @param {string} ip
|
13
|
-
* @param {string} port
|
14
|
-
* @param {boolean} isHttps
|
15
8
|
*/
|
16
|
-
static videoFusionInit(token, ip, port = '1998', isHttps = false) {
|
9
|
+
static videoFusionInit({ token, ip, port = '1998', isHttps = false }) {
|
17
10
|
const param = {
|
18
11
|
cmd: "videoFusion",
|
19
12
|
action: "init",
|
@@ -26,10 +19,8 @@ class VideoFusionAction extends Action_1.Action {
|
|
26
19
|
}
|
27
20
|
/**
|
28
21
|
* 飞行到视频融合点位
|
29
|
-
* @param {string} id 点ID
|
30
|
-
* @param {number} fov 视场角
|
31
22
|
*/
|
32
|
-
static videoFusionFlyTo(id, fov) {
|
23
|
+
static videoFusionFlyTo({ id, fov }) {
|
33
24
|
const param = {
|
34
25
|
cmd: "videoFusion",
|
35
26
|
action: "flyTo",
|
@@ -40,9 +31,8 @@ class VideoFusionAction extends Action_1.Action {
|
|
40
31
|
}
|
41
32
|
/**
|
42
33
|
* 开启视频融合
|
43
|
-
* @param {IdList} ids 点列表
|
44
34
|
*/
|
45
|
-
static videoFusionStart(ids) {
|
35
|
+
static videoFusionStart({ ids }) {
|
46
36
|
const param = {
|
47
37
|
cmd: "videoFusion",
|
48
38
|
action: "start",
|
@@ -55,9 +45,8 @@ class VideoFusionAction extends Action_1.Action {
|
|
55
45
|
}
|
56
46
|
/**
|
57
47
|
* 关闭视频融合
|
58
|
-
* @param {IdList} ids 点列表
|
59
48
|
*/
|
60
|
-
static videoFusionStop(ids) {
|
49
|
+
static videoFusionStop({ ids }) {
|
61
50
|
const param = {
|
62
51
|
cmd: "videoFusion",
|
63
52
|
action: "stop",
|
@@ -70,9 +59,8 @@ class VideoFusionAction extends Action_1.Action {
|
|
70
59
|
}
|
71
60
|
/**
|
72
61
|
* 刷新视频融合
|
73
|
-
* @param {string} token
|
74
62
|
*/
|
75
|
-
static videoFusionRefresh(token) {
|
63
|
+
static videoFusionRefresh({ token }) {
|
76
64
|
const param = {
|
77
65
|
cmd: "videoFusion",
|
78
66
|
action: "refresh",
|
@@ -81,5 +69,3 @@ class VideoFusionAction extends Action_1.Action {
|
|
81
69
|
this.sendParam(param);
|
82
70
|
}
|
83
71
|
}
|
84
|
-
exports.VideoFusionAction = VideoFusionAction;
|
85
|
-
//# sourceMappingURL=VideoFusion.js.map
|
package/package.json
CHANGED
@@ -1,17 +1,18 @@
|
|
1
|
-
{
|
2
|
-
"name": "model-action",
|
3
|
-
"version": "1.0.
|
4
|
-
"description": "与三维交互api",
|
5
|
-
"main": "dist/index.js",
|
6
|
-
"types": "dist/index.d.ts",
|
7
|
-
"scripts": {
|
8
|
-
"build":"tsc",
|
9
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
10
|
-
},
|
11
|
-
"files": ["dist","src"],
|
12
|
-
"author": "andm31",
|
13
|
-
"license": "ISC",
|
14
|
-
"devDependencies": {
|
15
|
-
"typescript": "^5.8.3"
|
16
|
-
}
|
17
|
-
|
1
|
+
{
|
2
|
+
"name": "model-action",
|
3
|
+
"version": "1.0.4",
|
4
|
+
"description": "与三维交互api",
|
5
|
+
"main": "dist/index.js",
|
6
|
+
"types": "dist/index.d.ts",
|
7
|
+
"scripts": {
|
8
|
+
"build":"tsc && cp index.d.ts dist/",
|
9
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
10
|
+
},
|
11
|
+
"files": ["dist","src"],
|
12
|
+
"author": "andm31",
|
13
|
+
"license": "ISC",
|
14
|
+
"devDependencies": {
|
15
|
+
"typescript": "^5.8.3"
|
16
|
+
},
|
17
|
+
"type": "module"
|
18
|
+
}
|
package/src/modules/Action.ts
CHANGED
@@ -15,7 +15,7 @@ export class Action {
|
|
15
15
|
* @param {SendParam} param 发送的参数
|
16
16
|
* @param {string} msg 打印的信息
|
17
17
|
*/
|
18
|
-
static sendParam(param:
|
18
|
+
static sendParam<T extends SendParam>(param: T, msg: string = '') {
|
19
19
|
console.log(`发送给三维|${msg}`, JSON.stringify(param));
|
20
20
|
(window as any).ps?.emitMessage(JSON.stringify(param));
|
21
21
|
}
|
package/src/modules/Poi.ts
CHANGED
@@ -4,12 +4,28 @@
|
|
4
4
|
import { Action } from "./Action";
|
5
5
|
|
6
6
|
export class PoiAction extends Action {
|
7
|
+
/**
|
8
|
+
* 添加poi
|
9
|
+
*/
|
10
|
+
static poiAdd({ type = 'Camera', location, text = '', place = '', description = '', linkId = '' }: RequiredSome<PoiType, 'action' | 'type' | 'location'>) {
|
11
|
+
const param: RequiredSome<PoiType, 'action' | 'type' | 'location'> = {
|
12
|
+
cmd: "POI",
|
13
|
+
action: "add",
|
14
|
+
type,
|
15
|
+
text,
|
16
|
+
location,
|
17
|
+
place,
|
18
|
+
description,
|
19
|
+
linkId
|
20
|
+
};
|
21
|
+
this.sendParam(param, '删除POI')
|
22
|
+
}
|
23
|
+
|
7
24
|
/**
|
8
25
|
* 删除poi
|
9
|
-
* @param {string} id
|
10
26
|
*/
|
11
|
-
static poiDel(id:
|
12
|
-
const param:
|
27
|
+
static poiDel({ id }: PoiType) {
|
28
|
+
const param: PoiType = {
|
13
29
|
cmd: "POI",
|
14
30
|
action: "delete",
|
15
31
|
id,
|
@@ -17,4 +33,49 @@ export class PoiAction extends Action {
|
|
17
33
|
this.sendParam(param, '删除POI')
|
18
34
|
}
|
19
35
|
|
36
|
+
/**
|
37
|
+
* 显示poi
|
38
|
+
*/
|
39
|
+
static poiShow({ id, type = "Camera", place }: PoiType) {
|
40
|
+
const param: PoiType = {
|
41
|
+
cmd: "POI",
|
42
|
+
action: "show",
|
43
|
+
type,
|
44
|
+
place
|
45
|
+
};
|
46
|
+
if (id) {
|
47
|
+
param['id'] = id
|
48
|
+
}
|
49
|
+
|
50
|
+
this.sendParam(param, '显示POI')
|
51
|
+
}
|
52
|
+
|
53
|
+
/**
|
54
|
+
* 隐藏poi
|
55
|
+
*/
|
56
|
+
static poiHide({ id, type = "Camera", place }: PoiType) {
|
57
|
+
const param: PoiType = {
|
58
|
+
cmd: "POI",
|
59
|
+
action: "hide",
|
60
|
+
type,
|
61
|
+
place
|
62
|
+
};
|
63
|
+
if (id) {
|
64
|
+
param['id'] = id
|
65
|
+
}
|
66
|
+
|
67
|
+
this.sendParam(param, '隐藏POI')
|
68
|
+
}
|
69
|
+
|
70
|
+
/**
|
71
|
+
* 获取指定POI
|
72
|
+
*/
|
73
|
+
static poiGetInfo({type='Camera'}:PoiType) {
|
74
|
+
const param: PoiType = {
|
75
|
+
cmd: "POI",
|
76
|
+
action: "getInfo",
|
77
|
+
type,
|
78
|
+
};
|
79
|
+
this.sendParam(param, '获取POI信息')
|
80
|
+
}
|
20
81
|
}
|
package/src/modules/Track.ts
CHANGED
@@ -6,10 +6,9 @@ import { Action } from "./Action";
|
|
6
6
|
export class TrackAction extends Action {
|
7
7
|
/**
|
8
8
|
* 清除轨迹
|
9
|
-
* @param {string} pathId add命令生成的轨迹ID
|
10
9
|
*/
|
11
|
-
static trackRemove(pathId
|
12
|
-
const param:
|
10
|
+
static trackRemove({ pathId = "CameraTrack" }: TrackType) {
|
11
|
+
const param: TrackType = {
|
13
12
|
cmd: "path",
|
14
13
|
action: "remove",
|
15
14
|
pathId
|
@@ -19,11 +18,9 @@ export class TrackAction extends Action {
|
|
19
18
|
|
20
19
|
/**
|
21
20
|
* 获取三维路网坐标
|
22
|
-
* @param {IdList} data
|
23
|
-
* @param {string} rnId
|
24
21
|
*/
|
25
|
-
static trackGetRoadNet(data
|
26
|
-
const param:
|
22
|
+
static trackGetRoadNet({ data, rnId = 'RN-1' }: TrackType) {
|
23
|
+
const param: TrackType = {
|
27
24
|
cmd: "path",
|
28
25
|
action: "getRoadNet",
|
29
26
|
rnId,
|
@@ -34,13 +31,12 @@ export class TrackAction extends Action {
|
|
34
31
|
|
35
32
|
/**
|
36
33
|
* 请求三维绘制路网
|
37
|
-
* @param {PathList} data
|
38
34
|
*/
|
39
|
-
static trackPath(data:
|
40
|
-
const param:
|
35
|
+
static trackPath({ data, pathId = "CameraTrack" }: TrackType) {
|
36
|
+
const param: TrackType = {
|
41
37
|
cmd: "path",
|
42
38
|
action: "add",
|
43
|
-
pathId
|
39
|
+
pathId,
|
44
40
|
type: "BaseOnRoadNet",
|
45
41
|
data
|
46
42
|
};
|
@@ -6,13 +6,9 @@ import { Action } from "./Action";
|
|
6
6
|
export class VideoFusionAction extends Action {
|
7
7
|
/**
|
8
8
|
* 视频融合初始化
|
9
|
-
* @param {string} token
|
10
|
-
* @param {string} ip
|
11
|
-
* @param {string} port
|
12
|
-
* @param {boolean} isHttps
|
13
9
|
*/
|
14
|
-
static videoFusionInit(token
|
15
|
-
const param:
|
10
|
+
static videoFusionInit({ token, ip, port = '1998', isHttps = false }: VideoFusionType) {
|
11
|
+
const param: VideoFusionType = {
|
16
12
|
cmd: "videoFusion",
|
17
13
|
action: "init",
|
18
14
|
token,
|
@@ -25,11 +21,9 @@ export class VideoFusionAction extends Action {
|
|
25
21
|
|
26
22
|
/**
|
27
23
|
* 飞行到视频融合点位
|
28
|
-
* @param {string} id 点ID
|
29
|
-
* @param {number} fov 视场角
|
30
24
|
*/
|
31
|
-
static videoFusionFlyTo(id
|
32
|
-
const param:
|
25
|
+
static videoFusionFlyTo({id, fov}:VideoFusionType) {
|
26
|
+
const param: VideoFusionType = {
|
33
27
|
cmd: "videoFusion",
|
34
28
|
action: "flyTo",
|
35
29
|
id,
|
@@ -40,10 +34,9 @@ export class VideoFusionAction extends Action {
|
|
40
34
|
|
41
35
|
/**
|
42
36
|
* 开启视频融合
|
43
|
-
* @param {IdList} ids 点列表
|
44
37
|
*/
|
45
|
-
static videoFusionStart(ids:
|
46
|
-
const param:
|
38
|
+
static videoFusionStart({ids}:VideoFusionType) {
|
39
|
+
const param: VideoFusionType = {
|
47
40
|
cmd: "videoFusion",
|
48
41
|
action: "start",
|
49
42
|
isLocation: false,
|
@@ -56,10 +49,9 @@ export class VideoFusionAction extends Action {
|
|
56
49
|
|
57
50
|
/**
|
58
51
|
* 关闭视频融合
|
59
|
-
* @param {IdList} ids 点列表
|
60
52
|
*/
|
61
|
-
static videoFusionStop(ids:
|
62
|
-
const param:
|
53
|
+
static videoFusionStop({ids}:VideoFusionType) {
|
54
|
+
const param: VideoFusionType = {
|
63
55
|
cmd: "videoFusion",
|
64
56
|
action: "stop",
|
65
57
|
isLocation: false,
|
@@ -72,10 +64,9 @@ export class VideoFusionAction extends Action {
|
|
72
64
|
|
73
65
|
/**
|
74
66
|
* 刷新视频融合
|
75
|
-
* @param {string} token
|
76
67
|
*/
|
77
|
-
static videoFusionRefresh(token:
|
78
|
-
const param:
|
68
|
+
static videoFusionRefresh({token}:VideoFusionType) {
|
69
|
+
const param: VideoFusionType = {
|
79
70
|
cmd: "videoFusion",
|
80
71
|
action: "refresh",
|
81
72
|
token,
|
package/dist/index.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,2CAAyC;AAAhC,gGAAA,MAAM,OAAA;AACf,qDAA0D;AAAjD,gHAAA,iBAAiB,OAAA;AAC1B,qCAAyC;AAAhC,gGAAA,SAAS,OAAA;AAClB,yCAA6C;AAApC,oGAAA,WAAW,OAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Action.js","sourceRoot":"","sources":["../../src/modules/Action.ts"],"names":[],"mappings":";;;AAAA,MAAa,MAAM;IACf;;MAEE;IACF,MAAM,CAAC,UAAU;QACb,MAAM,KAAK,GAAc;YACrB,GAAG,EAAE,YAAY;YACjB,MAAM,EAAE,SAAS;SACpB,CAAC;QACF,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;IAClC,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,SAAS,CAAC,KAAgB,EAAE,MAAc,EAAE;;QAC/C,OAAO,CAAC,GAAG,CAAC,SAAS,GAAG,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;QACnD,MAAC,MAAc,CAAC,EAAE,0CAAE,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IAC3D,CAAC;CACJ;AArBD,wBAqBC"}
|
package/dist/modules/Poi.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Poi.js","sourceRoot":"","sources":["../../src/modules/Poi.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,qCAAkC;AAElC,MAAa,SAAU,SAAQ,eAAM;IACjC;;;MAGE;IACF,MAAM,CAAC,MAAM,CAAC,EAAU;QACpB,MAAM,KAAK,GAAc;YACrB,GAAG,EAAE,KAAK;YACV,MAAM,EAAE,QAAQ;YAChB,EAAE;SACL,CAAC;QACF,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;IAClC,CAAC;CAEJ;AAdD,8BAcC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Track.js","sourceRoot":"","sources":["../../src/modules/Track.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,qCAAkC;AAElC,MAAa,WAAY,SAAQ,eAAM;IACnC;;;OAGG;IACH,MAAM,CAAC,WAAW,CAAC,SAAiB,aAAa;QAC7C,MAAM,KAAK,GAAc;YACrB,GAAG,EAAE,MAAM;YACX,MAAM,EAAE,QAAQ;YAChB,MAAM;SACT,CAAC;QACF,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IACrC,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,eAAe,CAAC,IAAY,EAAE,OAAe,MAAM;QACtD,MAAM,KAAK,GAAc;YACrB,GAAG,EAAE,MAAM;YACX,MAAM,EAAE,YAAY;YACpB,IAAI;YACJ,IAAI;SACP,CAAC;QACF,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,UAAU,CAAC,CAAA;IACrC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,SAAS,CAAC,IAAc;QAC3B,MAAM,KAAK,GAAc;YACrB,GAAG,EAAE,MAAM;YACX,MAAM,EAAE,KAAK;YACb,MAAM,EAAE,aAAa;YACrB,IAAI,EAAE,eAAe;YACrB,IAAI;SACP,CAAC;QACF,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,UAAU,CAAC,CAAA;IACrC,CAAC;CACJ;AA3CD,kCA2CC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"VideoFusion.js","sourceRoot":"","sources":["../../src/modules/VideoFusion.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,qCAAkC;AAElC,MAAa,iBAAkB,SAAQ,eAAM;IACzC;;;;;;OAMG;IACH,MAAM,CAAC,eAAe,CAAC,KAAa,EAAE,EAAU,EAAE,OAAe,MAAM,EAAE,UAAmB,KAAK;QAC7F,MAAM,KAAK,GAAc;YACrB,GAAG,EAAE,aAAa;YAClB,MAAM,EAAE,MAAM;YACd,KAAK;YACL,EAAE;YACF,IAAI;YACJ,OAAO;SACV,CAAC;QACF,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;IACpC,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,gBAAgB,CAAC,EAAU,EAAE,GAAW;QAC3C,MAAM,KAAK,GAAc;YACrB,GAAG,EAAE,aAAa;YAClB,MAAM,EAAE,OAAO;YACf,EAAE;YACF,GAAG;SACN,CAAC;QACF,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;IACzB,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,gBAAgB,CAAC,GAAW;QAC/B,MAAM,KAAK,GAAc;YACrB,GAAG,EAAE,aAAa;YAClB,MAAM,EAAE,OAAO;YACf,UAAU,EAAE,KAAK;YACjB,SAAS,EAAE,OAAO;YAClB,QAAQ,EAAE,KAAK;YACf,GAAG;SACN,CAAC;QACF,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;IACnC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,eAAe,CAAC,GAAW;QAC9B,MAAM,KAAK,GAAc;YACrB,GAAG,EAAE,aAAa;YAClB,MAAM,EAAE,MAAM;YACd,UAAU,EAAE,KAAK;YACjB,SAAS,EAAE,OAAO;YAClB,QAAQ,EAAE,KAAK;YACf,GAAG;SACN,CAAC;QACF,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;IACnC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,kBAAkB,CAAC,KAAa;QACnC,MAAM,KAAK,GAAc;YACrB,GAAG,EAAE,aAAa;YAClB,MAAM,EAAE,SAAS;YACjB,KAAK;SACR,CAAC;QACF,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;IACzB,CAAC;CACJ;AA/ED,8CA+EC"}
|