我已經創建了一個應用程序,該應用程序在iPad/iPhone上查找地理位置座標,但在某些Android設備上未能這樣做,即使設備是GPS功能。它適用於某些Android設備(例如三星Galaxy選項卡SCH-I800),並在某些其他選項(例如Samsung Galaxy選項卡GT-P5113)上失敗。爲什麼我的手機差距應用程序無法在某些Android設備上找到地理位置
任何想法可能是什麼原因的問題?
的示例代碼段:
<script type="text/javascript"
src="http://maps.google.com/maps/api/js?sensor=true"></script>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=true"> </script>
<script type="text/javascript" charset="utf-8" src="phonegap-1.4.1.js"></script>
function onDeviceReady()
{
navigator.geolocation.getCurrentPosition(onSuccess, onError);
}
var onSuccess = function(position) {
pos = new google.maps.LatLng(position.coords.latitude,
position.coords.longitude);
lat=position.coords.latitude;
lng=position.coords.longitude;
alert("lat: "+lat+" long "+lng); //i should get the lat/long here which i need to use further in my code
}
對於其中應用無法正常運行它會ONERROR功能的設備。
function onError(error) {
alert("error code is: "+error.code);//it gives error code 3 when on such devices
}
我已經嘗試使用「enableHighAccuracy」。它不適用於此也。我認爲這個屬性更關係到準確性,而我的問題是我沒有得到任何位置只在這些設備上。 –