1

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.

1

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

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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