On Saturday, February 6, 2010, Andreas Hocevar <ahoce...@opengeo.org> wrote:
> Eric Lemoine wrote:
>
> On Mon, Jan 11, 2010 at 3:22 PM, Bart van den Eijnden <bart...@osgis.nl> 
> wrote:
>
>
> Hi list,
>
> I am failing to understand the following line in 
> OpenLayers.Control.GetFeature:
>
> maxFeatures: options.single == true ? this.maxFeatures : undefined,
>
> I would expect it to be:
>
> maxFeatures: options.single == true ? 1: this.maxFeatures,
>
> so if we only want a single feature, have it set to 1, otherwise use the 
> maxFeatures given by the application designer.
>
>
>
> I'd make more sense to me too.
>
>
>
> You are looking at this line without the context. There is also:
>
> if(options.single == true) {
>    this.selectBestFeature(result.features,
>    bounds.getCenterLonLat(), options);
> } else {
>    this.select(result.features);
> }
>
> One of the key advantages of the GetFeature control over WMSGetFeature is 
> that it will *always* just return *one single feature* on a click, and this 
> feature will be the *best matching one*. The maxFeatures config option is 
> just about how many features to use to determine the best matching one. Maybe 
> this should be documented better.

Thanks for the explanation Andreas. I also didn't understand that part
of the code. Clear now.



-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com
_______________________________________________
Dev mailing list
Dev@openlayers.org
http://openlayers.org/mailman/listinfo/dev

Reply via email to