Feature(hotkeys): add H to jump to home location

This commit is contained in:
Pieter Vander Vennet 2025-02-10 02:47:44 +01:00
parent e66391fc03
commit 2b34547902
2 changed files with 10 additions and 0 deletions

View file

@ -192,6 +192,7 @@
"openOsmcha": "See latest edits made with {theme}", "openOsmcha": "See latest edits made with {theme}",
"openOsmchaLastWeek": "See edits from the last 7 days", "openOsmchaLastWeek": "See edits from the last 7 days",
"openPanoramax": "Open Panoramax here", "openPanoramax": "Open Panoramax here",
"openStatistics": "See statistics for {theme}",
"openThemeDocumentation": "Open the documentation for thematic map {name}", "openThemeDocumentation": "Open the documentation for thematic map {name}",
"panoramaxHelp": "<b>Panoramax</b> is an online service which gathers street-level pictures and offers them under a free license. Contributors are allowed to use these pictures to improve OpenStreetMap", "panoramaxHelp": "<b>Panoramax</b> is an online service which gathers street-level pictures and offers them under a free license. Contributors are allowed to use these pictures to improve OpenStreetMap",
"panoramaxLicenseCCBYSA": "Your pictures are published under CC-BY-SA - everyone can reuse your image if they mention your name", "panoramaxLicenseCCBYSA": "Your pictures are published under CC-BY-SA - everyone can reuse your image if they mention your name",
@ -526,6 +527,7 @@
"action": "Action", "action": "Action",
"closeSidebar": "Close the sidebar", "closeSidebar": "Close the sidebar",
"geolocate": "Pan the map to the current location or zoom the map to the current location. Requests geopermission", "geolocate": "Pan the map to the current location or zoom the map to the current location. Requests geopermission",
"homeLocation": "Jump to your home location. Only works if you did set your home location in the user preferences",
"intro": "MapComplete supports the following keys:", "intro": "MapComplete supports the following keys:",
"key": "Key combination", "key": "Key combination",
"openFilterPanel": "Opens the POI-layers and filter panel", "openFilterPanel": "Opens the POI-layers and filter panel",

View file

@ -225,6 +225,14 @@ export class UserMapFeatureswitchState extends WithUserRelatedState {
this.geolocationControl.handleClick() this.geolocationControl.handleClick()
}) })
Hotkeys.RegisterHotkey({ nomod: "H" }, Translations.t.hotkeyDocumentation.homeLocation, () => {
const home = this.userRelatedState.osmConnection.userDetails.data?.home
if (!home) {
console.log("No home location set")
}
this.mapProperties.location.set(home)
})
Hotkeys.RegisterHotkey( Hotkeys.RegisterHotkey(
{ {
shift: "T", shift: "T",