More work on the editor-layer-index

This commit is contained in:
Pieter Vander Vennet 2020-09-25 23:00:20 +02:00
parent 08175a747f
commit d0641ba409
3 changed files with 341741 additions and 13 deletions

View file

@ -4,6 +4,7 @@ import {DropDown} from "./Input/DropDown";
import Translations from "./i18n/Translations";
import {State} from "../State";
import {UIEventSource} from "../Logic/UIEventSource";
import Combine from "./Base/Combine";
export default class BackgroundSelector extends UIElement {
@ -22,24 +23,19 @@ export default class BackgroundSelector extends UIElement {
private CreateDropDown(available) {
if(available.length === 0){
console.warn("NO AVAILABLE LAYERS")
console.warn("NO LAYERS FOUND!")
return;
}
console.log("ALL LAYERS", available)
const baseLayers: { value: any, shown: string }[] = [];
for (const i in available) {
const layer: { url: string, max_zoom: number, license_url: number, name: string, geometry: any, leafletLayer: any } = available[i];
if (layer.name === undefined) {
continue;
}
baseLayers.push({value: layer.leafletLayer, shown: layer.name});
}
const dropdown = new DropDown(Translations.t.general.backgroundMap, baseLayers, State.state.bm.CurrentLayer)
console.log("Installed dropdown with ",baseLayers);
this._dropdown = dropdown;
}