|
@@ -47,10 +47,7 @@ export default class Load {
|
|
}
|
|
}
|
|
|
|
|
|
if (dataLocal.backgroundImg) {
|
|
if (dataLocal.backgroundImg) {
|
|
- let bgImg = imageService.createBackgroundImg(
|
|
|
|
- dataLocal.backgroundImg.src,
|
|
|
|
- dataLocal.backgroundImg.vectorId
|
|
|
|
- );
|
|
|
|
|
|
+ let bgImg = imageService.createBackgroundImg(dataLocal.backgroundImg.src, dataLocal.backgroundImg.vectorId);
|
|
bgImg.setCenter(dataLocal.backgroundImg.center);
|
|
bgImg.setCenter(dataLocal.backgroundImg.center);
|
|
// bgImg.setDisplay(dataLocal.backgroundImg.display);
|
|
// bgImg.setDisplay(dataLocal.backgroundImg.display);
|
|
bgImg.setDisplay(true); //背景图始终显示
|
|
bgImg.setDisplay(true); //背景图始终显示
|
|
@@ -65,11 +62,7 @@ export default class Load {
|
|
|
|
|
|
if (dataLocal.circles) {
|
|
if (dataLocal.circles) {
|
|
for (let key in dataLocal.circles) {
|
|
for (let key in dataLocal.circles) {
|
|
- let circle = circleService.create(
|
|
|
|
- dataLocal.circles[key].center,
|
|
|
|
- dataLocal.circles[key].radius || dataLocal.circles[key].radiusX,
|
|
|
|
- key
|
|
|
|
- );
|
|
|
|
|
|
+ let circle = circleService.create(dataLocal.circles[key].center, dataLocal.circles[key].radius || dataLocal.circles[key].radiusX, key);
|
|
circle.setRadiusX(dataLocal.circles[key].radiusX);
|
|
circle.setRadiusX(dataLocal.circles[key].radiusX);
|
|
circle.setRadiusY(dataLocal.circles[key].radiusY);
|
|
circle.setRadiusY(dataLocal.circles[key].radiusY);
|
|
circle.setPoints(dataLocal.circles[key].points);
|
|
circle.setPoints(dataLocal.circles[key].points);
|
|
@@ -80,10 +73,7 @@ export default class Load {
|
|
|
|
|
|
if (dataLocal.magnifiers) {
|
|
if (dataLocal.magnifiers) {
|
|
for (let key in dataLocal.magnifiers) {
|
|
for (let key in dataLocal.magnifiers) {
|
|
- let magnifier = magnifierService.create(
|
|
|
|
- dataLocal.magnifiers[key].position,
|
|
|
|
- key
|
|
|
|
- );
|
|
|
|
|
|
+ let magnifier = magnifierService.create(dataLocal.magnifiers[key].position, key);
|
|
magnifier.setSrc(dataLocal.magnifiers[key].photoUrl);
|
|
magnifier.setSrc(dataLocal.magnifiers[key].photoUrl);
|
|
magnifier.setDisplay(dataLocal.magnifiers[key].display);
|
|
magnifier.setDisplay(dataLocal.magnifiers[key].display);
|
|
|
|
|
|
@@ -101,9 +91,7 @@ export default class Load {
|
|
for (let key in dataLocal.points) {
|
|
for (let key in dataLocal.points) {
|
|
let point = pointService.create(dataLocal.points[key], key);
|
|
let point = pointService.create(dataLocal.points[key], key);
|
|
point.setCategory(dataLocal.points[key].category);
|
|
point.setCategory(dataLocal.points[key].category);
|
|
- point.setParent(
|
|
|
|
- JSON.parse(JSON.stringify(dataLocal.points[key].parent))
|
|
|
|
- );
|
|
|
|
|
|
+ point.setParent(JSON.parse(JSON.stringify(dataLocal.points[key].parent)));
|
|
point.setDisplay(dataLocal.points[key].display);
|
|
point.setDisplay(dataLocal.points[key].display);
|
|
point.setLocationMode(dataLocal.points[key].locationMode);
|
|
point.setLocationMode(dataLocal.points[key].locationMode);
|
|
point.setLinkedBasePointId(dataLocal.points[key].linkedBasePointId);
|
|
point.setLinkedBasePointId(dataLocal.points[key].linkedBasePointId);
|
|
@@ -123,23 +111,14 @@ export default class Load {
|
|
|
|
|
|
if (dataLocal.svgs) {
|
|
if (dataLocal.svgs) {
|
|
for (let key in dataLocal.svgs) {
|
|
for (let key in dataLocal.svgs) {
|
|
- let svg = svgService.create(
|
|
|
|
- dataLocal.svgs[key].center,
|
|
|
|
- dataLocal.svgs[key].type,
|
|
|
|
- dataLocal.svgs[key].vectorId
|
|
|
|
- );
|
|
|
|
|
|
+ let svg = svgService.create(dataLocal.svgs[key].center, dataLocal.svgs[key].type, dataLocal.svgs[key].vectorId);
|
|
svg.setPoints(dataLocal.svgs[key].points);
|
|
svg.setPoints(dataLocal.svgs[key].points);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
if (dataLocal.lines) {
|
|
if (dataLocal.lines) {
|
|
for (let key in dataLocal.lines) {
|
|
for (let key in dataLocal.lines) {
|
|
- let line = lineService.createByPointId(
|
|
|
|
- dataLocal.lines[key].startId,
|
|
|
|
- dataLocal.lines[key].endId,
|
|
|
|
- dataLocal.lines[key].category,
|
|
|
|
- key
|
|
|
|
- );
|
|
|
|
|
|
+ let line = lineService.createByPointId(dataLocal.lines[key].startId, dataLocal.lines[key].endId, dataLocal.lines[key].category, key);
|
|
|
|
|
|
if (dataLocal.lines[key].style) {
|
|
if (dataLocal.lines[key].style) {
|
|
line.setStyle(dataLocal.lines[key].style);
|
|
line.setStyle(dataLocal.lines[key].style);
|
|
@@ -176,10 +155,7 @@ export default class Load {
|
|
if (dataLocal.curvePoints) {
|
|
if (dataLocal.curvePoints) {
|
|
for (let key in dataLocal.curvePoints) {
|
|
for (let key in dataLocal.curvePoints) {
|
|
let curvePointData = dataLocal.curvePoints[key];
|
|
let curvePointData = dataLocal.curvePoints[key];
|
|
- let curvePoint = curvePointService.create(
|
|
|
|
- curvePointData,
|
|
|
|
- curvePointData.vectorId
|
|
|
|
- );
|
|
|
|
|
|
+ let curvePoint = curvePointService.create(curvePointData, curvePointData.vectorId);
|
|
curvePoint.setIndex(curvePointData.index);
|
|
curvePoint.setIndex(curvePointData.index);
|
|
curvePoint.setPointParent(curvePointData.parent);
|
|
curvePoint.setPointParent(curvePointData.parent);
|
|
dataService.addCurvePoint(curvePoint);
|
|
dataService.addCurvePoint(curvePoint);
|
|
@@ -189,10 +165,7 @@ export default class Load {
|
|
if (dataLocal.curvelines) {
|
|
if (dataLocal.curvelines) {
|
|
for (let key in dataLocal.curvelines) {
|
|
for (let key in dataLocal.curvelines) {
|
|
let curveLineData = dataLocal.curvelines[key];
|
|
let curveLineData = dataLocal.curvelines[key];
|
|
- let curveLine = lineService.createCurveLineByPointIds(
|
|
|
|
- curveLineData.points,
|
|
|
|
- curveLineData.vectorId
|
|
|
|
- );
|
|
|
|
|
|
+ let curveLine = lineService.createCurveLineByPointIds(curveLineData.points, curveLineData.vectorId);
|
|
curveLine.setStyle(curveLineData.style);
|
|
curveLine.setStyle(curveLineData.style);
|
|
curveLine.setWeight(curveLineData.weight);
|
|
curveLine.setWeight(curveLineData.weight);
|
|
dataService.addCurveLine(curveLine);
|
|
dataService.addCurveLine(curveLine);
|
|
@@ -202,10 +175,7 @@ export default class Load {
|
|
if (dataLocal.roadPoints) {
|
|
if (dataLocal.roadPoints) {
|
|
for (let key in dataLocal.roadPoints) {
|
|
for (let key in dataLocal.roadPoints) {
|
|
let roadPointData = dataLocal.roadPoints[key];
|
|
let roadPointData = dataLocal.roadPoints[key];
|
|
- let roadPoint = roadPointService.create(
|
|
|
|
- dataLocal.roadPoints[key],
|
|
|
|
- dataLocal.roadPoints[key].vectorId
|
|
|
|
- );
|
|
|
|
|
|
+ let roadPoint = roadPointService.create(dataLocal.roadPoints[key], dataLocal.roadPoints[key].vectorId);
|
|
roadPoint.parent = JSON.parse(JSON.stringify(roadPointData.parent));
|
|
roadPoint.parent = JSON.parse(JSON.stringify(roadPointData.parent));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -213,22 +183,12 @@ export default class Load {
|
|
if (dataLocal.roads) {
|
|
if (dataLocal.roads) {
|
|
for (let key in dataLocal.roads) {
|
|
for (let key in dataLocal.roads) {
|
|
uiService.setWayType(dataLocal.roads[key].way);
|
|
uiService.setWayType(dataLocal.roads[key].way);
|
|
- uiService.setSingleRoadDrivewayCount(
|
|
|
|
- dataLocal.roads[key].singleRoadDrivewayCount
|
|
|
|
- );
|
|
|
|
- uiService.setRoadLeftDrivewayCount(
|
|
|
|
- dataLocal.roads[key].leftDrivewayCount
|
|
|
|
- );
|
|
|
|
- uiService.setRoadRightDrivewayCount(
|
|
|
|
- dataLocal.roads[key].rightDrivewayCount
|
|
|
|
- );
|
|
|
|
- let road = new Road(
|
|
|
|
- dataLocal.roads[key].startId,
|
|
|
|
- dataLocal.roads[key].endId,
|
|
|
|
- dataLocal.roads[key].vectorId
|
|
|
|
- );
|
|
|
|
|
|
+ uiService.setSingleRoadDrivewayCount(dataLocal.roads[key].singleRoadDrivewayCount);
|
|
|
|
+ uiService.setRoadLeftDrivewayCount(dataLocal.roads[key].leftDrivewayCount);
|
|
|
|
+ uiService.setRoadRightDrivewayCount(dataLocal.roads[key].rightDrivewayCount);
|
|
|
|
+ let road = new Road(dataLocal.roads[key].startId, dataLocal.roads[key].endId, dataLocal.roads[key].vectorId);
|
|
dataService.addRoad(road);
|
|
dataService.addRoad(road);
|
|
-
|
|
|
|
|
|
+
|
|
road.setWidth(dataLocal.roads[key].leftWidth, "left");
|
|
road.setWidth(dataLocal.roads[key].leftWidth, "left");
|
|
road.setWidth(dataLocal.roads[key].rightWidth, "right");
|
|
road.setWidth(dataLocal.roads[key].rightWidth, "right");
|
|
road.setWidth(dataLocal.roads[key].singleRoadWidth);
|
|
road.setWidth(dataLocal.roads[key].singleRoadWidth);
|
|
@@ -238,26 +198,19 @@ export default class Load {
|
|
road.setLeftLanes(dataLocal.roads[key].leftLanes);
|
|
road.setLeftLanes(dataLocal.roads[key].leftLanes);
|
|
road.setRightLanes(dataLocal.roads[key].rightLanes);
|
|
road.setRightLanes(dataLocal.roads[key].rightLanes);
|
|
road.setSingleLanes(dataLocal.roads[key].singleLanes);
|
|
road.setSingleLanes(dataLocal.roads[key].singleLanes);
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
if (dataLocal.roadEdges) {
|
|
if (dataLocal.roadEdges) {
|
|
//当roadEdge有样式的时候需要设置
|
|
//当roadEdge有样式的时候需要设置
|
|
- let roads = []
|
|
|
|
|
|
+ let roads = [];
|
|
for (let edgeKey in dataLocal.roadEdges) {
|
|
for (let edgeKey in dataLocal.roadEdges) {
|
|
let edge = dataLocal.roadEdges[edgeKey];
|
|
let edge = dataLocal.roadEdges[edgeKey];
|
|
-
|
|
|
|
- if(!roads.includes(edge.parent)){
|
|
|
|
- roads.push(edge.parent)
|
|
|
|
|
|
+
|
|
|
|
+ if (!roads.includes(edge.parent)) {
|
|
|
|
+ roads.push(edge.parent);
|
|
}
|
|
}
|
|
- let newEdge = edgeService.create(
|
|
|
|
- edge.start,
|
|
|
|
- edge.end,
|
|
|
|
- edge.vectorId,
|
|
|
|
- edge.parent
|
|
|
|
- );
|
|
|
|
|
|
+ let newEdge = edgeService.create(edge.start, edge.end, edge.vectorId, edge.parent);
|
|
|
|
|
|
if (edge.style) {
|
|
if (edge.style) {
|
|
newEdge.setStyle(edge.style);
|
|
newEdge.setStyle(edge.style);
|
|
@@ -265,28 +218,23 @@ export default class Load {
|
|
if (edge.weight) {
|
|
if (edge.weight) {
|
|
newEdge.setWeight(edge.weight);
|
|
newEdge.setWeight(edge.weight);
|
|
}
|
|
}
|
|
-
|
|
|
|
- if(edge.roadSide){
|
|
|
|
- newEdge.setRoadSide(edge.roadSide)
|
|
|
|
|
|
+
|
|
|
|
+ if (edge.roadSide) {
|
|
|
|
+ newEdge.setRoadSide(edge.roadSide);
|
|
}
|
|
}
|
|
newEdge.setLineWidth(edge.lineWidth);
|
|
newEdge.setLineWidth(edge.lineWidth);
|
|
newEdge.setParent(edge.parent);
|
|
newEdge.setParent(edge.parent);
|
|
-
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
- for(let i=0;i<roads.length;i++){
|
|
|
|
|
|
+
|
|
|
|
+ for (let i = 0; i < roads.length; i++) {
|
|
let road = dataService.getRoad(roads[i]);
|
|
let road = dataService.getRoad(roads[i]);
|
|
roadService.initRoadWidthTipsPos(road);
|
|
roadService.initRoadWidthTipsPos(road);
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
if (dataLocal.curveRoadPoints) {
|
|
if (dataLocal.curveRoadPoints) {
|
|
for (let key in dataLocal.curveRoadPoints) {
|
|
for (let key in dataLocal.curveRoadPoints) {
|
|
- let curveRoadPoint = curveRoadPointService.create(
|
|
|
|
- dataLocal.curveRoadPoints[key],
|
|
|
|
- dataLocal.curveRoadPoints[key].vectorId
|
|
|
|
- );
|
|
|
|
|
|
+ let curveRoadPoint = curveRoadPointService.create(dataLocal.curveRoadPoints[key], dataLocal.curveRoadPoints[key].vectorId);
|
|
curveRoadPoint.setIndex(dataLocal.curveRoadPoints[key].index);
|
|
curveRoadPoint.setIndex(dataLocal.curveRoadPoints[key].index);
|
|
curveRoadPoint.setParent(dataLocal.curveRoadPoints[key].parent);
|
|
curveRoadPoint.setParent(dataLocal.curveRoadPoints[key].parent);
|
|
}
|
|
}
|
|
@@ -295,18 +243,12 @@ export default class Load {
|
|
if (dataLocal.curveRoadEdges) {
|
|
if (dataLocal.curveRoadEdges) {
|
|
for (let key in dataLocal.curveRoadEdges) {
|
|
for (let key in dataLocal.curveRoadEdges) {
|
|
let curveRoadEdgeData = dataLocal.curveRoadEdges[key];
|
|
let curveRoadEdgeData = dataLocal.curveRoadEdges[key];
|
|
- let curveRoadEdge = curveEdgeService.create(
|
|
|
|
- curveRoadEdgeData.start,
|
|
|
|
- curveRoadEdgeData.end,
|
|
|
|
- curveRoadEdgeData.vectorId,
|
|
|
|
- curveRoadEdgeData.parentId,
|
|
|
|
- curveRoadEdgeData.points
|
|
|
|
- );
|
|
|
|
|
|
+ let curveRoadEdge = curveEdgeService.create(curveRoadEdgeData.start, curveRoadEdgeData.end, curveRoadEdgeData.vectorId, curveRoadEdgeData.parentId, curveRoadEdgeData.points);
|
|
curveRoadEdge.setStyle(curveRoadEdgeData.style);
|
|
curveRoadEdge.setStyle(curveRoadEdgeData.style);
|
|
curveRoadEdge.setWeight(curveRoadEdgeData.weight);
|
|
curveRoadEdge.setWeight(curveRoadEdgeData.weight);
|
|
curveRoadEdge.setParent(curveRoadEdgeData.parent);
|
|
curveRoadEdge.setParent(curveRoadEdgeData.parent);
|
|
- if(curveRoadEdgeData.roadSide){
|
|
|
|
- curveRoadEdge.setCurveRoadSideWidth(curveRoadEdgeData.roadSide)
|
|
|
|
|
|
+ if (curveRoadEdgeData.roadSide) {
|
|
|
|
+ curveRoadEdge.setCurveRoadSideWidth(curveRoadEdgeData.roadSide);
|
|
}
|
|
}
|
|
curveEdgeService.setCurves(curveRoadEdge);
|
|
curveEdgeService.setCurves(curveRoadEdge);
|
|
}
|
|
}
|
|
@@ -315,11 +257,7 @@ export default class Load {
|
|
if (dataLocal.curveRoads) {
|
|
if (dataLocal.curveRoads) {
|
|
for (let key in dataLocal.curveRoads) {
|
|
for (let key in dataLocal.curveRoads) {
|
|
let curveRoadData = dataLocal.curveRoads[key];
|
|
let curveRoadData = dataLocal.curveRoads[key];
|
|
- let curveRoad = new CurveRoad(
|
|
|
|
- curveRoadData.startId,
|
|
|
|
- curveRoadData.endId,
|
|
|
|
- curveRoadData.vectorId
|
|
|
|
- );
|
|
|
|
|
|
+ let curveRoad = new CurveRoad(curveRoadData.startId, curveRoadData.endId, curveRoadData.vectorId);
|
|
dataService.addCurveRoad(curveRoad);
|
|
dataService.addCurveRoad(curveRoad);
|
|
|
|
|
|
curveRoad.leftEdgeId = curveRoadData.leftEdgeId;
|
|
curveRoad.leftEdgeId = curveRoadData.leftEdgeId;
|
|
@@ -327,41 +265,24 @@ export default class Load {
|
|
|
|
|
|
curveRoad.points = [];
|
|
curveRoad.points = [];
|
|
for (let i = 0; i < curveRoadData.points.length; ++i) {
|
|
for (let i = 0; i < curveRoadData.points.length; ++i) {
|
|
- curveRoad.points[i] = dataService.getCurveRoadPoint(
|
|
|
|
- curveRoadData.points[i].vectorId
|
|
|
|
- );
|
|
|
|
|
|
+ curveRoad.points[i] = dataService.getCurveRoadPoint(curveRoadData.points[i].vectorId);
|
|
}
|
|
}
|
|
|
|
|
|
curveRoad.curves = JSON.parse(JSON.stringify(curveRoadData.curves));
|
|
curveRoad.curves = JSON.parse(JSON.stringify(curveRoadData.curves));
|
|
curveRoad.way = curveRoadData.way;
|
|
curveRoad.way = curveRoadData.way;
|
|
curveRoad.singleCurveRoadWidth = curveRoadData.singleCurveRoadWidth;
|
|
curveRoad.singleCurveRoadWidth = curveRoadData.singleCurveRoadWidth;
|
|
- curveRoad.singleCurveRoadDrivewayCount =
|
|
|
|
- curveRoadData.singleCurveRoadDrivewayCount;
|
|
|
|
- curveRoad.singleLanesCurves = JSON.parse(
|
|
|
|
- JSON.stringify(curveRoadData.singleLanesCurves)
|
|
|
|
- );
|
|
|
|
- curveRoad.singleLanesCurves = JSON.parse(
|
|
|
|
- JSON.stringify(curveRoadData.singleLanes)
|
|
|
|
- );
|
|
|
|
|
|
+ curveRoad.singleCurveRoadDrivewayCount = curveRoadData.singleCurveRoadDrivewayCount;
|
|
|
|
+ curveRoad.singleLanesCurves = JSON.parse(JSON.stringify(curveRoadData.singleLanesCurves));
|
|
|
|
+ curveRoad.singleLanesCurves = JSON.parse(JSON.stringify(curveRoadData.singleLanes));
|
|
curveRoad.leftWidth = curveRoadData.leftWidth;
|
|
curveRoad.leftWidth = curveRoadData.leftWidth;
|
|
curveRoad.rightWidth = curveRoadData.rightWidth;
|
|
curveRoad.rightWidth = curveRoadData.rightWidth;
|
|
curveRoad.leftDrivewayCount = curveRoadData.leftDrivewayCount;
|
|
curveRoad.leftDrivewayCount = curveRoadData.leftDrivewayCount;
|
|
curveRoad.rightDrivewayCount = curveRoadData.rightDrivewayCount;
|
|
curveRoad.rightDrivewayCount = curveRoadData.rightDrivewayCount;
|
|
- curveRoad.midDivide = JSON.parse(
|
|
|
|
- JSON.stringify(curveRoadData.midDivide)
|
|
|
|
- );
|
|
|
|
- curveRoad.leftLanesCurves = JSON.parse(
|
|
|
|
- JSON.stringify(curveRoadData.leftLanesCurves)
|
|
|
|
- );
|
|
|
|
- curveRoad.rightLanesCurves = JSON.parse(
|
|
|
|
- JSON.stringify(curveRoadData.rightLanesCurves)
|
|
|
|
- );
|
|
|
|
- curveRoad.leftLanes = JSON.parse(
|
|
|
|
- JSON.stringify(curveRoadData.leftLanes)
|
|
|
|
- );
|
|
|
|
- curveRoad.rightLanes = JSON.parse(
|
|
|
|
- JSON.stringify(curveRoadData.rightLanes)
|
|
|
|
- );
|
|
|
|
|
|
+ curveRoad.midDivide = JSON.parse(JSON.stringify(curveRoadData.midDivide));
|
|
|
|
+ curveRoad.leftLanesCurves = JSON.parse(JSON.stringify(curveRoadData.leftLanesCurves));
|
|
|
|
+ curveRoad.rightLanesCurves = JSON.parse(JSON.stringify(curveRoadData.rightLanesCurves));
|
|
|
|
+ curveRoad.leftLanes = JSON.parse(JSON.stringify(curveRoadData.leftLanes));
|
|
|
|
+ curveRoad.rightLanes = JSON.parse(JSON.stringify(curveRoadData.rightLanes));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -377,9 +298,7 @@ export default class Load {
|
|
crossPointData.vectorId
|
|
crossPointData.vectorId
|
|
);
|
|
);
|
|
crossPoint.curves = JSON.parse(JSON.stringify(crossPointData.curves));
|
|
crossPoint.curves = JSON.parse(JSON.stringify(crossPointData.curves));
|
|
- crossPoint.extremePoint = JSON.parse(
|
|
|
|
- JSON.stringify(crossPointData.extremePoint)
|
|
|
|
- );
|
|
|
|
|
|
+ crossPoint.extremePoint = JSON.parse(JSON.stringify(crossPointData.extremePoint));
|
|
crossPoint.style = crossPointData.style;
|
|
crossPoint.style = crossPointData.style;
|
|
crossPoint.weight = crossPointData.weight;
|
|
crossPoint.weight = crossPointData.weight;
|
|
dataService.addCrossPoint(crossPoint);
|
|
dataService.addCrossPoint(crossPoint);
|
|
@@ -407,10 +326,7 @@ export default class Load {
|
|
}
|
|
}
|
|
} else if (data3d) {
|
|
} else if (data3d) {
|
|
if (data3d.backImage) {
|
|
if (data3d.backImage) {
|
|
- let bgImg = imageService.createBackgroundImg(
|
|
|
|
- data3d.backImage,
|
|
|
|
- data3d.vectorId
|
|
|
|
- );
|
|
|
|
|
|
+ let bgImg = imageService.createBackgroundImg(data3d.backImage, data3d.vectorId);
|
|
bgImg.setCenter(coordinate.center);
|
|
bgImg.setCenter(coordinate.center);
|
|
try {
|
|
try {
|
|
if (bgImg.src) {
|
|
if (bgImg.src) {
|
|
@@ -425,16 +341,9 @@ export default class Load {
|
|
if (data3d.baseLines) {
|
|
if (data3d.baseLines) {
|
|
for (let i = 0; i < data3d.baseLines.length; ++i) {
|
|
for (let i = 0; i < data3d.baseLines.length; ++i) {
|
|
//理论上基准线只能有一条
|
|
//理论上基准线只能有一条
|
|
- let baseLine = lineService.create(
|
|
|
|
- this.getXY(width, height, data3d.baseLines[i][0]),
|
|
|
|
- this.getXY(width, height, data3d.baseLines[i][1]),
|
|
|
|
- VectorCategory.Line.BaseLine
|
|
|
|
- );
|
|
|
|
|
|
+ let baseLine = lineService.create(this.getXY(width, height, data3d.baseLines[i][0]), this.getXY(width, height, data3d.baseLines[i][1]), VectorCategory.Line.BaseLine);
|
|
Settings.baseLineId = baseLine.vectorId;
|
|
Settings.baseLineId = baseLine.vectorId;
|
|
- const geometryBaseLine = mathUtil.createLine1(
|
|
|
|
- dataService.getPoint(baseLine.startId),
|
|
|
|
- dataService.getPoint(baseLine.endId)
|
|
|
|
- );
|
|
|
|
|
|
+ const geometryBaseLine = mathUtil.createLine1(dataService.getPoint(baseLine.startId), dataService.getPoint(baseLine.endId));
|
|
//文字要和基准线的方向一致
|
|
//文字要和基准线的方向一致
|
|
if (typeof geometryBaseLine.a != "undefined") {
|
|
if (typeof geometryBaseLine.a != "undefined") {
|
|
angle = Math.atan(geometryBaseLine.a);
|
|
angle = Math.atan(geometryBaseLine.a);
|
|
@@ -449,11 +358,7 @@ export default class Load {
|
|
for (let i = 0; i < data3d.measures.length; ++i) {
|
|
for (let i = 0; i < data3d.measures.length; ++i) {
|
|
//理论上基准线只能有一条
|
|
//理论上基准线只能有一条
|
|
//
|
|
//
|
|
- const line = lineService.create(
|
|
|
|
- this.getXY(width, height, data3d.measures[i].pos[0]),
|
|
|
|
- this.getXY(width, height, data3d.measures[i].pos[1]),
|
|
|
|
- VectorCategory.Line.MeasureLine
|
|
|
|
- );
|
|
|
|
|
|
+ const line = lineService.create(this.getXY(width, height, data3d.measures[i].pos[0]), this.getXY(width, height, data3d.measures[i].pos[1]), VectorCategory.Line.MeasureLine);
|
|
if (line && data3d.measures[i].dis) {
|
|
if (line && data3d.measures[i].dis) {
|
|
line.value = data3d.measures[i].dis;
|
|
line.value = data3d.measures[i].dis;
|
|
}
|
|
}
|
|
@@ -461,21 +366,15 @@ export default class Load {
|
|
}
|
|
}
|
|
if (data3d.basePoints) {
|
|
if (data3d.basePoints) {
|
|
for (let i = 0; i < data3d.basePoints.length; ++i) {
|
|
for (let i = 0; i < data3d.basePoints.length; ++i) {
|
|
- let point = pointService.create(
|
|
|
|
- this.getXY(width, height, data3d.basePoints[i])
|
|
|
|
- );
|
|
|
|
|
|
+ let point = pointService.create(this.getXY(width, height, data3d.basePoints[i]));
|
|
point.setCategory(VectorCategory.Point.BasePoint);
|
|
point.setCategory(VectorCategory.Point.BasePoint);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (data3d.fixPoints) {
|
|
if (data3d.fixPoints) {
|
|
for (let i = 0; i < data3d.fixPoints.length; ++i) {
|
|
for (let i = 0; i < data3d.fixPoints.length; ++i) {
|
|
- let point = pointService.create(
|
|
|
|
- this.getXY(width, height, data3d.fixPoints[i].pos)
|
|
|
|
- );
|
|
|
|
|
|
+ let point = pointService.create(this.getXY(width, height, data3d.fixPoints[i].pos));
|
|
point.setCategory(VectorCategory.Point.FixPoint);
|
|
point.setCategory(VectorCategory.Point.FixPoint);
|
|
- let text = textService.create(
|
|
|
|
- this.getXY(width, height, data3d.fixPoints[i].pos)
|
|
|
|
- );
|
|
|
|
|
|
+ let text = textService.create(this.getXY(width, height, data3d.fixPoints[i].pos));
|
|
text.setValue(data3d.fixPoints[i].text);
|
|
text.setValue(data3d.fixPoints[i].text);
|
|
// text.setAngle(angle);
|
|
// text.setAngle(angle);
|
|
// text.setDisplayPoint(true);
|
|
// text.setDisplayPoint(true);
|
|
@@ -486,15 +385,9 @@ export default class Load {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- uiService.setRoadMidDivideWidth(
|
|
|
|
- Constant.defaultMidDivideWidth / coordinate.res
|
|
|
|
- );
|
|
|
|
- uiService.setCurveRoadMidDivideWidth(
|
|
|
|
- Constant.defaultMidDivideWidth / coordinate.res
|
|
|
|
- );
|
|
|
|
- uiService.setSingleLaneWidth(
|
|
|
|
- Constant.defaultSingleLaneWidth / coordinate.res
|
|
|
|
- );
|
|
|
|
|
|
+ uiService.setRoadMidDivideWidth(Constant.defaultMidDivideWidth / coordinate.res);
|
|
|
|
+ uiService.setCurveRoadMidDivideWidth(Constant.defaultMidDivideWidth / coordinate.res);
|
|
|
|
+ uiService.setSingleLaneWidth(Constant.defaultSingleLaneWidth / coordinate.res);
|
|
|
|
|
|
if (Settings.baseLineId) {
|
|
if (Settings.baseLineId) {
|
|
this.layer.updateForLocation();
|
|
this.layer.updateForLocation();
|
|
@@ -505,8 +398,8 @@ export default class Load {
|
|
|
|
|
|
getXY(width, height, position) {
|
|
getXY(width, height, position) {
|
|
const point = {};
|
|
const point = {};
|
|
- point.x = (position.x - width / 2) * coordinate.ratio;
|
|
|
|
- point.y = (height / 2 - position.y) * coordinate.ratio;
|
|
|
|
|
|
+ point.x = (position.x - width / coordinate.ratio / 2) * coordinate.ratio;
|
|
|
|
+ point.y = (height / coordinate.ratio / 2 - position.y) * coordinate.ratio;
|
|
return point;
|
|
return point;
|
|
}
|
|
}
|
|
|
|
|