Simplify mapboxgl control container removal

This commit is contained in:
Frederic Junod
2019-05-10 12:39:39 +02:00
parent 5756003c88
commit d1fe22a872

View File

@@ -60,9 +60,7 @@ class Mapbox extends Layer {
this.mbmap.getCanvas().remove();
this.loaded = true;
this.map_.render();
[
'mapboxgl-control-container'
].forEach(className => document.getElementsByClassName(className)[0].remove());
this.mbmap.getContainer().querySelector('.mapboxgl-control-container').remove();
}.bind(this));
this.mbmap.on('render', function() {