Browse Source

converted to reduce

pull/1002/head
Stephen Hess 7 years ago
parent
commit
314e7eb450
  1. 10
      helper/geojsonify.js

10
helper/geojsonify.js

@ -105,8 +105,7 @@ function addBBoxPerFeature(geojson) {
* @returns {Array}
*/
function extractExtentPoints(geodata) {
const extentPoints = [];
geodata.forEach(function (place) {
return geodata.reduce((extentPoints, place) => {
if (place.bounding_box) {
extentPoints.push({
lng: place.bounding_box.min_lon,
@ -116,16 +115,19 @@ function extractExtentPoints(geodata) {
lng: place.bounding_box.max_lon,
lat: place.bounding_box.max_lat
});
}
else {
extentPoints.push({
lng: place.lng,
lat: place.lat
});
}
});
}
return extentPoints;
}, []);
}
/**

Loading…
Cancel
Save