Как добавить функцию обратного вызова в метод getCurrentLocation, передавая координаты или позицию в качестве аргументов глобальной переменной ?. Объекту разрешено передавать координаты глобальной переменной за пределами getCurrentLocation.
//Global scope
var Location= {coords:null;
}
function getLocation(position)
{
position.coords.latitude;
Location.coords=coords.clone();
}
somewhere
navigator.geolocation.getCurrentLocation(getLocation, error)
Location.coords is NULL !
спасибо.