- attivita

- gestione degli script sul server
 - creato websocket per interagire con gli script del server.
This commit is contained in:
Surya Paolo
2024-08-29 23:31:54 +02:00
parent 79e874e3e0
commit 8f4ff8ff9c
39 changed files with 1373 additions and 303 deletions

View File

@@ -1,3 +1,5 @@
import { tools } from "./tools";
// geocoding.ts
export const getCityFromCoordinates = async (lat: number, lon: number): Promise<string | null> => {
const url = `https://nominatim.openstreetmap.org/reverse?lat=${lat}&lon=${lon}&format=json`;
@@ -17,3 +19,12 @@ export const getCityFromCoordinates = async (lat: number, lon: number): Promise<
}
};
export const getMapBoundaries = (): any => {
const ne = tools.getCookie(tools.COOK_MAPBOUNDS + 'ne', '{"lat": 20, "lng": 30}', false)
const sw = tools.getCookie(tools.COOK_MAPBOUNDS + 'sw', '{"lat": 25, "lng": 35}', false)
// console.log('getMapBoundaries', ne, sw)
return { ne, sw }
};