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