I have a control that draw line. What I want is that once the line is drawn the control should be deactivated.

new GeoExt.Action(Ext.apply({
    text: 'Draw Line',
    control: new OpenLayers.Control.DrawFeature(
        this.layer,OpenLayers.Handler.Path, {
        eventListeners: {
            featureadded: this.myFunction,
            scope: this
}, actionDefaults))

myFunction: function(evt) {//Deactivate Control Here }

1 Answer 1


Call this method for deactivate control:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.