forked from MapComplete/MapComplete
Add control on FilteredLayer to show/hide layers
This commit is contained in:
parent
5aa620440a
commit
45351d9dd1
4 changed files with 43 additions and 16 deletions
6
index.ts
6
index.ts
|
@ -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();
|
Loading…
Add table
Add a link
Reference in a new issue