forked from MapComplete/MapComplete
Add metadata to query, move metatagging of metadata to metatagger, tweaks to the generate caching so that the cached data becomes more stable (and is GIT-friendlier)
This commit is contained in:
parent
591ab349a6
commit
54f01ba554
7 changed files with 129 additions and 66 deletions
|
|
@ -3,6 +3,7 @@ import SimpleMetaTagger from "./SimpleMetaTagger";
|
|||
import {ExtraFunction} from "./ExtraFunction";
|
||||
import State from "../State";
|
||||
import {Relation} from "./Osm/ExtractRelations";
|
||||
import {meta} from "@turf/turf";
|
||||
|
||||
|
||||
interface Params {
|
||||
|
|
@ -23,9 +24,15 @@ export default class MetaTagging {
|
|||
* The features are a list of geojson-features, with a "properties"-field and geometry
|
||||
*/
|
||||
static addMetatags(features: { feature: any; freshness: Date }[],
|
||||
relations: Map<string, { role: string, relation: Relation }[]>, layers: LayerConfig[]) {
|
||||
relations: Map<string, { role: string, relation: Relation }[]>,
|
||||
layers: LayerConfig[],
|
||||
includeDates = true) {
|
||||
|
||||
for (const metatag of SimpleMetaTagger.metatags) {
|
||||
if(metatag.includesDates && !includeDates){
|
||||
// We do not add dated entries
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
metatag.addMetaTags(features);
|
||||
} catch (e) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue