<h1 id="main_page_title"></h1>
</div>
<div data-role="content">
- <p>Make sure the networking is enabled, and the GPS is disabled.</p>
- <div id="onLine" class="online_show" style="display:none"></div>
- <div id="offLine" class="offline_show" style="display:none"></div>
- <div class="position_font">My position</div>
- <div id="latitudeDiv" class="attribute_show">Latitude:</div>
- <div id="longitudeDiv" class="attribute_show">Longitude:</div>
- <div id="errormessage"></div>
- <div id="map_canvas"></div>
+ <div id="observateEare" style="border: #000 solid 1px;height: 442px;margin-bottom: 10px;">
+ <div id="onLine" class="online_show" style="display:none"></div>
+ <div id="offLine" class="offline_show" style="display:none"></div>
+ <div id="latitudeDiv" class="attribute_show">Latitude:</div>
+ <div id="longitudeDiv" class="attribute_show">Longitude:</div>
+ <div id="errormessage"></div>
+ <div align="center" id="map_canvas"></div>
+ </div>
+ <p class="ui-li-desc">* Make sure the networking is enabled, and the GPS is disabled.</p>
</div>
<div data-role="footer" data-position="fixed">
</div>
function initialize() {
+ $.mobile.loading('show', {
+ text: 'loading...',
+ textVisible: false,
+ theme: 'a',
+ textonly: false,
+ html: ""
+ });
var connection = navigator.connection || navigator.mozConnection || navigator.webkitConnection;
+ if(connection==undefined){
+ jQuery("#offLine").html("The navigator.connection is not supported");
+ $.mobile.loading('hide');
+ $("#offLine").show();
+ $("#onLine").hide();
+ printPosition("n/a","n/a");
+ jQuery("#map_canvas").html("No data");
+ }
jQuery("#onLine").html("The current bandwidth is "+connection.bandwidth+" MB/s.");
jQuery("#offLine").html("The current bandwidth is "+connection.bandwidth+" MB/s. Please check the network connection.");
//browser state
$("#offLine").hide();
$("#onLine").show();
}else {
+ $.mobile.loading('hide');
$("#offLine").show();
$("#onLine").hide();
+ printPosition("n/a","n/a");
+ jQuery("#map_canvas").html("No data");
}
window.ononline = function () {
if(navigator.geolocation) {
browserSupportFlag = true;
navigator.geolocation.getCurrentPosition(function(position) {
+ $.mobile.loading('hide');
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
location = new google.maps.LatLng(position.coords.latitude,position.coords.longitude);
map.setCenter(location);
browserSupportFlag = true;
var geo = google.gears.factory.create('beta.geolocation');
geo.getCurrentPosition(function(position) {
+ $.mobile.loading('hide');
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
location = new google.maps.LatLng(position.latitude,position.longitude);
map.setCenter(location);
});
// Browser doesn't support Geolocation
} else {
+ $.mobile.loading('hide');
browserSupportFlag = false;
handleNoGeolocation(browserSupportFlag);
}
function handleNoGeolocation(errorFlag) {
+ $.mobile.loading('hide');
if (errorFlag == true) {
jQuery("#errormessage").html("<font color='red'>Geolocation service failed.</font>");
+ jQuery("#map_canvas").html("No data");
} else {
jQuery("#errormessage").html("<font color='red'>Not Support Geolocation.</font>");
+ jQuery("#map_canvas").html("No data");
}
}
}