chore: automated housekeeping...

This commit is contained in:
Pieter Vander Vennet 2024-11-28 12:00:23 +01:00
parent 8ef7af613f
commit 00151afdea
114 changed files with 2857 additions and 2135 deletions

View file

@ -178,7 +178,7 @@ export default class ThemeViewState implements SpecialVisualizationState {
this.map = new UIEventSource<MlMap>(undefined)
const geolocationState = new GeoLocationState()
const initial = new InitialMapPositioning(layout, geolocationState)
this.mapProperties = new MapLibreAdaptor(this.map, initial, {correctClick: 20})
this.mapProperties = new MapLibreAdaptor(this.map, initial, { correctClick: 20 })
this.featureSwitchIsTesting = this.featureSwitches.featureSwitchIsTesting
this.featureSwitchUserbadge = this.featureSwitches.featureSwitchEnableLogin
@ -557,9 +557,12 @@ export default class ThemeViewState implements SpecialVisualizationState {
})
}
private setSelectedElement(feature: Feature){
private setSelectedElement(feature: Feature) {
const current = this.selectedElement.data
if(current?.properties?.id !== undefined && current.properties.id === feature.properties.id ){
if (
current?.properties?.id !== undefined &&
current.properties.id === feature.properties.id
) {
console.log("Not setting selected, same id", current, feature)
return // already set
}
@ -1002,13 +1005,12 @@ export default class ThemeViewState implements SpecialVisualizationState {
this.userRelatedState.recentlyVisitedSearch.add(r)
})
this.mapProperties.lastClickLocation.addCallbackD(lastClick => {
if(lastClick.mode !== "left" || !lastClick.nearestFeature){
this.mapProperties.lastClickLocation.addCallbackD((lastClick) => {
if (lastClick.mode !== "left" || !lastClick.nearestFeature) {
return
}
const f = lastClick.nearestFeature
this.setSelectedElement(f)
})
this.userRelatedState.showScale.addCallbackAndRun((showScale) => {