Nested objects for geoJSON using Element API I'm trying to create a GeoJSON feed using the Element API plugin but having difficulty creating the nested structure required for the JSON object:

{
  "type": "Feature",
  "geometry": {
    "type": "Point",
    "coordinates": [125.6, 10.1]
  },
  "properties": {
    "name": "Dinagat Islands"
  }
}


I can get a flat json structure using:

...

return [
    "type" =&gt; "Feature",
    "geometry" =&gt; "",
    "properties" =&gt; ""
];

...


My question is, how would I update the above code to create the nested json objects for geometry and properties?

Thanks. G.
I figured this out myself. I needed to use PHP array syntax.

In answer to my own question, the updated code for a nested object would be:

...

return [
    "type" =&gt; "Feature",
    "geometry" =&gt; array("type" =&gt; "Point", "coordinates" =&gt; [125.6, 10.1]),
    "properties" =&gt; array("name" =&gt; "Dinagat Islands")
];

...


Hope this helps someone else as it wasn't immediately apparent to me.