mapcomplete/Customizations/AllKnownLayouts.ts

66 lines
2 KiB
TypeScript
Raw Normal View History

2020-07-30 07:59:30 +00:00
import {Groen} from "./Layouts/Groen";
import {GRB} from "./Layouts/GRB";
import {Artworks} from "./Layouts/Artworks";
import {Bookcases} from "./Layouts/Bookcases";
2020-07-08 15:12:23 +00:00
import Cyclofix from "./Layouts/Cyclofix";
2020-07-30 07:59:30 +00:00
import {WalkByBrussels} from "./Layouts/WalkByBrussels";
import {All} from "./Layouts/All";
import {Layout} from "./Layout";
2020-07-17 11:27:09 +00:00
import {MetaMap} from "./Layouts/MetaMap";
import {StreetWidth} from "./Layouts/StreetWidth";
import {Natuurpunt} from "./Layouts/Natuurpunt";
2020-07-30 07:59:30 +00:00
import {ClimbingTrees} from "./Layouts/ClimbingTrees";
import {Smoothness} from "./Layouts/Smoothness";
2020-07-05 16:59:47 +00:00
export class AllKnownLayouts {
2020-07-20 10:39:43 +00:00
public static allSets = AllKnownLayouts.AllLayouts();
2020-07-05 16:59:47 +00:00
2020-07-20 10:39:43 +00:00
private static AllLayouts(): Map<string, Layout> {
2020-07-15 12:03:44 +00:00
const layouts: Layout[] = [
2020-07-05 16:59:47 +00:00
new Groen(),
new GRB(),
2020-07-08 15:12:23 +00:00
new Cyclofix(),
2020-07-12 21:19:05 +00:00
new Bookcases(),
new WalkByBrussels(),
2020-07-17 11:27:09 +00:00
new MetaMap(),
new StreetWidth(),
new Natuurpunt(),
2020-07-30 07:59:30 +00:00
new ClimbingTrees(),
new Artworks(),
new Smoothness()
2020-07-05 16:59:47 +00:00
/*new Toilets(),
2020-07-08 14:07:16 +00:00
*/
2020-07-05 16:59:47 +00:00
];
2020-07-24 23:07:02 +00:00
const all = new All();
2020-07-25 16:00:08 +00:00
const knownKeys = []
2020-07-24 23:07:02 +00:00
for (const layout of layouts) {
for (const layer of layout.layers) {
2020-07-25 16:00:08 +00:00
const key = layer.overpassFilter.asOverpass().join("");
if (knownKeys.indexOf(key) >= 0) {
2020-07-24 23:07:02 +00:00
continue;
}
2020-07-25 16:00:08 +00:00
knownKeys.push(key);
2020-07-24 23:07:02 +00:00
all.layers.push(layer);
}
}
layouts.push(all)
2020-07-20 10:39:43 +00:00
const allSets: Map<string, Layout> = new Map();
2020-07-05 16:59:47 +00:00
for (const layout of layouts) {
allSets[layout.name] = layout;
}
return allSets;
}
public static GetSets(layoutNames): any {
const all = new All();
for (const name of layoutNames) {
all.layers = all.layers.concat(AllKnownLayouts.allSets[name].layers);
}
return all;
}
2020-07-05 16:59:47 +00:00
}