aboutsummaryrefslogtreecommitdiffstats
path: root/www/js
diff options
context:
space:
mode:
Diffstat (limited to 'www/js')
-rw-r--r--www/js/app.js1
-rw-r--r--www/js/views/around.js10
2 files changed, 11 insertions, 0 deletions
diff --git a/www/js/app.js b/www/js/app.js
index 0e0544e..63d38d2 100644
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -45,6 +45,7 @@ var tpl = {
users: new FMS.Users(),
currentUser: null,
currentLocation: null,
+ currentPosition: null,
currentReport: new FMS.Report(),
diff --git a/www/js/views/around.js b/www/js/views/around.js
index 0aa3618..eb741ff 100644
--- a/www/js/views/around.js
+++ b/www/js/views/around.js
@@ -7,6 +7,7 @@
events: {
'pagehide': 'destroy',
'pageshow': 'afterDisplay',
+ 'click #relocate': 'centerMapOnPosition',
'click #mark-here': 'onClickReport'
},
@@ -85,6 +86,8 @@
fixmystreet.map.getProjectionObject()
);
+ FMS.currentPosition = centre;
+
var point = new OpenLayers.Geometry.Point( centre.lon, centre.lat );
fixmystreet.location.removeAllFeatures();
@@ -104,6 +107,13 @@
fixmystreet.location.addFeatures([ x ]);
},
+ centerMapOnPosition: function(e) {
+ e.preventDefault();
+ if ( FMS.currentPosition ) {
+ fixmystreet.map.panTo(FMS.currentPosition);
+ }
+ },
+
noMap: function( details ) {
this.locateCount = 21;
$('#locating').hide();