This commit is contained in:
Hamza-Ayed
2024-02-09 02:56:37 +03:00
parent d4d4592944
commit 8c61a79de3
15 changed files with 397 additions and 71 deletions

View File

@@ -22,6 +22,8 @@ import '../../functions/location_controller.dart';
class MapDriverController extends GetxController {
bool isLoading = true;
final formKey1 = GlobalKey<FormState>();
final sosEmergincyNumberCotroller = TextEditingController();
List data = [];
List dataDestination = [];
LatLngBounds? boundsData;
@@ -478,6 +480,20 @@ class MapDriverController extends GetxController {
polyLines.add(polyline);
// rideConfirm = false;
// Define the northeast and southwest coordinates
final bounds = response["routes"][0]["bounds"];
LatLng northeast =
LatLng(bounds['northeast']['lat'], bounds['northeast']['lng']);
LatLng southwest =
LatLng(bounds['southwest']['lat'], bounds['southwest']['lng']);
// Create the LatLngBounds object
LatLngBounds boundsData =
LatLngBounds(northeast: northeast, southwest: southwest);
// Fit the camera to the bounds
var cameraUpdate = CameraUpdate.newLatLngBounds(boundsData, 130);
mapController!.animateCamera(cameraUpdate);
update();
}
}
@@ -519,6 +535,8 @@ class MapDriverController extends GetxController {
// updateCameraFromBoundsAfterGetMap(dataBounds);
// polyLinesDestination.add(polyline);
// rideConfirm = false;
// Define the northeast and southwest coordinates
update();
}
}