new branch
This commit is contained in:
@@ -43,21 +43,22 @@ class MapServices {
|
||||
List<LatLng> polylineCoordinates = [];
|
||||
PolylinePoints polylinePoints = PolylinePoints();
|
||||
|
||||
PolylineResult result = await polylinePoints.getRouteBetweenCoordinates(
|
||||
ApplicationConstants.MAP_KEY,
|
||||
PointLatLng(origin.latitude, origin.longitude),
|
||||
PointLatLng(destination.latitude, destination.longitude),
|
||||
travelMode: TravelMode.driving,
|
||||
optimizeWaypoints: true);
|
||||
if (result.points.isNotEmpty) {
|
||||
for (var point in result.points) {
|
||||
polylineCoordinates.add(LatLng(point.latitude, point.longitude));
|
||||
}
|
||||
return polylineCoordinates;
|
||||
} else {
|
||||
log("Lỗi khi tìm đường");
|
||||
return [];
|
||||
}
|
||||
// PolylineResult result = await polylinePoints.getRouteBetweenCoordinates(
|
||||
// ApplicationConstants.MAP_KEY,
|
||||
// PointLatLng(origin.latitude, origin.longitude),
|
||||
// PointLatLng(destination.latitude, destination.longitude),
|
||||
// travelMode: TravelMode.driving,
|
||||
// optimizeWaypoints: true);
|
||||
// if (result.points.isNotEmpty) {
|
||||
// for (var point in result.points) {
|
||||
// polylineCoordinates.add(LatLng(point.latitude, point.longitude));
|
||||
// }
|
||||
// return polylineCoordinates;
|
||||
// } else {
|
||||
// log("Lỗi khi tìm đường");
|
||||
// return [];
|
||||
// }
|
||||
return [];
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user