我得到(纬度,长)坐标在phonegap地理定位,而没有使用互联网或GPS? [英] I am getting (lat,long) coordinates in phonegap geolocation without using internet or GPS ?
问题描述
当我试过一个示例程序在phonegap地理定位。我得到我的当前位置的纬度和经度没有互联网或GPS在我的三星流行。我不知道当我的设备上的WiFi和GPS是禁用时,它是如何得到当前位置的坐标,高度和时间戳。请帮我..
When i tried out a sample program in phonegap geolocation. I am getting the latitude and longitude of my current location without internet or GPS in my samsung pop. I don't know how it is getting the coordinates, altitude and timestamp of the current location when the wifi and gps in my device is DISABLED. Kindly help me..
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org /TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>My Locator</title>
<script type="text/javascript" charset="utf-8" src="../plugins/phonegap-1.1.0.js"></script>
<script type="text/javascript" charset="utf-8">
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
navigator.geolocation.getCurrentPosition(onSuccess,Error);
}
function onSuccess(position) {
var element = document.getElementById('geolocation');
element.innerHTML = 'Latitude: ' + position.coords.latitude
+ '<br />' + 'Longitude: ' + position.coords.longitude
+ '<br />' + 'Accuracy: ' + position.coords.accuracy
+ '<br />' + 'Timestamp: ' + new Date(position.timestamp) + '<br />';
}
function onError(error) {
alert('code: ' + error.code + '\n' + 'message: ' + error.message + '\n');
}
</script>
</head>
<body>
<p id="geolocation">
Finding geolocation...
</p>
</body>
</html>
推荐答案
位置信息的常见来源包括全球定位系统GPS)和从诸如IP地址,RFID,WiFi和蓝牙MAC地址的网络信号和GSM / CDMA小区ID推断的位置。
"Common sources of location information include Global Positioning System (GPS) and location inferred from network signals such as IP address, RFID, WiFi and Bluetooth MAC addresses, and GSM/CDMA cell IDs."
http://docs.phonegap.com/en/1.7.0/cordova_geolocation_geolocation.md.html#Geolocation
这篇关于我得到(纬度,长)坐标在phonegap地理定位,而没有使用互联网或GPS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!