From 0621b14b776fc0f5e15ced79de63bd16c6e80dae Mon Sep 17 00:00:00 2001 From: Pringgosutono Date: Thu, 18 Sep 2025 08:42:44 +0700 Subject: [PATCH] update bounds --- .../menu_v1/reports/_trip_detail.blade.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/resources/views/menu_v1/reports/_trip_detail.blade.php b/resources/views/menu_v1/reports/_trip_detail.blade.php index 31e89af..0519790 100644 --- a/resources/views/menu_v1/reports/_trip_detail.blade.php +++ b/resources/views/menu_v1/reports/_trip_detail.blade.php @@ -115,8 +115,8 @@ let coords setTimeout(async() => { map.invalidateSize(); // force Leaflet to recalc - // map.fitBounds(polyline.getBounds()); - map.fitBounds(await coords.map(c => L.latLng(c[0], c[1]))); + map.fitBounds(polyline.getBounds()); + // map.fitBounds(await coords.map(c => L.latLng(c[0], c[1]))); }, 200); const linesData = (@json($list)); @@ -136,12 +136,13 @@ .map((point) => [point.latitude, point.longitude]) // 4) Add polyline - // const polyline = L.polyline(points,{ - // color: 'red', - // weight: 3, - // opacity: 0.7, - // smoothFactor: 1 - // }).addTo(map); + const polyline = L.polyline(points,{ + color: 'red', + weight: 3, + opacity: 0.7, + smoothFactor: 1 + }) + // .addTo(map); // const lines = L.Routing.control({ // waypoints: points,