add cityCoords

params for city chnaged
add 'center city' in settings
This commit is contained in:
2023-11-28 15:15:03 +00:00
parent e3bf5855ab
commit 74fec075be
11 changed files with 66 additions and 37 deletions
+12 -1
View File
@@ -207,7 +207,7 @@ export const getCurrentTab = () => {
}
export const fetchfromserver = async (url) => {
const ret = await fetch(url)
const ret = await fetch(encodeURI(url))
.catch(e => {
showError(e)
});
@@ -225,3 +225,14 @@ export const addAddress = async (sid) => {
return "no address"
}
}
export const cityCoords = async (city) => {
let url = `/srv/getcitycoords?city=${city}`
let erg = await fetchfromserver(url)
if (!erg.err) {
return erg.coords
} else {
return "no coordinates"
}
}