// Пример
const lat = 56.4063789;
const lon = 38.7151217;
[
{
address: 'ул Тестовская, 1',
city: 'Москва',
id: 14766,
latitude: '55.7479019',
longitude: '37.532949'
},
{
address: 'ул 1-я Тверская-Ямская, 2',
city: 'Москва',
id: 12863,
latitude: '55.770302',
longitude: '37.597099'
}
//....
];
const point = { latitude: lat, longtitude: lon };
const closest = arr.reduce((closest, n) => {
const d = sphericalDistance(point, n);
return d < closest[1] ? [ n, d ] : closest;
}, [ null, Infinity ])[0];
function sphericalDistance(p1, p2) {
// https://en.wikipedia.org/wiki/Great-circle_distance
}