aboutsummaryrefslogtreecommitdiffstats
path: root/web/js/map-OpenLayers.js
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2019-07-10 17:51:26 +0100
committerMatthew Somerville <matthew@mysociety.org>2019-07-10 17:51:26 +0100
commitede03130b3b1e225cad2061c58f93a9eb85c203d (patch)
tree00f2badfc7e3c93550fa181ff8c07976be6c9959 /web/js/map-OpenLayers.js
parenta6e909df059647d8440e2879d1c82df7b4dceaf1 (diff)
parentc30ae857af7f2e2bccf974da34cf2f3868e7b7f2 (diff)
Merge branch 'defensive-js'
Diffstat (limited to 'web/js/map-OpenLayers.js')
-rw-r--r--web/js/map-OpenLayers.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js
index ae86269c9..cd2283491 100644
--- a/web/js/map-OpenLayers.js
+++ b/web/js/map-OpenLayers.js
@@ -304,6 +304,9 @@ $.extend(fixmystreet.utils, {
// fixmystreet.select_feature).
markers_highlight: function(problem_id) {
+ if (!fixmystreet.markers) {
+ return;
+ }
for (var i = 0; i < fixmystreet.markers.features.length; i++) {
if (typeof problem_id == 'undefined') {
// There is no highlighted marker, so unfade this marker
@@ -791,6 +794,10 @@ $.extend(fixmystreet.utils, {
$(function(){
+ if (!document.getElementById('map')) {
+ return;
+ }
+
// Set specific map config - some other JS included in the
// template should define this
fixmystreet.maps.config();