如何添加回调函数getCurrentLocation方法将坐标或位置作为参数传递给全局变量?该对象允许将坐标传递给getCurrentLocation之外的全局变量。地理位置HTML5 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 !
谢谢。