update
This commit is contained in:
@ -113,10 +113,10 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
let coords
|
let coords
|
||||||
setTimeout(() => {
|
setTimeout(async() => {
|
||||||
map.invalidateSize(); // force Leaflet to recalc
|
map.invalidateSize(); // force Leaflet to recalc
|
||||||
map.fitBounds(polyline.getBounds());
|
// map.fitBounds(polyline.getBounds());
|
||||||
// map.fitBounds(coords.map(c => L.latLng(c[0], c[1])));
|
map.fitBounds(await coords.map(c => L.latLng(c[0], c[1])));
|
||||||
}, 200);
|
}, 200);
|
||||||
|
|
||||||
const linesData = (@json($list));
|
const linesData = (@json($list));
|
||||||
@ -136,12 +136,12 @@
|
|||||||
.map((point) => [point.latitude, point.longitude])
|
.map((point) => [point.latitude, point.longitude])
|
||||||
|
|
||||||
// 4) Add polyline
|
// 4) Add polyline
|
||||||
const polyline = L.polyline(points,{
|
// const polyline = L.polyline(points,{
|
||||||
color: 'red',
|
// color: 'red',
|
||||||
weight: 3,
|
// weight: 3,
|
||||||
opacity: 0.7,
|
// opacity: 0.7,
|
||||||
smoothFactor: 1
|
// smoothFactor: 1
|
||||||
}).addTo(map);
|
// }).addTo(map);
|
||||||
|
|
||||||
// const lines = L.Routing.control({
|
// const lines = L.Routing.control({
|
||||||
// waypoints: points,
|
// waypoints: points,
|
||||||
|
|||||||
@ -49,13 +49,14 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="text-muted">From</label>
|
<label class="text-muted">From</label>
|
||||||
<!-- default today -->
|
<!-- default today -->
|
||||||
<!-- <input class="form-control" id="tgl0" value="15-09-2025 00:00"> -->
|
<!-- <input class="form-control" id="tgl0" value="12-09-2025 00:00"> -->
|
||||||
<input class="form-control" id="tgl0" value="{{ date('d-m-Y 00:00') }}">
|
<input class="form-control" id="tgl0" value="{{ date('d-m-Y 00:00') }}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-2">
|
<div class="col-2">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="text-muted">To</label>
|
<label class="text-muted">To</label>
|
||||||
|
<!-- <input class="form-control" id="tgl1" value="12-09-2025 23:00"> -->
|
||||||
<input class="form-control" id="tgl1" value="{{ date('d-m-Y 23:59') }}">
|
<input class="form-control" id="tgl1" value="{{ date('d-m-Y 23:59') }}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user