@aibee/crc-bmap 0.8.44 → 0.8.46
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/bmap.cjs.min.js +408 -401
- package/lib/bmap.esm.js +7644 -1526
- package/lib/bmap.esm.min.js +408 -401
- package/lib/bmap.min.js +408 -401
- package/lib/src/bmap.js +60 -54
- package/lib/src/context/OrbitControls.js +4 -1
- package/lib/src/context/context.js +54 -37
- package/lib/src/context/control.js +85 -83
- package/lib/src/context/scene.js +1 -0
- package/lib/src/elements/base-svg.js +5 -4
- package/lib/src/elements/floor.js +8 -0
- package/lib/src/elements/glb-model.js +14 -18
- package/lib/src/elements/graphic.js +18 -8
- package/lib/src/elements/ground-texture.js +41 -44
- package/lib/src/elements/heatmap.js +2 -1
- package/lib/src/elements/lane.js +5 -1
- package/lib/src/elements/merge-graphic.js +3 -28
- package/lib/src/elements/model.js +5 -9
- package/lib/src/elements/overlay.js +9 -7
- package/lib/src/elements/poi.js +55 -49
- package/lib/src/elements/poi2.js +52 -53
- package/lib/src/elements/shadow.js +3 -1
- package/lib/src/elements/svg-line.js +2 -0
- package/lib/src/elements/svg-polygon.js +1 -0
- package/lib/src/elements/text-texture.js +32 -36
- package/lib/src/elements/wall.js +3 -41
- package/lib/src/external/meshLine.js +17 -0
- package/lib/src/factory/img-texture.js +1 -0
- package/lib/src/factory/material.js +21 -51
- package/lib/src/factory/model.js +31 -33
- package/lib/src/factory/text-texture.js +17 -0
- package/lib/src/factory/unique-key.js +8 -0
- package/lib/src/layer/graphic-layer.js +1 -0
- package/lib/src/layer/parking-layer.d.ts +6 -0
- package/lib/src/layer/parking-layer.js +8 -0
- package/lib/src/layer/poi-layer.js +4 -1
- package/lib/src/layer/poi-layer2.js +2 -0
- package/lib/src/loader/AibeeLoader/index.js +230 -276
- package/lib/src/loader/AibeeLoader/layer.js +8 -6
- package/lib/src/loader/CrLoader/api/floor.js +45 -73
- package/lib/src/loader/CrLoader/index.js +88 -106
- package/lib/src/operations/hover/hover-helper.js +12 -2
- package/lib/src/operations/selection/selection.js +11 -1
- package/lib/src/plugins/car-inertial-position/car-inertial-position.d.ts +42 -10
- package/lib/src/plugins/car-inertial-position/car-inertial-position.js +285 -67
- package/lib/src/plugins/car-inertial-position/compass.d.ts +4 -5
- package/lib/src/plugins/car-inertial-position/compass.js +43 -38
- package/lib/src/plugins/car-inertial-position/kalman-filter.d.ts +14 -0
- package/lib/src/plugins/car-inertial-position/kalman-filter.js +30 -0
- package/lib/src/plugins/car-inertial-position/utils.d.ts +1 -1
- package/lib/src/plugins/car-inertial-position/utils.js +8 -5
- package/lib/src/plugins/cr-nav-path/cr-nav-path.js +47 -55
- package/lib/src/plugins/cr-nav-path/cr-path.worker.js +4 -2
- package/lib/src/plugins/equipment/equipment.js +20 -22
- package/lib/src/plugins/mul-floor-navigation/mul-floor-navigation.js +63 -61
- package/lib/src/plugins/mul-floor-navigation/path.js +34 -30
- package/lib/src/plugins/mul-floor-navigation/start-model.js +2 -1
- package/lib/src/plugins/mul-floor-select/mul-floor-select.js +2 -1
- package/lib/src/plugins/mul-floors/mul-floors.js +1 -0
- package/lib/src/plugins/nav-path/nav-path.js +51 -59
- package/lib/src/plugins/nav-path/path.worker.js +4 -2
- package/lib/src/plugins/navigation/navigation.d.ts +5 -0
- package/lib/src/plugins/navigation/navigation.js +240 -217
- package/lib/src/plugins/navigation/path.js +34 -30
- package/lib/src/plugins/navigation/position-navigation.d.ts +4 -0
- package/lib/src/plugins/navigation/position-navigation.js +96 -79
- package/lib/src/plugins/navigation/start-rotate-helper-poi.js +18 -6
- package/lib/src/plugins/pdr-position/imu-position.js +13 -9
- package/lib/src/plugins/pdr-position/particle.js +4 -2
- package/lib/src/plugins/pdr-position/pdr.js +5 -4
- package/lib/src/plugins/pdr-position/position.js +5 -2
- package/lib/src/plugins/pdr-position/sensor.js +20 -25
- package/lib/src/plugins/select/select.js +11 -1
- package/lib/src/utils/camera-bound.js +3 -1
- package/lib/src/utils/color.js +8 -4
- package/lib/src/utils/coordinate.js +1 -0
- package/lib/src/utils/create.js +4 -2
- package/lib/src/utils/events.js +15 -4
- package/lib/src/utils/index-db.js +18 -11
- package/lib/src/utils/init-helper.js +7 -2
- package/lib/src/utils/obj-utils.js +3 -2
- package/lib/src/utils/os.js +1 -0
- package/lib/src/utils/path.js +15 -4
- package/lib/src/utils/promise.js +3 -1
- package/lib/src/utils/proxy.js +2 -1
- package/lib/src/utils/road.js +20 -14
- package/lib/src/utils/road2.js +60 -39
- package/lib/src/utils/rules.js +1 -0
- package/lib/src/utils/string.js +3 -1
- package/lib/src/utils/svg.js +12 -11
- package/lib/src/utils/taskQueue.js +29 -29
- package/lib/src/utils/timer.js +8 -1
- package/lib/src/utils/translate.js +3 -1
- package/lib/src/utils/tween.js +8 -0
- package/lib/src/utils/webworker.js +10 -9
- package/package.json +2 -1
package/lib/src/utils/svg.js
CHANGED
|
@@ -13,7 +13,8 @@ export function createSvgElement(tag) {
|
|
|
13
13
|
/**
|
|
14
14
|
* 创建圆点
|
|
15
15
|
* @param radius
|
|
16
|
-
*/ export function createCircle(radius
|
|
16
|
+
*/ export function createCircle(radius, fill) {
|
|
17
|
+
if (radius === void 0) radius = "2";
|
|
17
18
|
const circle = createSvgElement("circle");
|
|
18
19
|
circle.setAttribute("r", radius);
|
|
19
20
|
circle.setAttribute("fill", fill);
|
|
@@ -38,22 +39,22 @@ export function createSvgElement(tag) {
|
|
|
38
39
|
return rect;
|
|
39
40
|
}
|
|
40
41
|
export function setCirclePosition(circle, x, y) {
|
|
41
|
-
circle.setAttribute('cx',
|
|
42
|
-
circle.setAttribute('cy',
|
|
42
|
+
circle.setAttribute('cx', "" + x);
|
|
43
|
+
circle.setAttribute('cy', "" + y);
|
|
43
44
|
}
|
|
44
45
|
export function setLineStartEnd(line, start, end) {
|
|
45
46
|
if (start) {
|
|
46
|
-
line.setAttribute("x1",
|
|
47
|
-
line.setAttribute("y1",
|
|
47
|
+
line.setAttribute("x1", "" + start.x);
|
|
48
|
+
line.setAttribute("y1", "" + start.y);
|
|
48
49
|
}
|
|
49
50
|
if (end) {
|
|
50
|
-
line.setAttribute("x2",
|
|
51
|
-
line.setAttribute("y2",
|
|
51
|
+
line.setAttribute("x2", "" + end.x);
|
|
52
|
+
line.setAttribute("y2", "" + end.y);
|
|
52
53
|
}
|
|
53
54
|
}
|
|
54
55
|
export function setRectPosition(rect, x, y, w, h) {
|
|
55
|
-
rect.setAttribute('x',
|
|
56
|
-
rect.setAttribute('y',
|
|
57
|
-
rect.setAttribute('width',
|
|
58
|
-
rect.setAttribute('height',
|
|
56
|
+
rect.setAttribute('x', "" + x);
|
|
57
|
+
rect.setAttribute('y', "" + y);
|
|
58
|
+
rect.setAttribute('width', "" + w);
|
|
59
|
+
rect.setAttribute('height', "" + h);
|
|
59
60
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
|
2
1
|
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
2
|
+
import "core-js/modules/web.dom-collections.iterator.js";
|
|
3
|
+
import "core-js/modules/es.array.push.js";
|
|
4
|
+
import "core-js/modules/es.string.replace.js";
|
|
5
|
+
import "core-js/modules/es.regexp.exec.js";
|
|
3
6
|
import { isNil } from "lodash";
|
|
4
7
|
import { EventDispatcher } from "three";
|
|
5
8
|
class TaskQueue extends EventDispatcher {
|
|
@@ -70,7 +73,7 @@ class TaskQueue extends EventDispatcher {
|
|
|
70
73
|
}
|
|
71
74
|
const index = this._getIndexByTid(id);
|
|
72
75
|
if (index === -1) {
|
|
73
|
-
console.warn(
|
|
76
|
+
console.warn("[TaskQueue] 没有找到id=" + id + "的任务");
|
|
74
77
|
return false;
|
|
75
78
|
}
|
|
76
79
|
const $task = this._createTask(task);
|
|
@@ -97,7 +100,7 @@ class TaskQueue extends EventDispatcher {
|
|
|
97
100
|
*/ remove(id) {
|
|
98
101
|
const index = this._getIndexByTid(id);
|
|
99
102
|
if (index === -1) {
|
|
100
|
-
console.warn(
|
|
103
|
+
console.warn("[TaskQueue] remove方法传入的id:" + id + "找不到对应的task");
|
|
101
104
|
return false;
|
|
102
105
|
}
|
|
103
106
|
this._task.splice(index, 1);
|
|
@@ -123,32 +126,29 @@ class TaskQueue extends EventDispatcher {
|
|
|
123
126
|
}
|
|
124
127
|
/**
|
|
125
128
|
* 从任务队列中的第一个任务开始执行
|
|
126
|
-
*/ exec() {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
});
|
|
150
|
-
return _this.exec();
|
|
151
|
-
})();
|
|
129
|
+
*/ async exec() {
|
|
130
|
+
if (!this.started || !this._task.length) {
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
const $task = this._task.shift();
|
|
134
|
+
this.activeTask = $task;
|
|
135
|
+
this.dispatchEvent({
|
|
136
|
+
type: "active-task-start",
|
|
137
|
+
task: $task
|
|
138
|
+
});
|
|
139
|
+
let res;
|
|
140
|
+
try {
|
|
141
|
+
res = await $task.run();
|
|
142
|
+
} catch (e) {
|
|
143
|
+
console.warn("[task run err]", e, $task);
|
|
144
|
+
}
|
|
145
|
+
this.activeTask = null;
|
|
146
|
+
this.dispatchEvent({
|
|
147
|
+
type: "active-task-end",
|
|
148
|
+
task: $task,
|
|
149
|
+
res
|
|
150
|
+
});
|
|
151
|
+
return this.exec();
|
|
152
152
|
}
|
|
153
153
|
constructor(start = true){
|
|
154
154
|
super(), // 任务队列
|
package/lib/src/utils/timer.js
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
import "core-js/modules/es.set.difference.v2.js";
|
|
2
|
+
import "core-js/modules/es.set.intersection.v2.js";
|
|
3
|
+
import "core-js/modules/es.set.is-disjoint-from.v2.js";
|
|
4
|
+
import "core-js/modules/es.set.is-subset-of.v2.js";
|
|
5
|
+
import "core-js/modules/es.set.is-superset-of.v2.js";
|
|
6
|
+
import "core-js/modules/es.set.symmetric-difference.v2.js";
|
|
7
|
+
import "core-js/modules/es.set.union.v2.js";
|
|
8
|
+
import "core-js/modules/web.dom-collections.iterator.js";
|
|
1
9
|
/**
|
|
2
10
|
* 任务管理器
|
|
3
11
|
* 在类销毁的时候,要清除所有的异步定时器
|
|
@@ -28,7 +36,6 @@
|
|
|
28
36
|
}
|
|
29
37
|
setInterval(fn, wait) {
|
|
30
38
|
const timer = window.setInterval(()=>{
|
|
31
|
-
this.tasks.interval.delete(timer);
|
|
32
39
|
fn();
|
|
33
40
|
}, wait);
|
|
34
41
|
this.tasks.interval.add(timer);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import "core-js/modules/es.json.stringify.js";
|
|
2
|
+
export function transformGraphicData(data, center, baseIndex) {
|
|
3
|
+
if (baseIndex === void 0) baseIndex = 0;
|
|
2
4
|
data.forEach((item)=>{
|
|
3
5
|
item.geometry.coords = JSON.parse(JSON.stringify(item.geometry.cds));
|
|
4
6
|
if (item.geometry.type === "polygon") {
|
package/lib/src/utils/tween.js
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
import "core-js/modules/es.set.difference.v2.js";
|
|
2
|
+
import "core-js/modules/es.set.intersection.v2.js";
|
|
3
|
+
import "core-js/modules/es.set.is-disjoint-from.v2.js";
|
|
4
|
+
import "core-js/modules/es.set.is-subset-of.v2.js";
|
|
5
|
+
import "core-js/modules/es.set.is-superset-of.v2.js";
|
|
6
|
+
import "core-js/modules/es.set.symmetric-difference.v2.js";
|
|
7
|
+
import "core-js/modules/es.set.union.v2.js";
|
|
8
|
+
import "core-js/modules/web.dom-collections.iterator.js";
|
|
1
9
|
import { Group } from '@tweenjs/tween.js';
|
|
2
10
|
export class TweenUtil {
|
|
3
11
|
update() {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
|
2
1
|
import { UniqueKeyFactory } from "../factory/unique-key";
|
|
3
2
|
import { convertToSnakeCase } from "./string";
|
|
4
3
|
/**
|
|
@@ -9,8 +8,9 @@ import { convertToSnakeCase } from "./string";
|
|
|
9
8
|
*/ export function triggerWorker(worker, type, data) {
|
|
10
9
|
return new Promise((resolve, reject)=>{
|
|
11
10
|
const key = UniqueKeyFactory.genUniqueKey();
|
|
12
|
-
const onMessage = (
|
|
13
|
-
|
|
11
|
+
const onMessage = (param)=>{
|
|
12
|
+
let { data } = param;
|
|
13
|
+
if (data.type === "" + type + "_result" && data.key === key) {
|
|
14
14
|
UniqueKeyFactory.removeKey(key);
|
|
15
15
|
self.removeEventListener("message", onMessage);
|
|
16
16
|
if (data.error) {
|
|
@@ -35,30 +35,31 @@ export function toWebWorker(obj) {
|
|
|
35
35
|
events[convertToSnakeCase(key.slice(2))] = obj[key];
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
const onMessage =
|
|
38
|
+
const onMessage = async (param)=>{
|
|
39
|
+
let { data } = param;
|
|
39
40
|
if (events[data.type]) {
|
|
40
41
|
try {
|
|
41
|
-
const result =
|
|
42
|
+
const result = await events[data.type](data.data);
|
|
42
43
|
self.postMessage({
|
|
43
|
-
type:
|
|
44
|
+
type: "" + data.type + "_result",
|
|
44
45
|
key: data.key,
|
|
45
46
|
data: result
|
|
46
47
|
});
|
|
47
48
|
} catch (e) {
|
|
48
49
|
self.postMessage({
|
|
49
|
-
type:
|
|
50
|
+
type: "" + data.type + "_result",
|
|
50
51
|
key: data.key,
|
|
51
52
|
error: e
|
|
52
53
|
});
|
|
53
54
|
}
|
|
54
55
|
} else {
|
|
55
56
|
self.postMessage({
|
|
56
|
-
type:
|
|
57
|
+
type: "" + data.type + "_result",
|
|
57
58
|
key: data.key,
|
|
58
59
|
error: "no_event"
|
|
59
60
|
});
|
|
60
61
|
}
|
|
61
|
-
}
|
|
62
|
+
};
|
|
62
63
|
self.addEventListener("message", onMessage);
|
|
63
64
|
return ()=>{
|
|
64
65
|
self.removeEventListener("message", onMessage);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aibee/crc-bmap",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.46",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/bmap.min.js",
|
|
6
6
|
"module": "lib/bmap.esm.js",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"@tweenjs/tween.js": "^21.0.0",
|
|
52
52
|
"@types/three": "^0.169.0",
|
|
53
53
|
"chaikin-smooth": "^1.0.4",
|
|
54
|
+
"core-js": "^3.39.0",
|
|
54
55
|
"hotkeys-js": "^3.12.0",
|
|
55
56
|
"lodash": "^4.17.21",
|
|
56
57
|
"mathjs": "^13.1.1",
|