aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2013-03-20 14:23:53 +0000
committerStruan Donald <struan@exo.org.uk>2013-03-20 14:23:53 +0000
commit0b13d59bf4b182ffd16f3fed3dd2743e1b3b806e (patch)
tree74dda79b7437aa9a26bff46243ae64af68a5de49
parentb610df47f42d707bfd6fb50a6fda4bb64514ec32 (diff)
do no try and recenter the map if there is no map
-rw-r--r--www/js/views/around.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/www/js/views/around.js b/www/js/views/around.js
index 718721b..8720ccc 100644
--- a/www/js/views/around.js
+++ b/www/js/views/around.js
@@ -110,6 +110,11 @@
centerMapOnPosition: function(e) {
e.preventDefault();
+ if ( !fixmystreet.map ) {
+ return;
+ }
+ // if there isn't a currentPosition then something
+ // is up so we probably should not recenter
if ( FMS.currentPosition ) {
fixmystreet.map.panTo(FMS.currentPosition);
}