[GIS] Accessing geojson properties using OpenLayers3

geojsonopenlayers

Is it possible to access geojson properties using the OpenLayers library? I tried to search for it but couldn't find any proper answer.
According to my research, the library converts each geojson feature to ol.Feature which doesn't provide any access to the properties.

For eg:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "type": "Point",
        "coordinates": [102.0, 0.6]
      },
      "properties": {
        "prop0": "value0"
      }
    }
}

How can I access prop0 using the openlayers library?

Best Answer

Please use:

feature.get("prop0")