Below is the function which call on onclick event
function drawMapFromWms(latt,longt){
document.getElementById('hrymap').innerHTML = "";
document.getElementById('hrymap').innerHTML = "<div id='map'></div>";
map = L.map('map').setView([29.0,76.776695], 8);
L.tileLayer.wms("http://example.com", {
layers:'india3',
format: 'image/png',
transparent: true,
attribution:"dummy"
}).addTo(map);
L.tileLayer.wms("http://example.com", {
layers:'hrcm_roads',
format: 'image/png',
transparent: true,
attribution:"dummy"
}).addTo(map);
var marker = L.marker([latt,longt]).addTo(map);
$("#detail_content").css({'display':'block'});
}
Here is the modal div which map div created
<div id="detail_content" class="w3-modal">
<div class="w3-modal-content">
<div class="w3-container">
<span onclick="document.getElementById('detail_content').style.display='none'" class="w3-button w3-display-topright">×</span>
<div class="modal-info">
<div id="hrymap">
</div>
</div>
</div>
</div>
</div>
</div>
And finally function is call
Problem is when i click the button the map is loaded partially like below image
and after inspect element it will loaded fully like below image.