Try to input Leaflet map into PrimeFaces Dialog. And I have a issue with incorrect rendering. Map has incorrect position, looks like map start positioning relative to index.html not to the Dialog. The next issue: size is incorrect. The same code outside the dialogue works fine. How to change this?
<h:head>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css" />
</h:head>
<h:body>
<ui:composition>
<script src="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.js"></script>
<p:dialog id="map" header="Mapa:" widgetVar="wigetMapDialog" height="800px" width="1200px" showEffect="clip" hideEffect="clip" resizable="false" closable="true" dynamic="true" modal="true">
<div id="mapid" style="width: 1180px; height: 780px;"></div>
<script>
var mymap = L.map('mapid').setView([50.9547215, 16.9126256], 18);
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(mymap);
</script>
</p:dialog>
</ui:composition>
</h:body>
</html>
My Dialog:
When I move map inside: