Favourites: improve overview, update all features from OSM when loading

This commit is contained in:
Pieter Vander Vennet 2023-12-03 20:03:47 +01:00
parent 35f8b9d8f2
commit 56a23deb2d
10 changed files with 231 additions and 234 deletions

View file

@ -244,12 +244,6 @@ export default class ThemeViewState implements SpecialVisualizationState {
this.dataIsLoading = layoutSource.isLoading
this.indexedFeatures = layoutSource
this.featureProperties = new FeaturePropertiesStore(layoutSource)
this.favourites = new FavouritesFeatureSource(
this.osmConnection,
this.featureProperties,
layoutSource,
layout
)
this.changes = new Changes(
{
@ -333,10 +327,10 @@ export default class ThemeViewState implements SpecialVisualizationState {
return sorted
})
const lastClick = (this.lastClickObject = new LastClickFeatureSource(
this.lastClickObject = new LastClickFeatureSource(
this.mapProperties.lastClickLocation,
this.layout
))
)
this.osmObjectDownloader = new OsmObjectDownloader(
this.osmConnection.Backend(),
@ -359,6 +353,7 @@ export default class ThemeViewState implements SpecialVisualizationState {
this.osmConnection,
this.changes
)
this.favourites = new FavouritesFeatureSource(this)
this.initActors()
this.drawSpecialLayers()
@ -472,6 +467,7 @@ export default class ThemeViewState implements SpecialVisualizationState {
this.selectedLayer.setData(layer)
this.selectedElement.setData(toSelect)
}
private initHotkeys() {
Hotkeys.RegisterHotkey(
{ nomod: "Escape", onUp: true },
@ -483,6 +479,15 @@ export default class ThemeViewState implements SpecialVisualizationState {
}
)
Hotkeys.RegisterHotkey(
{ nomod: "f" },
Translations.t.hotkeyDocumentation.selectFavourites,
() => {
this.guistate.menuViewTab.setData("favourites")
this.guistate.menuIsOpened.setData(true)
}
)
this.mapProperties.lastKeyNavigation.addCallbackAndRunD((_) => {
Hotkeys.RegisterHotkey(
{