From 41d61f0880dfd24a6eb50a1f4da150bc63445cbd Mon Sep 17 00:00:00 2001 From: Luiz Costa Date: Fri, 7 Jun 2024 16:43:21 +0100 Subject: [PATCH] init_map without resize map --- .../fleet_management/doctype/trip/trip_list.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/fleet_management/fleet_management/doctype/trip/trip_list.js b/fleet_management/fleet_management/doctype/trip/trip_list.js index 1a6eca7..b458ebd 100644 --- a/fleet_management/fleet_management/doctype/trip/trip_list.js +++ b/fleet_management/fleet_management/doctype/trip/trip_list.js @@ -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;