Refactorization of FiresMap

This commit is contained in:
vjrj 2017-12-12 15:20:03 +01:00
parent 77b56e4169
commit f6453c77d7
8 changed files with 150 additions and 128 deletions

View file

@ -0,0 +1,15 @@
/* global L */
// https://stackoverflow.com/questions/35394577/leaflet-js-union-merge-circles
import union from '@turf/union';
export function unify(polyList) {
let unionTemp;
for (let i = 0; i < polyList.length; i += 1) {
if (i === 0) {
unionTemp = polyList[i].toGeoJSON();
} else {
unionTemp = union(unionTemp, polyList[i].toGeoJSON());
}
}
return L.geoJson(unionTemp);
}