Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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:

<Placemark>
<Name>TEST</Name>
<Polygon><outerBoundaryIs><LinearRing><coordinates>//Some coordinates\\</coordinates></LinearRing></outerBoundaryIs></Polygon>
</Placemark>

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

share|improve this question

2 Answers 2

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

 
discard

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.