update
This commit is contained in:
@@ -43,22 +43,24 @@ 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(
|
||||
googleApiKey: ApplicationConstants.MAP_KEY,
|
||||
request: PolylineRequest(
|
||||
origin: PointLatLng(origin.latitude, origin.longitude),
|
||||
destination: PointLatLng(destination.latitude, destination.longitude),
|
||||
mode: 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 [];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,7 +3,7 @@ description: Smart Fire Monitoring
|
||||
|
||||
publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
||||
|
||||
version: 1.0.5+5
|
||||
version: 1.0.6+6
|
||||
|
||||
environment:
|
||||
sdk: ">=3.0.1 <4.0.0"
|
||||
|
||||
Reference in New Issue
Block a user