let coords;
export const AutoLocation = async () => {
if (navigator.geolocation) {
console.log("1 play");
await navigator.geolocation.getCurrentPosition((pos) => {
coords = pos.coords;
console.log("2 play");
});
console.log("3 play");
} else {
console.log(Error);
}
console.log("4 play");
return coords;
};
const position = await new Promise (
(resolve, reject) => navigator.geolocation.getCurrentPosition(
(p) => resolve(p),
(e) => reject(e),
),
);