Events on Vector Features

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

Events on Vector Features

Brian Pitts-2
What's the proper way to register events on Vector features? After
reading
http://www.nabble.com/associating-events-to-geometries-tf3426206.html I
put together
http://wilson.library.emory.edu/~mapserver/openlayers/SelectFeatureTest.html , but the callback method I registered is never called. My goal is to execure a method any time a click occurs within a vector feature's geometry.

A snippets from the link:

var callBackControl = new OpenLayers.Control.SelectFeature(vectorLayer,
{callbacks: {'over':doOnHover}});
map.addControl(callBackControl);
callBackControl.activate;

Thanks,
Brian Pitts



_______________________________________________
Users mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Events on Vector Features

Frederic Junod
Hi Brian,

Try the following:
  var callBackControl =
    new OpenLayers.Control.SelectFeature(vectorLayer,
                                         {onSelect: doOnHover,
                                          onUnselect: xxx});
  ...

The onUnselect method is called when the user click an other feature.

Regards,

fréd


Le Thu, 05 Jul 2007 19:02:13 -0400,
Brian Pitts <[hidden email]> a écrit :

> What's the proper way to register events on Vector features? After
> reading
> http://www.nabble.com/associating-events-to-geometries-tf3426206.html
> I put together
> http://wilson.library.emory.edu/~mapserver/openlayers/SelectFeatureTest.html ,
> but the callback method I registered is never called. My goal is to
> execure a method any time a click occurs within a vector feature's
> geometry.
>
> A snippets from the link:
>
> var callBackControl = new
> OpenLayers.Control.SelectFeature(vectorLayer, {callbacks:
> {'over':doOnHover}}); map.addControl(callBackControl);
> callBackControl.activate;
>
> Thanks,
> Brian Pitts
>
>
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://openlayers.org/mailman/listinfo/users


--
Frédéric Junod
Camptocamp SA
_______________________________________________
Users mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/users