|
@@ -54,7 +54,7 @@ export class DataService {
|
|
|
//基准点
|
|
|
this.vectorData.basePointIds = [];
|
|
|
this.vectorData.texts = {};
|
|
|
- this.vectorData.SVGs = {};
|
|
|
+ this.vectorData.svgs = {};
|
|
|
this.vectorData.magnifiers = {};
|
|
|
}
|
|
|
|
|
@@ -133,41 +133,10 @@ export class DataService {
|
|
|
this.vectorData.points[point.vectorId] = point;
|
|
|
}
|
|
|
|
|
|
- // deletePoint(pointId) {
|
|
|
- // delete this.vectorData.points[pointId];
|
|
|
- // }
|
|
|
-
|
|
|
- deletePoint(pointId, lineId) {
|
|
|
- let point = this.getPoint(pointId);
|
|
|
- //有可能先删除墙,导致点没了
|
|
|
- if (point) {
|
|
|
- if (Object.keys(point.parent).length == 0) {
|
|
|
- point = null;
|
|
|
- delete this.vectorData.points[pointId];
|
|
|
- } else if (Object.keys(point.parent).length == 1 && !lineId) {
|
|
|
- delete this.vectorData.points[pointId];
|
|
|
- } else if (
|
|
|
- Object.keys(point.parent).length == 1 &&
|
|
|
- point.parent[lineId]
|
|
|
- ) {
|
|
|
- delete this.vectorData.points[pointId];
|
|
|
- } else if (
|
|
|
- Object.keys(point.parent).length == 1 &&
|
|
|
- !point.parent[lineId]
|
|
|
- ) {
|
|
|
- return;
|
|
|
- } else {
|
|
|
- delete point.parent[lineId];
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
deletePoint(pointId) {
|
|
|
- const point = dataService.getRoadPoint(pointId);
|
|
|
- const parent = point.parent;
|
|
|
- for (const key in parent) {
|
|
|
- dataService.deleteRoadPoint(pointId, key);
|
|
|
- }
|
|
|
+ let point = this.getPoint(pointId);
|
|
|
+ delete this.vectorData.points[pointId];
|
|
|
+ point = null;
|
|
|
}
|
|
|
|
|
|
//圆圈
|
|
@@ -489,19 +458,19 @@ export class DataService {
|
|
|
|
|
|
//处理从svg转换来的图标
|
|
|
addSVG(SVG) {
|
|
|
- this.vectorData.SVGs[SVG.vectorId] = SVG;
|
|
|
+ this.vectorData.svgs[SVG.vectorId] = SVG;
|
|
|
}
|
|
|
|
|
|
getSVG(SVGId) {
|
|
|
- return this.vectorData.SVGs[SVGId];
|
|
|
+ return this.vectorData.svgs[SVGId];
|
|
|
}
|
|
|
|
|
|
deleteSVG(SVGId) {
|
|
|
- delete this.vectorData.SVGs[SVGId];
|
|
|
+ delete this.vectorData.svgs[SVGId];
|
|
|
}
|
|
|
|
|
|
getSVGs() {
|
|
|
- return this.vectorData.SVGs;
|
|
|
+ return this.vectorData.svgs;
|
|
|
}
|
|
|
|
|
|
clear() {
|
|
@@ -525,7 +494,7 @@ export class DataService {
|
|
|
//基准点
|
|
|
this.vectorData.basePointIds = [];
|
|
|
this.vectorData.texts = {};
|
|
|
- this.vectorData.SVGs = {};
|
|
|
+ this.vectorData.svgs = {};
|
|
|
this.vectorData.magnifiers = {};
|
|
|
}
|
|
|
}
|