Improve LocationGPS by adding speed in behavior
authorLiu, Xin <xinx.liu@intel.com>
Thu, 20 Jun 2013 01:48:38 +0000 (09:48 +0800)
committerwanmingx.lin <wanmingx.lin@intel.com>
Thu, 20 Jun 2013 05:49:46 +0000 (13:49 +0800)
Signed-off-by: Liu, Xin <xinx.liu@intel.com>
tests/LocationGPS/index.html
tests/LocationGPS/js/main.js

index 33732e2..9787874 100755 (executable)
@@ -56,6 +56,9 @@ Authors:
             <div id="longitudeDiv" class="attribute_show">
                Longitude:
             </div>
+            <div id="speedDiv" class="attribute_show">
+               Speed:
+            </div>
             <div id="errormessage"></div>
         </div>
         <div data-role="footer" data-position="fixed">
index fdac923..3658a06 100755 (executable)
@@ -45,6 +45,7 @@ function initialize() {
         textonly: false,
         html: ""
     });
+    DisablePassButton();
     try {
         navigator.geolocation.watchPosition(successCallback, errorCallback, { maximumAge: 60000});
     } catch (err) {
@@ -55,9 +56,11 @@ function initialize() {
 
 function successCallback (position) {
     $.mobile.loading('hide');
+    EnablePassButton();
     var coordinates = position.coords;
     jQuery("#latitudeDiv").html("Latitude: " + coordinates.latitude);
     jQuery("#longitudeDiv").html("Longitude: " + coordinates.longitude);
+    jQuery("#speedDiv").html("Speed: " + coordinates.speed);
 }
 
 function errorCallback (error) {