[GIS] How get the attributes list from a feature in OpenLayers 3

fields-attributesopenlayers

I'm getting a vector layer from a WMS server, but I don't know which fields are included in it. In previous version feature object had a attributes collection but I can't find it now.

Is there a way of searching for feature attributes?

Right now I can use Feature.get('Name') and can get the value, but only if I know 'Name' is an attribute. Now imagine I do find a [Name] field or something similar.

Is possible do a getFeaturesByAttribute('Name', strName);

Also available in previous version. But can't find it in OpenLayers 3.

Best Answer

getKeys() or getProperties() should be what you are looking for.