diff options
author | Matthew Somerville <matthew@mysociety.org> | 2019-07-10 17:51:26 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2019-07-10 17:51:26 +0100 |
commit | ede03130b3b1e225cad2061c58f93a9eb85c203d (patch) | |
tree | 00f2badfc7e3c93550fa181ff8c07976be6c9959 /web/js/map-OpenLayers.js | |
parent | a6e909df059647d8440e2879d1c82df7b4dceaf1 (diff) | |
parent | c30ae857af7f2e2bccf974da34cf2f3868e7b7f2 (diff) |
Merge branch 'defensive-js'
Diffstat (limited to 'web/js/map-OpenLayers.js')
-rw-r--r-- | web/js/map-OpenLayers.js | 7 |
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(); |