navigator.geolocation.getCurrentPosition(pos => {
let xhr = new XMLHttpRequest();
xhr.open(
"GET",
`https://geocode-maps.yandex.ru/1.x/?apikey=6792a574-8840-4ac0-8a9f-e6b7d21a5f69&geocode=${pos.coords.longitude},${pos.coords.latitude}&format=json&kind=locality&lang=en-US`
);
xhr.send();
xhr.addEventListener("load", () => {
if (xhr.status == 200) {
console.log(JSON.parse(xhr.response));
}
});
});