Adding map default view option to the map context menu.

This commit is contained in:
Roland 2026-04-04 14:56:25 -06:00
parent b8a532c8d9
commit bbc23dbf90
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
5 changed files with 79 additions and 6 deletions

View file

@ -317,6 +317,7 @@ export async function getSettings() {
ignore_outdated_zims: content.ignore_outdated_zims,
ignored_directories: content.ignored_directories,
log_level: content.log_level,
map_default_location: content.map_default_location,
map_destination: content.map_destination,
nav_color: content.nav_color,
media_directory: content.media_directory,
@ -1568,6 +1569,17 @@ export async function updateMapPin(pinId, label, color) {
}
}
export async function setMapDefaultLocation(lat, lon, zoom) {
try {
await updateConfig('wrolpi.yaml', {map_default_location: {lat, lon, zoom}});
toast({type: 'success', title: 'Default Location', description: 'Default map location saved', time: 3000});
return true;
} catch (e) {
toast({type: 'error', title: 'Map Error', description: 'Could not set default location', time: 5000});
return false;
}
}
export async function clearCompletedDownloads() {
const response = await apiPost(`${API_URI}/download/clear_completed`);
if (!response.ok) {