1

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

2

Call this method for deactivate control:

control.deactivate();

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.