From 342a922832349ed46ce0e9ac0e9364f59891a79d Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Wed, 3 Apr 2024 13:03:45 +0300 Subject: [PATCH] 4/3/8 --- .../home/captin/map_driver_controller.dart | 13 +++++++------ .../mapDriverWidgets/google_driver_map_page.dart | 3 ++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/controller/home/captin/map_driver_controller.dart b/lib/controller/home/captin/map_driver_controller.dart index 3066921..fde9c38 100644 --- a/lib/controller/home/captin/map_driver_controller.dart +++ b/lib/controller/home/captin/map_driver_controller.dart @@ -105,13 +105,14 @@ class MapDriverController extends GetxController { myLocation = myLocation; mapController = controller; controller.getVisibleRegion(); - // controller.animateCamera( - // CameraUpdate.newLatLng(Get.find().myLocation), - // ); + controller.animateCamera( + CameraUpdate.newLatLng(Get.find().myLocation), + ); + update(); // Set up a timer or interval to trigger the marker update every 3 seconds. - // timer = Timer.periodic(const Duration(seconds: 1), (_) { - // updateMarker(); - // }); + timer = Timer.periodic(const Duration(seconds: 1), (_) { + updateMarker(); + }); } void changeStatusDriver() { diff --git a/lib/views/home/Captin/mapDriverWidgets/google_driver_map_page.dart b/lib/views/home/Captin/mapDriverWidgets/google_driver_map_page.dart index 29e4050..45a0300 100644 --- a/lib/views/home/Captin/mapDriverWidgets/google_driver_map_page.dart +++ b/lib/views/home/Captin/mapDriverWidgets/google_driver_map_page.dart @@ -31,7 +31,8 @@ class GoogleDriverMap extends StatelessWidget { onCameraMoveStarted: () {}, onCameraMove: (position) { locationController.myLocation = position.target; - print(position); + controller.mapController! + .animateCamera(CameraUpdate.newCameraPosition(position)); }, minMaxZoomPreference: const MinMaxZoomPreference(6, 18), myLocationEnabled: true,