|
@@ -512,7 +512,10 @@ export default class Layer {
|
|
case LayerEvents.AddRoad:
|
|
case LayerEvents.AddRoad:
|
|
needAutoRedraw = true;
|
|
needAutoRedraw = true;
|
|
listenLayer.start(position);
|
|
listenLayer.start(position);
|
|
- if (listenLayer.modifyPoint) {
|
|
|
|
|
|
+ if (
|
|
|
|
+ listenLayer.modifyPoint &&
|
|
|
|
+ listenLayer.modifyPoint.hasOwnProperty("x")
|
|
|
|
+ ) {
|
|
position = {
|
|
position = {
|
|
x: listenLayer.modifyPoint.x,
|
|
x: listenLayer.modifyPoint.x,
|
|
y: listenLayer.modifyPoint.y,
|
|
y: listenLayer.modifyPoint.y,
|
|
@@ -527,7 +530,10 @@ export default class Layer {
|
|
case LayerEvents.AddLine:
|
|
case LayerEvents.AddLine:
|
|
needAutoRedraw = true;
|
|
needAutoRedraw = true;
|
|
listenLayer.start(position);
|
|
listenLayer.start(position);
|
|
- if (listenLayer.modifyPoint) {
|
|
|
|
|
|
+ if (
|
|
|
|
+ listenLayer.modifyPoint &&
|
|
|
|
+ listenLayer.modifyPoint.hasOwnProperty("x")
|
|
|
|
+ ) {
|
|
position = {
|
|
position = {
|
|
x: listenLayer.modifyPoint.x,
|
|
x: listenLayer.modifyPoint.x,
|
|
y: listenLayer.modifyPoint.y,
|
|
y: listenLayer.modifyPoint.y,
|
|
@@ -541,7 +547,10 @@ export default class Layer {
|
|
case LayerEvents.AddCurveLine:
|
|
case LayerEvents.AddCurveLine:
|
|
needAutoRedraw = true;
|
|
needAutoRedraw = true;
|
|
listenLayer.start(position);
|
|
listenLayer.start(position);
|
|
- if (listenLayer.modifyPoint) {
|
|
|
|
|
|
+ if (
|
|
|
|
+ listenLayer.modifyPoint &&
|
|
|
|
+ listenLayer.modifyPoint.hasOwnProperty("x")
|
|
|
|
+ ) {
|
|
position = {
|
|
position = {
|
|
x: listenLayer.modifyPoint.x,
|
|
x: listenLayer.modifyPoint.x,
|
|
y: listenLayer.modifyPoint.y,
|
|
y: listenLayer.modifyPoint.y,
|
|
@@ -555,7 +564,10 @@ export default class Layer {
|
|
case LayerEvents.AddCircle:
|
|
case LayerEvents.AddCircle:
|
|
needAutoRedraw = true;
|
|
needAutoRedraw = true;
|
|
listenLayer.start(position);
|
|
listenLayer.start(position);
|
|
- if (listenLayer.modifyPoint) {
|
|
|
|
|
|
+ if (
|
|
|
|
+ listenLayer.modifyPoint &&
|
|
|
|
+ listenLayer.modifyPoint.hasOwnProperty("x")
|
|
|
|
+ ) {
|
|
position = {
|
|
position = {
|
|
x: listenLayer.modifyPoint.x,
|
|
x: listenLayer.modifyPoint.x,
|
|
y: listenLayer.modifyPoint.y,
|
|
y: listenLayer.modifyPoint.y,
|
|
@@ -577,7 +589,10 @@ export default class Layer {
|
|
// addRoad.startInfo.linkedRoadPointId
|
|
// addRoad.startInfo.linkedRoadPointId
|
|
// });
|
|
// });
|
|
|
|
|
|
- if (listenLayer.modifyPoint) {
|
|
|
|
|
|
+ if (
|
|
|
|
+ listenLayer.modifyPoint &&
|
|
|
|
+ listenLayer.modifyPoint.hasOwnProperty("x")
|
|
|
|
+ ) {
|
|
position = {
|
|
position = {
|
|
x: listenLayer.modifyPoint.x,
|
|
x: listenLayer.modifyPoint.x,
|
|
y: listenLayer.modifyPoint.y,
|
|
y: listenLayer.modifyPoint.y,
|
|
@@ -619,7 +634,10 @@ export default class Layer {
|
|
exceptLineIds: exceptLineId,
|
|
exceptLineIds: exceptLineId,
|
|
exceptPointId: exceptPointId,
|
|
exceptPointId: exceptPointId,
|
|
});
|
|
});
|
|
- if (listenLayer.modifyPoint) {
|
|
|
|
|
|
+ if (
|
|
|
|
+ listenLayer.modifyPoint &&
|
|
|
|
+ listenLayer.modifyPoint.hasOwnProperty("x")
|
|
|
|
+ ) {
|
|
position = {
|
|
position = {
|
|
x: listenLayer.modifyPoint.x,
|
|
x: listenLayer.modifyPoint.x,
|
|
y: listenLayer.modifyPoint.y,
|
|
y: listenLayer.modifyPoint.y,
|
|
@@ -649,7 +667,10 @@ export default class Layer {
|
|
exceptCurveLineId: exceptCurveLineId,
|
|
exceptCurveLineId: exceptCurveLineId,
|
|
exceptCurvePointId: exceptCurvePointId,
|
|
exceptCurvePointId: exceptCurvePointId,
|
|
});
|
|
});
|
|
- if (listenLayer.modifyPoint) {
|
|
|
|
|
|
+ if (
|
|
|
|
+ listenLayer.modifyPoint &&
|
|
|
|
+ listenLayer.modifyPoint.hasOwnProperty("x")
|
|
|
|
+ ) {
|
|
position = {
|
|
position = {
|
|
x: listenLayer.modifyPoint.x,
|
|
x: listenLayer.modifyPoint.x,
|
|
y: listenLayer.modifyPoint.y,
|
|
y: listenLayer.modifyPoint.y,
|
|
@@ -674,7 +695,10 @@ export default class Layer {
|
|
exceptCircleId = addCircle.newCircle.vectorId;
|
|
exceptCircleId = addCircle.newCircle.vectorId;
|
|
}
|
|
}
|
|
listenLayer.start(position, { exceptCircleId: exceptCircleId });
|
|
listenLayer.start(position, { exceptCircleId: exceptCircleId });
|
|
- if (listenLayer.modifyPoint) {
|
|
|
|
|
|
+ if (
|
|
|
|
+ listenLayer.modifyPoint &&
|
|
|
|
+ listenLayer.modifyPoint.hasOwnProperty("x")
|
|
|
|
+ ) {
|
|
position = {
|
|
position = {
|
|
x: listenLayer.modifyPoint.x,
|
|
x: listenLayer.modifyPoint.x,
|
|
y: listenLayer.modifyPoint.y,
|
|
y: listenLayer.modifyPoint.y,
|
|
@@ -744,7 +768,10 @@ export default class Layer {
|
|
case LayerEvents.AddCurveRoad:
|
|
case LayerEvents.AddCurveRoad:
|
|
needAutoRedraw = true;
|
|
needAutoRedraw = true;
|
|
listenLayer.start(position);
|
|
listenLayer.start(position);
|
|
- if (listenLayer.modifyPoint) {
|
|
|
|
|
|
+ if (
|
|
|
|
+ listenLayer.modifyPoint &&
|
|
|
|
+ listenLayer.modifyPoint.hasOwnProperty("x")
|
|
|
|
+ ) {
|
|
position = {
|
|
position = {
|
|
x: listenLayer.modifyPoint.x,
|
|
x: listenLayer.modifyPoint.x,
|
|
y: listenLayer.modifyPoint.y,
|
|
y: listenLayer.modifyPoint.y,
|
|
@@ -758,7 +785,10 @@ export default class Layer {
|
|
case LayerEvents.AddingCurveRoad:
|
|
case LayerEvents.AddingCurveRoad:
|
|
needAutoRedraw = true;
|
|
needAutoRedraw = true;
|
|
listenLayer.start(position);
|
|
listenLayer.start(position);
|
|
- if (listenLayer.modifyPoint) {
|
|
|
|
|
|
+ if (
|
|
|
|
+ listenLayer.modifyPoint &&
|
|
|
|
+ listenLayer.modifyPoint.hasOwnProperty("x")
|
|
|
|
+ ) {
|
|
position = {
|
|
position = {
|
|
x: listenLayer.modifyPoint.x,
|
|
x: listenLayer.modifyPoint.x,
|
|
y: listenLayer.modifyPoint.y,
|
|
y: listenLayer.modifyPoint.y,
|
|
@@ -859,7 +889,6 @@ export default class Layer {
|
|
exceptLineIds: point.parent,
|
|
exceptLineIds: point.parent,
|
|
});
|
|
});
|
|
|
|
|
|
- // if (listenLayer.modifyPoint) { //原本是这样的,不知用途,下面修改为了修复拖动点经过放大镜导致NaN或者错位
|
|
|
|
if (
|
|
if (
|
|
listenLayer.modifyPoint &&
|
|
listenLayer.modifyPoint &&
|
|
listenLayer.modifyPoint.x &&
|
|
listenLayer.modifyPoint.x &&
|
|
@@ -886,7 +915,10 @@ export default class Layer {
|
|
exceptCurvePointId: draggingItem.vectorId,
|
|
exceptCurvePointId: draggingItem.vectorId,
|
|
exceptCurveLineId: curvePoint.parent,
|
|
exceptCurveLineId: curvePoint.parent,
|
|
});
|
|
});
|
|
- if (listenLayer.modifyPoint) {
|
|
|
|
|
|
+ if (
|
|
|
|
+ listenLayer.modifyPoint &&
|
|
|
|
+ listenLayer.modifyPoint.hasOwnProperty("x")
|
|
|
|
+ ) {
|
|
position = {
|
|
position = {
|
|
x: listenLayer.modifyPoint.x,
|
|
x: listenLayer.modifyPoint.x,
|
|
y: listenLayer.modifyPoint.y,
|
|
y: listenLayer.modifyPoint.y,
|