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() {
|
||||
this.drawLayer.disableSelect();
|
||||
this.drawLayer.disableEdit();
|
||||
this.drawLayer.hide();
|
||||
this.drawVertexLayer.hide();
|
||||
this.hideOtherLayer();
|
||||
|
@ -197,6 +199,8 @@ export default abstract class DrawFeature extends DrawMode {
|
|||
break;
|
||||
case DrawModes.STATIC:
|
||||
this.source.updateFeature(this.currentFeature as Feature);
|
||||
this.selectMode.disable();
|
||||
this.editMode.disable();
|
||||
this.source.clearFeatureActive();
|
||||
this.drawVertexLayer.hide();
|
||||
this.drawVertexLayer.disableEdit();
|
||||
|
@ -218,7 +222,9 @@ export default abstract class DrawFeature extends DrawMode {
|
|||
};
|
||||
|
||||
private onDrawMove = (delta: ILngLat) => {
|
||||
this.moveFeature(delta);
|
||||
if (this.drawStatus === 'DrawSelected') {
|
||||
this.moveFeature(delta);
|
||||
}
|
||||
};
|
||||
|
||||
private onDrawEdit = (endpoint: ILngLat) => {
|
||||
|
@ -231,7 +237,9 @@ export default abstract class DrawFeature extends DrawMode {
|
|||
this.source.removeFeature(this.currentFeature as Feature);
|
||||
this.normalLayer.update(this.source.data);
|
||||
this.drawLayer.disableSelect();
|
||||
this.selectMode.disable();
|
||||
this.currentFeature = null;
|
||||
// this.drawStatus = 'DrawDelete';
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -17,7 +17,8 @@ export type DrawStatus =
|
|||
| 'DrawSelected'
|
||||
| 'DrawEdit'
|
||||
| 'DrawFinish'
|
||||
| 'EditFinish';
|
||||
| 'EditFinish'
|
||||
| 'DrawDelete';
|
||||
|
||||
let DrawFeatureId = 0;
|
||||
|
||||
|
|
Loading…
Reference in New Issue