init_map without resize map

This commit is contained in:
Luiz Costa 2024-06-07 16:43:21 +01:00
parent 296452214e
commit 41d61f0880

View File

@ -24,7 +24,7 @@ function create_dialog_and_init_map(frm) {
const modalDialog = dialog.$wrapper.find('.modal-content');
modalDialog.css({
"width": "85vw",
"max-width": "85vw",
"max-width": "85vw",
"margin-left": "-25vh"
});
@ -34,16 +34,7 @@ function create_dialog_and_init_map(frm) {
};
dialog.show();
// Ensure the map container expands to fit its parent after the dialog is shown
setTimeout(() => {
const mapElement = document.getElementById('map');
if (mapElement) {
mapElement.style.width = "100%";
mapElement.style.height = "100%";
init_map(frm); // Initialize the map
}
}, 500); // Add a delay to ensure the map loads correctly
setTimeout(() => init_map(frm), 500);
}
var currentMap = null;