mapcomplete/Customizations/AllKnownLayouts.ts

64 lines
1.9 KiB
TypeScript
Raw Normal View History

2020-07-30 09:59:30 +02:00
import {Groen} from "./Layouts/Groen";
import {GRB} from "./Layouts/GRB";
import {Artworks} from "./Layouts/Artworks";
import {Bookcases} from "./Layouts/Bookcases";
2020-07-08 17:12:23 +02:00
import Cyclofix from "./Layouts/Cyclofix";
2020-07-30 09:59:30 +02:00
import {WalkByBrussels} from "./Layouts/WalkByBrussels";
import {All} from "./Layouts/All";
import {Layout} from "./Layout";
2020-07-17 13:27:09 +02:00
import {MetaMap} from "./Layouts/MetaMap";
import {StreetWidth} from "./Layouts/StreetWidth";
import {Natuurpunt} from "./Layouts/Natuurpunt";
2020-07-30 09:59:30 +02:00
import {ClimbingTrees} from "./Layouts/ClimbingTrees";
import {Smoothness} from "./Layouts/Smoothness";
2020-07-31 04:58:58 +02:00
import {LayerDefinition} from "./LayerDefinition";
import {CustomLayers} from "../Logic/CustomLayers";
2020-07-05 18:59:47 +02:00
export class AllKnownLayouts {
2020-07-31 04:58:58 +02:00
public static allLayers: Map<string, LayerDefinition> = undefined;
public static layoutsList: Layout[] = [
new Groen(),
new GRB(),
new Cyclofix(),
new Bookcases(),
new WalkByBrussels(),
new MetaMap(),
new StreetWidth(),
new Natuurpunt(),
new ClimbingTrees(),
new Artworks(),
new Smoothness(),
new CustomLayers()
/*new Toilets(),
*/
];
public static allSets: Map<string, Layout> = AllKnownLayouts.AllLayouts();
2020-07-25 01:07:02 +02:00
2020-07-31 04:58:58 +02:00
private static AllLayouts(): Map<string, Layout> {
2020-07-25 01:07:02 +02:00
const all = new All();
2020-07-31 04:58:58 +02:00
this.allLayers = new Map<string, LayerDefinition>();
for (const layout of this.layoutsList) {
2020-07-25 01:07:02 +02:00
for (const layer of layout.layers) {
2020-07-31 04:58:58 +02:00
const key = layer.id;
if (this.allLayers[layer.id] !== undefined) {
2020-07-25 01:07:02 +02:00
continue;
}
2020-07-31 04:58:58 +02:00
this.allLayers[layer.id] = layer;
2020-07-25 01:07:02 +02:00
all.layers.push(layer);
}
}
2020-07-20 12:39:43 +02:00
const allSets: Map<string, Layout> = new Map();
2020-07-31 04:58:58 +02:00
for (const layout of this.layoutsList) {
2020-07-05 18:59:47 +02:00
allSets[layout.name] = layout;
}
2020-07-31 04:58:58 +02:00
allSets[all.name] = all;
2020-07-05 18:59:47 +02:00
return allSets;
}
2020-07-05 18:59:47 +02:00
}