Add custom theme for advanced users

This commit is contained in:
Pieter Vander Vennet 2020-07-31 04:58:58 +02:00
parent 004eead4ee
commit 9c42839f01
44 changed files with 635 additions and 326 deletions

View file

@ -11,55 +11,53 @@ import {StreetWidth} from "./Layouts/StreetWidth";
import {Natuurpunt} from "./Layouts/Natuurpunt";
import {ClimbingTrees} from "./Layouts/ClimbingTrees";
import {Smoothness} from "./Layouts/Smoothness";
import {LayerDefinition} from "./LayerDefinition";
import {CustomLayers} from "../Logic/CustomLayers";
export class AllKnownLayouts {
public static allSets = AllKnownLayouts.AllLayouts();
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();
private static AllLayouts(): Map<string, Layout> {
const layouts: Layout[] = [
new Groen(),
new GRB(),
new Cyclofix(),
new Bookcases(),
new WalkByBrussels(),
new MetaMap(),
new StreetWidth(),
new Natuurpunt(),
new ClimbingTrees(),
new Artworks(),
new Smoothness()
/*new Toilets(),
*/
];
const all = new All();
const knownKeys = []
for (const layout of layouts) {
this.allLayers = new Map<string, LayerDefinition>();
for (const layout of this.layoutsList) {
for (const layer of layout.layers) {
const key = layer.overpassFilter.asOverpass().join("");
if (knownKeys.indexOf(key) >= 0) {
const key = layer.id;
if (this.allLayers[layer.id] !== undefined) {
continue;
}
knownKeys.push(key);
this.allLayers[layer.id] = layer;
all.layers.push(layer);
}
}
layouts.push(all)
const allSets: Map<string, Layout> = new Map();
for (const layout of layouts) {
for (const layout of this.layoutsList) {
allSets[layout.name] = layout;
}
allSets[all.name] = all;
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;
}
}