【发布时间】:2019-11-13 05:37:45
【问题描述】:
我正在使用出租车应用程序。是否可以使用颤振在真实道路上绘制真实路线?
我是这样用的:https://developers.google.com/maps/documentation/directions/intro#ExampleRequests
getDirectionSteps(double destinationLat, double destinationLng) {
network
.get("origin=" +
location.latitude.toString() +
"," +
location.longitude.toString() +
"&destination=" +
destinationLat.toString() +
"," +
destinationLng.toString() +
"&key=api_key")
.then((dynamic res) {
List<Steps> rr = res;
print(res.toString());
ccc = new List();
for (final i in rr) {
ccc.add(i.startLocation);
ccc.add(i.endLocation);
}
mapView.onMapReady.listen((_) {
mapView.setMarkers(getMarker(location.latitude,location.longitude,destinationLat,destinationLng));
mapView.addPolyline(new Polyline("12", ccc, width: 15.0));
});
_screenListener.dismissLoader();
showMap();
}).catchError((Exception error) => _screenListener.dismissLoader());
}
我的输出如下所示:
但我需要这样:(在真实道路上绘制目的地路线)
【问题讨论】:
-
我发现很难理解实际问题是什么。请您详细说明一下。
-
@SahdeepSingh 我更新了我的问题。请检查..我添加了另一张照片..请检查
标签: google-maps flutter google-maps-api-3 dart