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);
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue