使用Geolocator使用下面的代碼,我收到以下錯誤錯誤:'管道正在關閉' 在Windows 8地鐵JavaScript應用
the pipe is being closed
和
the wait operation timed out
代碼:
var loc = new Windows.Devices.Geolocation.Geolocator();
loc.getGeopositionAsync().done(function (pos) {
console.log(pos);
});
我在Windows 8模擬器中運行這個,並嘗試使用模擬位置啓用d並禁用。
是什麼導致了這個錯誤,以及使用Geolocator在真實的GPS設備上和模擬器中成功檢索用戶位置的正確方式是什麼?
是的,這個錯誤和我的例子一樣。啓用了定位功能 – Predominant 2012-08-06 01:36:41
哪條線拋出異常?使用W3C地理定位語法?雖然從開發者預覽開始我還沒有嘗試過,但我能夠成功地移植當時使用W3C語法編寫的一些代碼。 – devhammer 2012-08-06 01:55:27
'navigator.geolocation.getCurrentPosition(success,failure);' 'function success(position){' 'console.log('您位於:'+ position.coords.latitude +','+ position.coords .longitude +'!');' '}' – devhammer 2012-08-06 02:02:55