Add dashboard mode to compiled theme pages

This commit is contained in:
pietervdvn 2022-07-25 16:58:30 +02:00
parent 64d0aac88f
commit bc2f421108

View file

@ -10,9 +10,7 @@ import State from "./State";
import AvailableBaseLayersImplementation from "./Logic/Actors/AvailableBaseLayersImplementation";
import ShowOverlayLayerImplementation from "./UI/ShowDataLayer/ShowOverlayLayerImplementation";
import {DefaultGuiState} from "./UI/DefaultGuiState";
import DashboardGui from "./UI/DashboardGui";
document.getElementById("decoration-desktop").remove();
@ -62,4 +60,10 @@ DefaultGuiState.state = guiState;
// This 'leaks' the global state via the window object, useful for debugging
// @ts-ignore
window.mapcomplete_state = State.state;
new DefaultGUI(State.state, guiState).setup()
const mode = QueryParameters.GetQueryParameter("mode", "map", "The mode the application starts in, e.g. 'map' or 'dashboard'")
if(mode.data === "dashboard"){
new DashboardGui(State.state, guiState).setup()
}else{
new DefaultGUI(State.state, guiState).setup()
}