mirror of https://gitee.com/antv-l7/antv-l7
Merge pull request #335 from antvis/fix_draw
fix(draw): fix draw rect bug
This commit is contained in:
commit
523500c334
|
@ -92,6 +92,8 @@ export default abstract class DrawFeature extends DrawMode {
|
||||||
}
|
}
|
||||||
|
|
||||||
public clear() {
|
public clear() {
|
||||||
|
this.drawLayer.disableSelect();
|
||||||
|
this.drawLayer.disableEdit();
|
||||||
this.drawLayer.hide();
|
this.drawLayer.hide();
|
||||||
this.drawVertexLayer.hide();
|
this.drawVertexLayer.hide();
|
||||||
this.hideOtherLayer();
|
this.hideOtherLayer();
|
||||||
|
@ -197,6 +199,8 @@ export default abstract class DrawFeature extends DrawMode {
|
||||||
break;
|
break;
|
||||||
case DrawModes.STATIC:
|
case DrawModes.STATIC:
|
||||||
this.source.updateFeature(this.currentFeature as Feature);
|
this.source.updateFeature(this.currentFeature as Feature);
|
||||||
|
this.selectMode.disable();
|
||||||
|
this.editMode.disable();
|
||||||
this.source.clearFeatureActive();
|
this.source.clearFeatureActive();
|
||||||
this.drawVertexLayer.hide();
|
this.drawVertexLayer.hide();
|
||||||
this.drawVertexLayer.disableEdit();
|
this.drawVertexLayer.disableEdit();
|
||||||
|
@ -218,7 +222,9 @@ export default abstract class DrawFeature extends DrawMode {
|
||||||
};
|
};
|
||||||
|
|
||||||
private onDrawMove = (delta: ILngLat) => {
|
private onDrawMove = (delta: ILngLat) => {
|
||||||
this.moveFeature(delta);
|
if (this.drawStatus === 'DrawSelected') {
|
||||||
|
this.moveFeature(delta);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private onDrawEdit = (endpoint: ILngLat) => {
|
private onDrawEdit = (endpoint: ILngLat) => {
|
||||||
|
@ -231,7 +237,9 @@ export default abstract class DrawFeature extends DrawMode {
|
||||||
this.source.removeFeature(this.currentFeature as Feature);
|
this.source.removeFeature(this.currentFeature as Feature);
|
||||||
this.normalLayer.update(this.source.data);
|
this.normalLayer.update(this.source.data);
|
||||||
this.drawLayer.disableSelect();
|
this.drawLayer.disableSelect();
|
||||||
|
this.selectMode.disable();
|
||||||
this.currentFeature = null;
|
this.currentFeature = null;
|
||||||
|
// this.drawStatus = 'DrawDelete';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,8 @@ export type DrawStatus =
|
||||||
| 'DrawSelected'
|
| 'DrawSelected'
|
||||||
| 'DrawEdit'
|
| 'DrawEdit'
|
||||||
| 'DrawFinish'
|
| 'DrawFinish'
|
||||||
| 'EditFinish';
|
| 'EditFinish'
|
||||||
|
| 'DrawDelete';
|
||||||
|
|
||||||
let DrawFeatureId = 0;
|
let DrawFeatureId = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue