Tizen系统读取GPS数据的代码
读取(Gear设备)GPS数据function successCallback(position) {
console.log("success " );
console.log("Longitude "
+ position.coords.longitude);
console.log("Latitude" + position.coords.latitude);
}
function errorCallback(error) {
console.log("error " + error.code);
}
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(
successCallback, errorCallback, {
maximumAge : 60000
});
} else {
console.log("Geolocation not suported ");
}
页:
[1]