Add control on FilteredLayer to show/hide layers

This commit is contained in:
Stanislas Gueniffey 2020-07-15 15:55:08 +02:00
parent 5aa620440a
commit 45351d9dd1
4 changed files with 43 additions and 16 deletions

View file

@ -137,7 +137,7 @@ const bm = new Basemap("leafletDiv", locationControl, new VariableUiElement(
// ------------- Setup the layers -------------------------------
const controls = {};
const addButtons: {
name: string,
icon: string,
@ -168,6 +168,8 @@ for (const layer of questSetToRender.layers) {
const flayer = layer.asLayer(bm, allElements, changes, osmConnection.userDetails, selectedElement,
generateInfo);
controls[layer.name] = flayer.isDisplayed;
const addButton = {
name: layer.name,
icon: layer.icon,
@ -273,4 +275,4 @@ new GeoLocationHandler(bm).AttachTo("geolocate-button");
// --------------- Send a ping to start various action --------
locationControl.ping();
messageBox.update();
messageBox.update();