mirror of
https://github.com/apache/cordova-android.git
synced 2026-05-11 00:00:05 +08:00
half GPS problems fixed..Device.Location.init works nd can get first GPS read
This commit is contained in:
+9
-9
@@ -9,18 +9,17 @@
|
||||
<style type="text/css" media="screen">@import "file:///android_asset/iui.css";</style>
|
||||
<script type="application/x-javascript" src="file:///android_asset/iui.js"></script>
|
||||
<script type="application/x-javascript" src="file:///android_asset/gap.js"></script>
|
||||
<!-- iBug from JoeHewitt.com requires a certain iBug.js script located in
|
||||
the directory you launched the mini python server component of iBug
|
||||
in the format of src=http://hostname:port/iBug.js
|
||||
if you are not using to debug comment out
|
||||
-->
|
||||
<!-- <script type="application/x-javascript" src="http://192.168.1.20:1840/ibug.js"></script> -->
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
initGap = function() {
|
||||
// Device.init() initializes OS-Device values
|
||||
Device.init();
|
||||
// Device.Location.callback = updateLocation sets to funciotn updateLocation so that lat and lon can be passed
|
||||
Device.Location.callback = updateLocation;
|
||||
// Device.Location.init() to initalize location
|
||||
|
||||
//Device.Acceleration.callback = updateAccel;
|
||||
}
|
||||
|
||||
@@ -46,6 +45,7 @@ updateSettings = function() {
|
||||
}
|
||||
|
||||
updateLocation = function(lat,lon) {
|
||||
alert('lat=' + lat + ' lon=' + lon);
|
||||
$('lat').value = lat;
|
||||
$('lon').value = lon;
|
||||
}
|
||||
@@ -115,7 +115,7 @@ addLoadEvent(initGap);
|
||||
</div>
|
||||
|
||||
<div id="geo" title="Geo Location" class="panel">
|
||||
|
||||
<form id="searchForm" action="POST">
|
||||
<h2>Location</h2>
|
||||
<fieldset>
|
||||
<div class="row">
|
||||
@@ -127,10 +127,10 @@ addLoadEvent(initGap);
|
||||
<input disabled="enabled" name="lon" id="lon" value="" type="text"></input>
|
||||
</div>
|
||||
<div class="row">
|
||||
<a class="button blueButton" type="submit" onclick="Device.Location.init();">Update Location</a>
|
||||
<a class="button blueButton" type="submit" onclick="updateLocation();">Update Location</a>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="accel" title="Accelerometer" class="panel">
|
||||
|
||||
Reference in New Issue
Block a user