mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-25 09:26:17 -05:00
Adding map default view option to the map context menu.
This commit is contained in:
parent
b8a532c8d9
commit
bbc23dbf90
5 changed files with 79 additions and 6 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue