aboutsummaryrefslogtreecommitdiffstats
path: root/web/js/geolocation.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/js/geolocation.js')
-rw-r--r--web/js/geolocation.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/web/js/geolocation.js b/web/js/geolocation.js
index 3c2cf04df..fbef4d7ea 100644
--- a/web/js/geolocation.js
+++ b/web/js/geolocation.js
@@ -30,7 +30,7 @@ fixmystreet.geolocate = function(element, success_callback) {
var link = document.getElementById('geolocate_link');
if (!link) { return; }
var https = window.location.protocol.toLowerCase() === 'https:';
- if ('geolocation' in navigator && https) {
+ if ('geolocation' in navigator && https && window.addEventListener) {
fixmystreet.geolocate(link, function(pos) {
var latitude = pos.coords.latitude.toFixed(6);
var longitude = pos.coords.longitude.toFixed(6);