Идея состоит в том, что один div занимает 100% экрана <<strong> map > когда второй скрыт <<strong> chart >. Также я хотел бы знать, почему, когда я нажимаю на тег ввода, он выполняет функцию и не ждет нажатия кнопки.
function hidechart() {
var x = document.getElementById("chart");
if (x.style.display === "none") {
x.style.display = "block";
}
else {
x.style.display = "none";
}
};
* { padding: 0; margin: 0; }
html, body, #fullheight {
min-height: 100% !important;
height: 100%;
}
.leaflet-container {
position: fixed;
width: 50%;
height: 100%;
}
#chart{
position:absolute;
width: 50%;
height: 50px;
top:2%;
right:0;
}
<div id="map" ></div>
<div class="btn-group" style="position:fixed">
<button onclick="hidechart()" >Graficas</button>
<button type="button" id="alldep" class="btn" >Todos</button>
</div>
<form id="form" onsubmit="return false;">
<input style="position:fixed; top:0%; left:14%; width:10%;" type="text" onfocus="this.value=''" id="userInput" />
<button style="position:fixed; top:0%; left:5%; width:8%;",stype="button" onclick="query();">Consultar</button>
</form>
<div id="chart" align="right">
<div class="row">
<div id="chart-area"></div>
</div>
</div>