mapcomplete/Customizations/AllKnownLayers.ts

92 lines
4 KiB
TypeScript
Raw Normal View History

2020-10-27 01:01:34 +01:00
import * as drinkingWater from "../assets/layers/drinking_water/drinking_water.json";
import * as ghostbikes from "../assets/layers/ghost_bike/ghost_bike.json"
import * as viewpoint from "../assets/layers/viewpoint/viewpoint.json"
import * as bike_parking from "../assets/layers/bike_parking/bike_parking.json"
import * as bike_repair_station from "../assets/layers/bike_repair_station/bike_repair_station.json"
import * as birdhides from "../assets/layers/bird_hide/birdhides.json"
import * as nature_reserve from "../assets/layers/nature_reserve/nature_reserve.json"
import * as bike_cafes from "../assets/layers/bike_cafe/bike_cafes.json"
import * as bike_monitoring_station from "../assets/layers/bike_monitoring_station/bike_monitoring_station.json"
import * as cycling_themed_objects from "../assets/layers/cycling_themed_object/cycling_themed_objects.json"
import * as bike_shops from "../assets/layers/bike_shop/bike_shop.json"
import * as bike_cleaning from "../assets/layers/bike_cleaning/bike_cleaning.json"
2021-01-05 02:59:29 +01:00
import * as bicycle_library from "../assets/layers/bicycle_library/bicycle_library.json"
2021-01-09 02:11:43 +01:00
import * as bicycle_tube_vending_machine from "../assets/layers/bicycle_tube_vending_machine/bicycle_tube_vending_machine.json"
2020-10-27 01:01:34 +01:00
import * as maps from "../assets/layers/maps/maps.json"
import * as information_boards from "../assets/layers/information_board/information_board.json"
2020-11-17 02:22:48 +01:00
import * as direction from "../assets/layers/direction/direction.json"
2020-11-17 16:29:51 +01:00
import * as surveillance_camera from "../assets/layers/surveillance_cameras/surveillance_cameras.json"
import * as toilets from "../assets/layers/toilets/toilets.json"
2020-11-25 16:10:14 +01:00
import * as bookcases from "../assets/layers/public_bookcases/public_bookcases.json"
import * as tree_nodes from "../assets/layers/trees/tree_nodes.json"
2021-02-26 17:22:24 +01:00
import * as benches from "../assets/layers/benches/benches.json"
import * as benches_at_pt from "../assets/layers/benches/benches_at_pt.json"
import * as picnic_tables from "../assets/layers/benches/picnic_tables.json"
import * as play_forest from "../assets/layers/play_forest/play_forest.json"
import * as playground from "../assets/layers/playground/playground.json"
2021-03-14 03:15:06 +01:00
import * as sport_pitch from "../assets/layers/sport_pitch/sport_pitch.json"
import * as slow_roads from "../assets/layers/slow_roads/slow_roads.json"
2020-10-27 01:01:34 +01:00
import LayerConfig from "./JSON/LayerConfig";
2021-01-06 02:52:38 +01:00
import {LayerConfigJson} from "./JSON/LayerConfigJson";
2020-10-27 01:01:34 +01:00
2021-02-26 17:22:24 +01:00
export default class AllKnownLayers {
2020-10-27 01:01:34 +01:00
2021-01-06 02:52:38 +01:00
private static sharedLayersListRaw : LayerConfigJson[] = [
drinkingWater,
ghostbikes,
viewpoint,
bike_parking,
bike_repair_station,
bike_monitoring_station,
birdhides,
nature_reserve,
bike_cafes,
bicycle_library,
cycling_themed_objects,
bike_shops,
bike_cleaning,
2021-01-09 02:11:43 +01:00
bicycle_tube_vending_machine,
2021-01-06 02:52:38 +01:00
maps,
direction,
information_boards,
toilets,
bookcases,
surveillance_camera,
2021-02-26 17:22:24 +01:00
tree_nodes,
benches,
benches_at_pt,
picnic_tables,
play_forest,
2021-03-14 03:15:06 +01:00
playground,
sport_pitch,
slow_roads
2021-01-06 02:52:38 +01:00
];
// Must be below the list...
2021-02-26 17:22:24 +01:00
public static sharedLayers: Map<string, LayerConfig> = AllKnownLayers.getSharedLayers();
public static sharedLayersJson: Map<string, any> = AllKnownLayers.getSharedLayersJson();
2020-10-27 01:01:34 +01:00
2021-01-06 02:52:38 +01:00
private static getSharedLayers(): Map<string, LayerConfig> {
2020-10-27 01:01:34 +01:00
const sharedLayers = new Map<string, LayerConfig>();
2021-02-26 17:22:24 +01:00
for (const layer of AllKnownLayers.sharedLayersListRaw) {
const parsed = new LayerConfig(layer, "shared_layers")
2021-01-06 02:52:38 +01:00
sharedLayers.set(layer.id, parsed);
sharedLayers[layer.id] = parsed;
}
return sharedLayers;
}
private static getSharedLayersJson(): Map<string, any> {
const sharedLayers = new Map<string, any>();
2021-02-26 17:22:24 +01:00
for (const layer of AllKnownLayers.sharedLayersListRaw) {
2020-10-27 01:01:34 +01:00
sharedLayers.set(layer.id, layer);
sharedLayers[layer.id] = layer;
}
return sharedLayers;
}
2021-01-06 02:52:38 +01:00
}