[OpenLayers-Dev] handler missunderstanding....

Eric Lemoine eric.c2c at gmail.com
Thu Dec 6 15:13:20 EST 2007


> I've been studying the handlers and panel classes and I though I understood
> that if I passed a "done" parameter with a function as a handlerOption it
> would be inserted as a callback when that handler fires.

No, you need to pass a "callbacks" option to the control. Something like that:

crt = new OpenLayers.Control.DrawFeature(vlayer, OpenLayers.Handler.Path, {
    'displayClass': 'olControlMeasure',
    'callbacks': {
        'done': function() { alert('done'); },
        'cancel': function() { alert('cancel'); },
        'point': function() { alert('point'); }
    }
});

Cheers,

--
Eric

>
>
>
> I've attached a simple example of how I understood it to work, could someone
> point out what I've done wrong, as it simple doesn't work.
>
>
>
> Thanks,
>
>
>
> John
>
>
> No virus found in this outgoing message.
>  Checked by AVG Free Edition.
>  Version: 7.5.503 / Virus Database: 269.16.15/1174 - Release Date: 12/6/2007
> 10:11 AM
>
>
>  This email and any files transmitted with it are confidential and intended
> solely for the use of the individual or entity to whom they are addressed.
> If you have received this email in error please notify the sender. This
> message contains confidential information and is intended only for the
> individual named. If you are not the named addressee you should not
> disseminate, distribute or copy this e-mail.
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev
>
>



More information about the Dev mailing list