diff --git a/combo/apps/maps/static/js/combo.map.js b/combo/apps/maps/static/js/combo.map.js index 2380cecc..2dd64a9f 100644 --- a/combo/apps/maps/static/js/combo.map.js +++ b/combo/apps/maps/static/js/combo.map.js @@ -150,7 +150,7 @@ $(function() { disable_layer: function(slug) { var layer = this.geojson_layers[slug]; var group = this.clustered_markers || this; - if (layer) { + if (layer && layer.leaflet_layer) { group.removeLayer(layer.leaflet_layer); } }, @@ -158,7 +158,7 @@ $(function() { enable_layer: function(slug) { var layer = this.geojson_layers[slug]; var group = this.clustered_markers || this; - if (layer) { + if (layer && layer.leaflet_layer) { group.addLayer(layer.leaflet_layer); } },