I am using Vector layer.

According to your suggestion, I set a second control with hover and
highlightOnly properties. The second control will be activated when the
regular selectControl has been activated.  However, it makes 'onSelect' for
my regular selectControl does not work. I attached some codes below:

    highlightCtrl = new OpenLayers.Control.SelectFeature(lyRoute, {
    hover: true,
    highlightOnly: true
    });
    map.addControl(highlightCtrl);


    selectControl = new OpenLayers.Control.SelectFeature (
    lyRoute,
    {displayClass: "olControlSelectFeat", title: "Select Feature",
    clickout: false,
    eventListeners:{
    "activate": function(){highlightCtrl.activate();},
    "deactivate": function(){highlightCtrl.deactivate();}},
    onSelect: onFeatureSelect,
    onUnselect: onFeatureUnselect});


The system cannot implement 'onFeatureSelect' function. Do you know why?

Thanks a lot!!

On Sun, Dec 5, 2010 at 3:54 PM, Phil Scadden [via OSGeo.org] <
[email protected]<ml-node%[email protected]>
> wrote:

>
> > Anyone knows how to change the tolerance for selection?
> >
> > I just added a SelectFeature control into my map, but the selection
> > tolerance seems a little low. I cannot implement selection unless where I
>
> > click is extremely close to the feature.
> WMS Layer or vector? With vector layers, its a good idea to have a
> second selectFeature setup with hover to hightlight only set. That way
> it hilights when you are over it, then a click will select. For WMS/WFS,
> use WFS protocol and DWITHIN filter (if your server supports it -
> otherwise BBOX or Intersects) and control the size of the select
> explicitly from that.
> --
> Phil Scadden, Senior Scientist GNS Science Ltd 764 Cumberland St,
> Private Bag 1930, Dunedin, New Zealand Ph +64 3 4799663, fax +64 3 477 5232
>
>
> Notice: This email and any attachments are confidential. If received in
> error please destroy and immediately notify us. Do not copy or disclose the
> contents.
>
> _______________________________________________
> Users mailing list
> [hidden email] <http://user/SendEmail.jtp?type=node&node=5806196&i=0>
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
>
> ------------------------------
>  View message @
> http://osgeo-org.1803224.n2.nabble.com/Tolerance-for-SelectFeature-Control-tp5801201p5806196.html
> To unsubscribe from Tolerance for SelectFeature Control, click 
> here<http://osgeo-org.1803224.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5801201&code=Zy5jLmNoZW4ubWFjQGdtYWlsLmNvbXw1ODAxMjAxfC0yMDM3NzEzNzgy>.
>
>

-- 
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/Tolerance-for-SelectFeature-Control-tp5801201p5809579.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to