On Thursday, January 14, 2010, Jtrsmith <jtrsm...@gmail.com> wrote: > > I have a map that is displaying a set of polygons from geojson, when selected > these polygons display a popup which contains attributes from the geojson. > > Is it possible to have a link on the page (not on the map) that will trigger > the selectfeature event? > I would like to have a list of the features to the right of my map and when > selected the map will find the feature, select it, and open the popup. Is > this possible?
yes, the ids of the list elements would match the fids of the features. So when an element is clicked you can look up the corresponding feature and select it. > Also wondering if it is possible to select a feature by using a search field > to search a custom attribute from geojson? OpenLayers reads a GeoJSON FeatureCollection document into an array of feature (OpenLayers.Feature.Vector) objects, with each feature object having an "attributes" property containing the properties of the feature. So once you have this array of features you can do searches. If you have features in a vector layer the array of features is accessible at layer.features. Cheers, -- 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 _______________________________________________ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users