Fix dissapearing attribution, fix toggle behaviour

This commit is contained in:
pietervdvn 2021-07-28 18:20:59 +02:00
parent ba84fd4a8d
commit ae21e33077
2 changed files with 10 additions and 6 deletions

View file

@ -50,6 +50,8 @@ export class Basemap {
} }
previousLayer = newLayer; previousLayer = newLayer;
self.map.addLayer(newLayer); self.map.addLayer(newLayer);
extraAttribution.AttachTo('leaflet-attribution')
}) })

View file

@ -27,19 +27,20 @@ export default class LeftControls extends Combine {
const copyrightButton = new Toggle( const copyrightButton = new Toggle(
toggledCopyright, toggledCopyright,
new MapControlButton(Svg.copyright_svg()), new MapControlButton(Svg.copyright_svg())
.onClick(() => toggledCopyright.isShown.setData(true)),
toggledCopyright.isShown toggledCopyright.isShown
) )
.ToggleOnClick()
.SetClass("p-0.5"); .SetClass("p-0.5");
const toggledDownload = new Toggle( const toggledDownload = new Toggle(
new AllDownloads( new AllDownloads(
State.state.downloadControlIsOpened State.state.downloadControlIsOpened
).SetClass("block p-1 rounded-full"), ).SetClass("block p-1 rounded-full"),
new MapControlButton(Svg.download_svg()), new MapControlButton(Svg.download_svg())
.onClick(() => State.state.downloadControlIsOpened.setData(true)),
State.state.downloadControlIsOpened State.state.downloadControlIsOpened
).ToggleOnClick(); )
const downloadButtonn = new Toggle( const downloadButtonn = new Toggle(
toggledDownload, toggledDownload,
@ -59,9 +60,10 @@ export default class LeftControls extends Combine {
undefined, undefined,
State.state.filterIsOpened State.state.filterIsOpened
), ),
new MapControlButton(Svg.filter_svg()), new MapControlButton(Svg.filter_svg())
.onClick(() => State.state.filterIsOpened.setData(true)),
State.state.filterIsOpened State.state.filterIsOpened
).ToggleOnClick(); )
const filterButton = new Toggle( const filterButton = new Toggle(
toggledFilter, toggledFilter,