Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Im using Openlayers, and importing polygon data to the map with KML files.

How could i select the feature which has the attribute name="TEST" ?

KML def:

<Polygon><outerBoundaryIs><LinearRing><coordinates>//Some coordinates\\</coordinates></LinearRing></outerBoundaryIs></Polygon>

Iknow that you can loop trough them to check it. But i was hoping for something more efficient.

share|improve this question
up vote 1 down vote accepted

OpenLayers doesn't provide convenient method for getting features by custom attribute. You can see my implementation of getFeaturesBy method, example.

share|improve this answer

I found another solution to my problem using the preFeatureInsert method. :)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.