forked from MapComplete/MapComplete
Remove obsolete class, add cache timeout
This commit is contained in:
parent
2a73c43a5f
commit
14e96094c2
2 changed files with 2 additions and 84 deletions
|
@ -237,7 +237,8 @@ export default class ThemeViewState implements SpecialVisualizationState {
|
||||||
fs.layer.layerDef.id,
|
fs.layer.layerDef.id,
|
||||||
15,
|
15,
|
||||||
fs,
|
fs,
|
||||||
this.featureProperties
|
this.featureProperties,
|
||||||
|
fs.layer.layerDef.maxAgeOfCache
|
||||||
)
|
)
|
||||||
|
|
||||||
const doShowLayer = this.mapProperties.zoom.map(
|
const doShowLayer = this.mapProperties.zoom.map(
|
||||||
|
|
|
@ -1,83 +0,0 @@
|
||||||
import { UIEventSource } from "../../Logic/UIEventSource"
|
|
||||||
import BaseUIElement from "../BaseUIElement"
|
|
||||||
import { SubtleButton } from "../Base/SubtleButton"
|
|
||||||
import Combine from "../Base/Combine"
|
|
||||||
import Translations from "../i18n/Translations"
|
|
||||||
import Svg from "../../Svg"
|
|
||||||
import Toggle from "../Input/Toggle"
|
|
||||||
import { PresetInfo } from "../BigComponents/SimpleAddUI"
|
|
||||||
import { VariableUiElement } from "../Base/VariableUIElement"
|
|
||||||
import { Tag } from "../../Logic/Tags/Tag"
|
|
||||||
import { WayId } from "../../Models/OsmFeature"
|
|
||||||
import { Translation } from "../i18n/Translation"
|
|
||||||
import { SpecialVisualizationState } from "../SpecialVisualization"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
export default class ConfirmLocationOfPoint extends Combine {
|
|
||||||
constructor(
|
|
||||||
state: SpecialVisualizationState,
|
|
||||||
filterViewIsOpened: UIEventSource<boolean>,
|
|
||||||
preset: PresetInfo,
|
|
||||||
confirmText: BaseUIElement,
|
|
||||||
loc: { lon: number; lat: number },
|
|
||||||
confirm: (
|
|
||||||
tags: any[],
|
|
||||||
location: { lat: number; lon: number },
|
|
||||||
snapOntoWayId: WayId | undefined
|
|
||||||
) => void,
|
|
||||||
cancel: () => void,
|
|
||||||
closePopup: () => void,
|
|
||||||
options?: {
|
|
||||||
cancelIcon: BaseUIElement
|
|
||||||
cancelText?: string | Translation
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
let confirmButton: BaseUIElement = new SubtleButton(
|
|
||||||
preset.icon(),
|
|
||||||
new Combine([confirmText]).SetClass("flex flex-col")
|
|
||||||
)
|
|
||||||
.SetClass("font-bold break-words")
|
|
||||||
.onClick(() => {
|
|
||||||
const globalFilterTagsToAdd: Tag[][] = state.globalFilters.data
|
|
||||||
.filter((gf) => gf.onNewPoint !== undefined)
|
|
||||||
.map((gf) => gf.onNewPoint.tags)
|
|
||||||
const globalTags: Tag[] = [].concat(...globalFilterTagsToAdd)
|
|
||||||
console.log("Global tags to add are: ", globalTags)
|
|
||||||
})
|
|
||||||
|
|
||||||
confirmButton = new Combine([confirmButton])
|
|
||||||
|
|
||||||
let openLayerOrConfirm = confirmButton
|
|
||||||
|
|
||||||
// We assume the number of global filters won't change during the run of the program
|
|
||||||
for (let i = 0; i < state.globalFilters.data.length; i++) {
|
|
||||||
const hasBeenCheckedOf = new UIEventSource(false)
|
|
||||||
|
|
||||||
const filterConfirmPanel = new VariableUiElement(
|
|
||||||
state.globalFilters.map((gfs) => {
|
|
||||||
const gf = gfs[i]
|
|
||||||
const confirm = gf.onNewPoint?.confirmAddNew?.Subs({ preset: preset.title })
|
|
||||||
return new Combine([
|
|
||||||
gf.onNewPoint?.safetyCheck,
|
|
||||||
new SubtleButton(Svg.confirm_svg(), confirm).onClick(() =>
|
|
||||||
hasBeenCheckedOf.setData(true)
|
|
||||||
),
|
|
||||||
])
|
|
||||||
})
|
|
||||||
)
|
|
||||||
|
|
||||||
openLayerOrConfirm = new Toggle(
|
|
||||||
openLayerOrConfirm,
|
|
||||||
filterConfirmPanel,
|
|
||||||
state.globalFilters.map(
|
|
||||||
(f) => hasBeenCheckedOf.data || f[i]?.onNewPoint === undefined,
|
|
||||||
[hasBeenCheckedOf]
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
super([openLayerOrConfirm])
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue