forked from MapComplete/MapComplete
Update documentation and allow code to be run while caching
This commit is contained in:
parent
e121099562
commit
45631a921f
2 changed files with 5 additions and 2 deletions
|
@ -6,11 +6,14 @@ export class GeoOperations {
|
|||
return turf.area(feature);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a GeoJSon feature to a point feature
|
||||
* @param feature
|
||||
*/
|
||||
static centerpoint(feature: any) {
|
||||
const newFeature = turf.center(feature);
|
||||
newFeature.properties = feature.properties;
|
||||
newFeature.id = feature.id;
|
||||
|
||||
return newFeature;
|
||||
}
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ export default class SimpleMetaTagger {
|
|||
|
||||
},
|
||||
(feature => {
|
||||
const units = State.state.layoutToUse.data.units ?? [];
|
||||
const units = State.state?.layoutToUse?.data?.units ?? [];
|
||||
for (const key in feature.properties) {
|
||||
if (!feature.properties.hasOwnProperty(key)) {
|
||||
continue;
|
||||
|
|
Loading…
Reference in a new issue