This commit is contained in:
Hamza Aleghwairyeen
2024-04-02 23:18:20 +03:00
parent 682da605c5
commit 02b27110df

View File

@@ -108,10 +108,6 @@ class MapDriverController extends GetxController {
// Set up a timer or interval to trigger the marker update every 3 seconds. // Set up a timer or interval to trigger the marker update every 3 seconds.
timer = Timer.periodic(const Duration(seconds: 1), (_) { timer = Timer.periodic(const Duration(seconds: 1), (_) {
updateMarker(); updateMarker();
controller.animateCamera(
CameraUpdate.newLatLng(myLocation),
);
update();
}); });
} }
@@ -636,6 +632,7 @@ class MapDriverController extends GetxController {
), ),
); );
// Animate camera only once after updating the marker
mapController!.animateCamera( mapController!.animateCamera(
CameraUpdate.newLatLng(myLocation), CameraUpdate.newLatLng(myLocation),
); );