Update documentation and allow code to be run while caching

This commit is contained in:
Pieter Vander Vennet 2021-07-23 17:18:30 +02:00
parent e121099562
commit 45631a921f
2 changed files with 5 additions and 2 deletions

View file

@ -6,11 +6,14 @@ export class GeoOperations {
return turf.area(feature); return turf.area(feature);
} }
/**
* Converts a GeoJSon feature to a point feature
* @param feature
*/
static centerpoint(feature: any) { static centerpoint(feature: any) {
const newFeature = turf.center(feature); const newFeature = turf.center(feature);
newFeature.properties = feature.properties; newFeature.properties = feature.properties;
newFeature.id = feature.id; newFeature.id = feature.id;
return newFeature; return newFeature;
} }

View file

@ -83,7 +83,7 @@ export default class SimpleMetaTagger {
}, },
(feature => { (feature => {
const units = State.state.layoutToUse.data.units ?? []; const units = State.state?.layoutToUse?.data?.units ?? [];
for (const key in feature.properties) { for (const key in feature.properties) {
if (!feature.properties.hasOwnProperty(key)) { if (!feature.properties.hasOwnProperty(key)) {
continue; continue;