aboutsummaryrefslogtreecommitdiffstats
path: root/phonegap
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2012-05-28 17:03:57 +0100
committerStruan Donald <struan@exo.org.uk>2012-05-28 17:03:57 +0100
commitd17f655d176535e5dd77279a27e12cf6671dd88c (patch)
tree156b55f95f69ca57374af641ac757116bd1b8b2e /phonegap
parent6bb0365c11c7caedb3a7d844d2a64ee63da133ca (diff)
make non postcode locations work
Diffstat (limited to 'phonegap')
-rw-r--r--phonegap/www/css/mobile.css10
-rw-r--r--phonegap/www/js/mobile.js11
2 files changed, 16 insertions, 5 deletions
diff --git a/phonegap/www/css/mobile.css b/phonegap/www/css/mobile.css
index 7236afc8f..1aa2cdeae 100644
--- a/phonegap/www/css/mobile.css
+++ b/phonegap/www/css/mobile.css
@@ -74,4 +74,14 @@
ol.big-numbers > li {
margin-bottom: 0.8em;
+}
+
+#multiple {
+ margin: auto;
+ margin-bottom: 1em;
+}
+
+#multiple li {
+ list-style: none;
+ margin: auto;
} \ No newline at end of file
diff --git a/phonegap/www/js/mobile.js b/phonegap/www/js/mobile.js
index 5ee7c56f4..554872a70 100644
--- a/phonegap/www/js/mobile.js
+++ b/phonegap/www/js/mobile.js
@@ -42,6 +42,8 @@ function location_error( msg ) {
$('#location_error').remove();
return;
}
+
+ alert(msg);
if ( !$('#location_error') ) {
$('#postcodeForm').after('<p id="location_error"></p>');
@@ -61,7 +63,7 @@ function lookup_string(q) {
}
var url = "http://dev.virtualearth.net/REST/v1/Locations?q=" + escape(q);
- url += '&c=en-GB&key=' + CONFIG.BING_KEY;
+ url += '&c=en-GB&key=' + CONFIG.BING_API_KEY;
var x = jQuery.get( url, function(data, status) {
if ( status == 'success' ) {
var valid_locations = 0;
@@ -96,6 +98,7 @@ function lookup_string(q) {
multiple_html += '<li><a href="#" onclick="use_lat_long( ' + multiple[i].latitude + ',' + multiple[i].longitude +')">' + multiple[i].address + '</a></li>';
}
multiple_html += '</ul>';
+ $('#front-howto').hide();
$('#postcodeForm').after( multiple_html );
}
} else {
@@ -106,7 +109,7 @@ function lookup_string(q) {
}
function locate() {
- location_error('');
+ //location_error('');
$("#multiple").remove();
var pc = $('#pc').val();
@@ -121,14 +124,12 @@ function locate() {
loadingStart = navigator.notificationEx.loadingStart;
loadingStop = navigator.notificationEx.loadingStop;
}
- loadingStart( { 'backgroundOpacity' : 0.5, labelText: 'Getting Location...', minDuration: 1 } );
+
if ( valid_postcode( pc ) ) {
jQuery.get( CONFIG.MAPIT_URL + 'postcode/' + pc + '.json', function(data, status) {
if ( status == 'success' ) {
show_around( data.wgs84_lat, data.wgs84_lon );
- loadingStop();
} else {
- loadingStop();
}
});
} else {