mapcomplete/src/index_theme.ts.template

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
1.1 KiB
Text
Raw Normal View History

2023-07-16 03:26:43 +02:00
import ThemeViewState from "./src/Models/ThemeViewState"
import SvelteUIElement from "./src/UI/Base/SvelteUIElement"
import ThemeViewGUI from "./src/UI/ThemeViewGUI.svelte"
import LayoutConfig from "./src/Models/ThemeConfig/LayoutConfig";
2023-12-06 12:57:13 +01:00
import MetaTagging from "./src/Logic/MetaTagging";
2023-09-27 22:21:35 +02:00
import { FixedUiElement } from "./src/UI/Base/FixedUiElement";
function webgl_support() {
try {
var canvas = document.createElement("canvas")
return (
!!window.WebGLRenderingContext &&
(canvas.getContext("webgl") || canvas.getContext("experimental-webgl"))
)
} catch (e) {
return false
}
}
if (!webgl_support()) {
new FixedUiElement("WebGL is not supported or not enabled. This is essential for MapComplete to function, please enable this.").SetClass("block alert").AttachTo("maindiv")
}else{
MetaTagging.setThemeMetatagging(new ThemeMetaTagging())
2023-12-06 12:12:53 +01:00
// LAYOUT.ADD_LAYERS
const state = new ThemeViewState(new LayoutConfig(<any> layout))
const main = new SvelteUIElement(ThemeViewGUI, { state })
main.AttachTo("maindiv")
}