diff options
Diffstat (limited to 'web/js')
-rw-r--r-- | web/js/duplicates.js | 6 | ||||
-rw-r--r-- | web/js/map-OpenLayers.js | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/web/js/duplicates.js b/web/js/duplicates.js index 0844cb5f3..3ed7e6079 100644 --- a/web/js/duplicates.js +++ b/web/js/duplicates.js @@ -121,6 +121,9 @@ } function render_duplicate_pins(api_response) { + if (!fixmystreet.markers) { + return; + } var markers = fixmystreet.maps.markers_list( api_response.pins, true ); fixmystreet.markers.removeFeatures( current_duplicate_markers ); fixmystreet.markers.addFeatures( markers ); @@ -138,6 +141,9 @@ } function remove_duplicate_pins() { + if (!fixmystreet.markers) { + return; + } fixmystreet.markers.removeFeatures( current_duplicate_markers ); } 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(); |