[done] Close map when empty
This commit is contained in:
parent
10dc80b79d
commit
27de44354a
|
|
@ -15,10 +15,9 @@
|
|||
reader.readAsText(file);
|
||||
},
|
||||
initMap(){
|
||||
window.map.style.height = '300px';
|
||||
if(window.geoJsonMap) return;
|
||||
try{
|
||||
let map = document.getElementById('map');
|
||||
map.style.height = '300px';
|
||||
window.geoJsonMap = L.map('map').setView([51.505, -0.09], 13);
|
||||
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||
maxZoom: 19,
|
||||
|
|
@ -81,6 +80,7 @@
|
|||
default:
|
||||
break;
|
||||
}
|
||||
if(window.mapLayers.length == 0) window.map.style.height='0px';
|
||||
window.mapLayers.forEach((data) => this.updateLayer(data));
|
||||
window.map.focus();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue