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. Regards, Andreas. -- Andreas Hocevar OpenGeo - http://opengeo.org/ Expert service straight from the developers. _______________________________________________ Dev mailing list Dev@openlayers.org http://openlayers.org/mailman/listinfo/dev