title: Convert JSON Object to geojson array
body: <p>I'm trying to display markers on a Webpage map from a JSON object (initially Firebase).
  Here is my Javascript code , how do I manage with converting JSON Object to geoson array ?</p>
  
  <pre><code>// get character (points) reference from firebase
  var refPOI = '{"-KiWVsBzdJ3EW3THO7bK":{"image":"3","lat":165.440135,"lon":-21.669071},"-KiWY9hLU12ebrlH7cXS":{"image":"5","lat":167.516824,"lon":-22.619914},"-KiWY9hMggrqlTNJMWzU":{"image":"8","lat":166.59579,"lon":-20.718007},"-KiWY9mpKP8gx7i8eGpo":{"image":"8","lat":167.100445,"lon":-20.961233},"-KiWY9oqGSHS_8Sdwpda":{"image":"9","lat":167.818109,"lon":-21.460377},"-KiWYA3hGwTUJGQjYx7O":{"image":"9","lat":165.458005,"lon":-21.770834}}';
  
  var dataPOI = JSON.parse(refPOI);
  
  var arr = [];
  
  for(var x in dataPOI){
  arr.push(dataPOI[x]);
  }
  
  console.log(dataPOI);
  console.log(arr);
  
  var geojson = {
          "type": "FeatureCollection",
          "features": [
          ]
      };
  
  dataPOI.$loaded().then(function(results) {
  
      for(x=0;x&lt;results.length;x++) {
          geojson.features.push({
  
              "type": "Feature",
              "properties": {
                  "message": results[x].points,
                  "image": results[x].image,
                  "iconSize": [50, 50],
                  "id": results[x].$id
              },
              "geometry": {
              "type": "Point",
              "coordinates": [
                  results[x].lat,
                  results[x].lon
                  ]
              }
          });
      }
  })
  </code></pre>