0.0.4 • Published 10 years ago
com.vastsoft.cordova.plugin.baiduloc v0.0.4
CordovaGPS
Cordova plugin for Baidu location services. the version is coming soon for IOS.
sample.js
if (window.geolocation) {
window.baiduloc.watchGPS(function(result) {
$("#status").text("status : " + result.status);
if (result.status == "fixed")
$("#gps").text("geolocation : " + result.lng + ", " + result.lat);
else
$("#gps").text("");
}, function(error) {
$("#gps").text("error");
}, {
minTime : 1000,
minDist : 0
});
}
the result.status field could be "searching", "fixed", "disabled", "enabled"
if the result.status equals "fixed", the "result" object will contains other fields below: "lng","lat","alt","accuracy","bearing","speed"
you can use it like : result.lng
sample.html
<div id="status"></div>
<div id="gps"></div>
Contact
Vastsoft
joeradar@vastsoft.com