maps: don't add/remove layers that failed to load (#44303)

This commit is contained in:
Frédéric Péters 2020-06-22 10:27:13 +02:00
parent 0ded4ae599
commit 999b9c9b97
1 changed files with 2 additions and 2 deletions

View File

@ -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);
}
},