Fix active location car point rendering

This commit is contained in:
cerenX9
2026-07-24 13:51:31 +03:00
parent 33fd8b6c19
commit 27233b2d91

View File

@@ -104,7 +104,17 @@ document.addEventListener("DOMContentLoaded", function() {
clearInterval(vehicleAnimationTimer); clearInterval(vehicleAnimationTimer);
vehicleAnimationTimer = null; vehicleAnimationTimer = null;
} }
if (!routePoints || routePoints.length < 2) return; if (!routePoints || routePoints.length === 0) return;
// Eğer sadece tek bir nokta varsa (Canlı Anlık GPS modu), arabayı sabit bir şekilde o noktaya koy
if (routePoints.length === 1) {
var speedStr = vehicle.gps_speed ? vehicle.gps_speed + " km/s" : "0 km/s";
var staticCar = L.marker(routePoints[0], {
icon: createLiveCarIcon(vehicle.driver_tag, speedStr)
}).addTo(map);
activeMarkers.push(staticCar);
return;
}
var currentIdx = 0; var currentIdx = 0;
var progress = 0; var progress = 0;