1
我試圖做幾個小時,並沒有成功。
我有一個承諾$ cordovaGeolocation返回的經度和緯度非常基本等於ngCordova文檔。
我想知道如何返回我在函數外部的數組中的經度和緯度。
我該怎麼做?
遵循代碼結構。
$cordovaGeolocation.getCurrentPosition().then(function(position) {
var lat = position.coords.latitude;
var long = position.coords.longitude;
alert(lat + " | " + long);
}, function (err) {
console.log("fail");
});
var deviceInfo = {
uuid: uuid,
dataDevice: [
{
model: model
}
]
};
謝謝
誰能幫助? 感謝:D – estevammr