Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
properties: {
m49: '001',
wikidata: 'Q2',
nameEn: 'World',
id: '001',
area: 510072000
},
geometry: {
type: 'Polygon',
coordinates: [[[-180, -90], [-180, 90], [180, 90], [180, -90], [-180, -90]]]
}
}
return { type: 'countrycoder', feature: world }
} else {
let feature = CountryCoder.aggregateFeature(location);
if (feature) {
feature.properties = feature.properties || {};
if (!feature.properties.area) { // ensure area property
const area = calcArea.geometry(feature.geometry) / 1e6; // m² to km²
feature.properties.area = Number(area.toFixed(2));
}
return { type: 'countrycoder', feature: feature };
} else {
return null;
}
}
}
}