[OpenLayers-Users] Identify feature by attribute

Jerome A. Wendell jawendell at digitalmapping.com
Tue Jan 8 14:16:28 PST 2013


Greg,

Thank you very much for your reply.  Is there a way to input the feature
identifier, or would that have to be coded in a script?

Thanks,

Jerome Wendell


-----Original Message-----
From: Greg Allensworth [mailto:gregor at greeninfo.org] 
Sent: Tuesday, January 08, 2013 5:10 PM
To: jawendell at digitalmapping.com
Cc: OpenLayers User List
Subject: Re: [OpenLayers-Users] Identify feature by attribute

On 1/8/2013 1:41 PM, Jerome A. Wendell wrote:
> I am new to OpenLayers and web mapping.  I have searched the examples 
> and help, and did not find any information on how to select a vector 
> on a vector layer by attribute.

Assuming you have your Control.SelectFeature already defined and working
with a click, you should be able to use its "select" method to manually feed
it a feature:


/// your Control
clicker = new OpenLayers.Control.SelectFeature(blah blah);

// some arbitrary chosen Feature from the vector layer feature =
VECTORS.features[7];

// have the Select tool select this feature clicker.select(feature);


--
Greg Allensworth, Web GIS Developer
BS  A+  Network+  Security+  Linux+  Server+ GreenInfo Network - Information
and Mapping in the Public Interest
564 Market Street, Suite 510  San Francisco CA 94104
PH: 415-979-0343 x302  FX: 415-979-0371    email: gregor at greeninfo.org
Web: www.GreenInfo.org     www.MapsPortal.org

Subscribe to MapLines, our e-newsletter, at www.GreenInfo.org



More information about the Users mailing list