4/2/3
This commit is contained in:
@@ -737,7 +737,7 @@ class MapPassengerController extends GetxController {
|
||||
late String make;
|
||||
late String licensePlate;
|
||||
confirmRideForFirstDriver() async {
|
||||
await getCarsLocationByPassenger();
|
||||
await getCarsLocationByPassengerAndReloadMarker();
|
||||
await getNearestDriverByPassengerLocationAPIGOOGLE();
|
||||
|
||||
if (dataCarsLocationByPassenger != 'failure') {
|
||||
@@ -1064,7 +1064,7 @@ class MapPassengerController extends GetxController {
|
||||
late LatLng currentDriverLocation;
|
||||
late double headingList;
|
||||
|
||||
Future getCarsLocationByPassenger() async {
|
||||
Future getCarsLocationByPassengerAndReloadMarker() async {
|
||||
// if (rideConfirm == false) {
|
||||
carsLocationByPassenger = [];
|
||||
LatLngBounds bounds = calculateBounds(
|
||||
@@ -1208,8 +1208,8 @@ class MapPassengerController extends GetxController {
|
||||
['latitude']),
|
||||
double.parse(datadriverCarsLocationToPassengerAfterApplied['message'][0]
|
||||
['longitude']));
|
||||
print('driver position $driverPosition')
|
||||
; final driverAcceptedMarker = Marker(
|
||||
print('driver position $driverPosition');
|
||||
final driverAcceptedMarker = Marker(
|
||||
markerId: const MarkerId('driverToPassengers'),
|
||||
position: driverPosition,
|
||||
rotation: double.parse(
|
||||
@@ -1667,7 +1667,7 @@ class MapPassengerController extends GetxController {
|
||||
//print('Reloading markers ($reloadCount)');
|
||||
if (!rideConfirm) {
|
||||
reloadMarkers();
|
||||
}else{
|
||||
} else {
|
||||
runWhenRideIsBegin();
|
||||
}
|
||||
|
||||
@@ -1680,49 +1680,8 @@ class MapPassengerController extends GetxController {
|
||||
|
||||
reloadMarkers() async {
|
||||
if (statusRide == 'wait') {
|
||||
await getCarsLocationByPassenger();
|
||||
await getCarsLocationByPassengerAndReloadMarker();
|
||||
await getNearestDriverByPassengerLocation();
|
||||
// markers.clear();
|
||||
|
||||
// update();
|
||||
// if (rideConfirm) {
|
||||
|
||||
// }
|
||||
// Add new markers
|
||||
// Example: Add a marker for each item in a list
|
||||
for (var item in carsLocationByPassenger) {
|
||||
// for (var i = 0; i <dataCarsLocationByPassenger['message'].length; i++) {
|
||||
// if (previousLocationOfDrivers != null) {
|
||||
// angleDegrees = calculateAngleBetweenLocations(
|
||||
// previousLocationOfDrivers, currentLocationOfDrivers);
|
||||
// // Use the calculated angle for rotation, if needed
|
||||
// print('angleDegrees $angleDegrees');
|
||||
// print('previousLocationOfDrivers $previousLocationOfDrivers');
|
||||
// print('currentLocationOfDrivers $currentLocationOfDrivers');
|
||||
// }
|
||||
final marker = Marker(
|
||||
position: LatLng(
|
||||
// double.parse(
|
||||
// datadriverCarsLocationToPassengerAfterApplied['message'][i]
|
||||
// ['latitude']),
|
||||
// double.parse(
|
||||
// datadriverCarsLocationToPassengerAfterApplied['message'][i]
|
||||
// ['longitude'])),
|
||||
item.latitude,
|
||||
item.longitude,
|
||||
),
|
||||
icon: carIcon,
|
||||
markerId: MarkerId(item.toString()),
|
||||
rotation: item.heading,
|
||||
// Other properties for the marker, such as icon, info window, etc.
|
||||
);
|
||||
markers.add(marker);
|
||||
update();
|
||||
}
|
||||
|
||||
// Update the map with the new markers
|
||||
// mapController?.animateCamera(CameraUpdate.newLatLng(
|
||||
// LatLng(passengerLocation.latitude, passengerLocation.longitude)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1902,7 +1861,7 @@ class MapPassengerController extends GetxController {
|
||||
late String endNameAddress;
|
||||
getMap(String origin, destination) async {
|
||||
remainingTime = 25; //to make cancel every call
|
||||
await getCarsLocationByPassenger();
|
||||
await getCarsLocationByPassengerAndReloadMarker();
|
||||
// //print(carsLocationByPassenger);
|
||||
var coordDestination = destination.split(',');
|
||||
double latPassengerDestination = double.parse(coordDestination[0]);
|
||||
@@ -2051,7 +2010,7 @@ class MapPassengerController extends GetxController {
|
||||
getMapPoints(String originSteps, String destinationSteps, int index) async {
|
||||
isWayPointStopsSheetUtilGetMap = false;
|
||||
// haveSteps = true;
|
||||
await getCarsLocationByPassenger();
|
||||
await getCarsLocationByPassengerAndReloadMarker();
|
||||
// isLoading = true;
|
||||
update();
|
||||
var url =
|
||||
|
||||
Reference in New Issue
Block a user