2020-07-31 17:11:44 +02:00
|
|
|
import {LayerDefinition} from "./LayerDefinition";
|
|
|
|
import {Layout} from "./Layout";
|
2020-07-31 17:38:03 +02:00
|
|
|
import {All} from "./Layouts/All";
|
|
|
|
import {Groen} from "./Layouts/Groen";
|
|
|
|
import Cyclofix from "./Layouts/Cyclofix";
|
|
|
|
import {StreetWidth} from "./Layouts/StreetWidth";
|
2020-07-31 17:11:44 +02:00
|
|
|
import {GRB} from "./Layouts/GRB";
|
2020-07-31 17:38:03 +02:00
|
|
|
import {ClimbingTrees} from "./Layouts/ClimbingTrees";
|
|
|
|
import {Smoothness} from "./Layouts/Smoothness";
|
2020-07-31 17:11:44 +02:00
|
|
|
import {MetaMap} from "./Layouts/MetaMap";
|
2020-07-31 17:38:03 +02:00
|
|
|
import {Natuurpunt} from "./Layouts/Natuurpunt";
|
2020-07-31 18:27:40 +02:00
|
|
|
import {GhostBikes} from "./Layouts/GhostBikes";
|
2020-08-17 17:23:15 +02:00
|
|
|
import {CustomLayoutFromJSON} from "./JSON/CustomLayoutFromJSON";
|
2020-08-22 02:12:46 +02:00
|
|
|
import * as bookcases from "../assets/themes/bookcases/Bookcases.json";
|
|
|
|
import * as aed from "../assets/themes/aed/aed.json";
|
2020-08-22 16:00:33 +02:00
|
|
|
import * as toilets from "../assets/themes/toilets/toilets.json";
|
2020-08-25 02:12:26 +02:00
|
|
|
import * as artworks from "../assets/themes/artwork/artwork.json";
|
2020-08-27 18:44:16 +02:00
|
|
|
import * as cyclestreets from "../assets/themes/cyclestreets/cyclestreets.json";
|
2020-08-26 15:36:04 +02:00
|
|
|
import {PersonalLayout} from "../Logic/PersonalLayout";
|
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[] = [
|
2020-08-26 15:36:04 +02:00
|
|
|
new PersonalLayout(),
|
2020-08-07 20:50:46 +02:00
|
|
|
new Natuurpunt(),
|
2020-07-31 04:58:58 +02:00
|
|
|
new GRB(),
|
|
|
|
new Cyclofix(),
|
2020-07-31 18:27:40 +02:00
|
|
|
new GhostBikes(),
|
2020-08-17 17:23:15 +02:00
|
|
|
CustomLayoutFromJSON.LayoutFromJSON(bookcases),
|
2020-08-22 02:12:46 +02:00
|
|
|
CustomLayoutFromJSON.LayoutFromJSON(aed),
|
2020-08-22 16:00:33 +02:00
|
|
|
CustomLayoutFromJSON.LayoutFromJSON(toilets),
|
2020-08-25 02:12:26 +02:00
|
|
|
CustomLayoutFromJSON.LayoutFromJSON(artworks),
|
2020-08-27 18:44:16 +02:00
|
|
|
CustomLayoutFromJSON.LayoutFromJSON(cyclestreets),
|
2020-08-22 02:12:46 +02:00
|
|
|
|
2020-07-31 04:58:58 +02:00
|
|
|
new MetaMap(),
|
|
|
|
new StreetWidth(),
|
|
|
|
new ClimbingTrees(),
|
|
|
|
new Smoothness(),
|
2020-08-07 20:50:46 +02:00
|
|
|
new Groen(),
|
2020-08-22 03:15:42 +02:00
|
|
|
|
2020-07-31 04:58:58 +02:00
|
|
|
];
|
2020-08-17 17:23:15 +02:00
|
|
|
|
2020-07-31 04:58:58 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
2020-08-17 17:23:15 +02:00
|
|
|
|
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-08-28 03:16:21 +02:00
|
|
|
this.allLayers[layer.id.toLowerCase()] = 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-08-28 03:16:21 +02:00
|
|
|
allSets[layout.name.toLowerCase()] = layout;
|
2020-07-05 18:59:47 +02:00
|
|
|
}
|
2020-07-31 04:58:58 +02:00
|
|
|
allSets[all.name] = all;
|
2020-07-05 18:59:47 +02:00
|
|
|
return allSets;
|
|
|
|
}
|
2020-07-15 15:55:08 +02:00
|
|
|
|
2020-07-05 18:59:47 +02:00
|
|
|
}
|