src/sidebar/Sidebar.js
// Function that takes in all kinds of GeoJSON/JSON map data and cleans it.
Function that takes in all kinds of GeoJSON/JSON map data and cleans it.
Function that takes in all kinds of GeoJSON / JSON map data and cleans it .
function clean_data(new_geojson) {
  if (new_geojson.type == 'Polygon') {
    var geojson = {"type":"FeatureCollection","features":[{"type": "Feature", "properties": {},  "geometry": { "type": "Polygon", "coordinates": new_geojson.coordinates }}]};
    return geojson
  } else if (new_geojson.type == 'MultiPolygon') {
      return geojsonMultiPolygonToPolygon(new_geojson)
  } else if (new_geojson.type == 'Point') {
    var circle = turf.circle(new_geojson.coordinates, 2)
    var geojson = {"type":"FeatureCollection","features": circle };
    return geojson
  }
}
function clean_data ( new_geojson ) { if ( new_geojson . type == 'Polygon' ) { var geojson = { "type" : "FeatureCollection" , "features" : [ { "type" : "Feature" , "properties" : { } , "geometry" : { "type" : "Polygon" , "coordinates" : new_geojson . coordinates } } ] } ; return geojson } else if ( new_geojson . type == 'MultiPolygon' ) { return geojsonMultiPolygonToPolygon ( new_geojson ) } else if ( new_geojson . type == 'Point' ) { var circle = turf . circle ( new_geojson . coordinates , 2 ) var geojson = { "type" : "FeatureCollection" , "features" : circle } ; return geojson } }
Function that takes in all kinds of GeoJSON/JSON map data and cleans it.
Function that takes in all kinds of GeoJSON / JSON map data and cleans it .