handler missunderstanding....

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

handler missunderstanding....

John Cole X

Ok, I need a little help here J

 

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.

 

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
[hidden email]
http://openlayers.org/mailman/listinfo/dev

jwctoolbar.html (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: handler missunderstanding....

Eric Lemoine
> 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
> [hidden email]
> http://openlayers.org/mailman/listinfo/dev
>
>
_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev