mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
fix: map sources not being loaded correctly in static version
This commit is contained in:
@@ -35,8 +35,11 @@ export function Header() {
|
|||||||
MapOptionsChangedEvent.on((mapOptions) => setMapOptions({ ...mapOptions }));
|
MapOptionsChangedEvent.on((mapOptions) => setMapOptions({ ...mapOptions }));
|
||||||
MapSourceChangedEvent.on((source) => setMapSource(source));
|
MapSourceChangedEvent.on((source) => setMapSource(source));
|
||||||
ConfigLoadedEvent.on((config: OlympusConfig) => {
|
ConfigLoadedEvent.on((config: OlympusConfig) => {
|
||||||
var sources = Object.keys(getApp().getMap().getMirrors()).concat(getApp().getMap().getLayers());
|
// Timeout needed to make sure the map configuration has updated
|
||||||
setMapSources(sources);
|
window.setTimeout(() => {
|
||||||
|
var sources = Object.keys(getApp().getMap().getMirrors()).concat(getApp().getMap().getLayers());
|
||||||
|
setMapSources(sources);
|
||||||
|
}, 200);
|
||||||
});
|
});
|
||||||
CommandModeOptionsChangedEvent.on((commandModeOptions) => {
|
CommandModeOptionsChangedEvent.on((commandModeOptions) => {
|
||||||
setCommandModeOptions(commandModeOptions);
|
setCommandModeOptions(commandModeOptions);
|
||||||
@@ -116,7 +119,9 @@ export function Header() {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div
|
<div
|
||||||
className="cursor-pointer rounded-full bg-blue-500 px-4 py-2 text-white"
|
className={`
|
||||||
|
cursor-pointer rounded-full bg-blue-500 px-4 py-2 text-white
|
||||||
|
`}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
getApp().getMap().setOption("tabletMode", !mapOptions.tabletMode);
|
getApp().getMap().setOption("tabletMode", !mapOptions.tabletMode);
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user