未验证 提交 1a5b7c8d 编写于 作者: 李瑾 提交者: GitHub

Dreamview:add car position and car heading when send cycle routing request (#13192)

上级 1fdddfbb
因为 它太大了无法显示 source diff 。你可以改为 查看blob
......@@ -5,8 +5,8 @@ import routingPointPin from 'assets/images/routing/pin.png';
import WS from 'store/websocket';
import { drawImage } from 'utils/draw';
const minDefaultRoutingPointsNum = 4;
const maxDistance = 100;
const minDefaultRoutingPointsNum = 1;
const maxDistance = 5;
export default class RoutingEditor {
constructor() {
......@@ -120,10 +120,11 @@ export default class RoutingEditor {
point.z = 0;
return coordinates.applyOffset(point, true);
});
const start = points[0];
const start = coordinates.applyOffset(carOffsetPosition, true);
const start_heading = carHeading;
const end = points[points.length - 1];
const waypoint = (points.length > 1) ? points.slice(1, -1) : [];
WS.requestDefaultCycleRouting(start, waypoint, end, cycleNumber);
const waypoint = (points.length > 1) ? points.slice(0, -1) : [];
WS.requestDefaultCycleRouting(start, start_heading, waypoint, end, cycleNumber);
return true;
}
......
......@@ -233,7 +233,7 @@ export default class RealtimeWebSocketEndpoint {
this.websocket.send(JSON.stringify(request));
}
requestDefaultCycleRouting(start,waypoint,end,cycleNumber) {
requestDefaultCycleRouting(start, start_heading, waypoint, end, cycleNumber) {
const request = {
type: 'SendDefaultCycleRoutingRequest',
start,
......@@ -241,6 +241,9 @@ export default class RealtimeWebSocketEndpoint {
waypoint,
cycleNumber
};
if (start_heading) {
request.start.heading = start_heading;
}
this.websocket.send(JSON.stringify(request));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册