【发布时间】:2021-09-17 19:50:23
【问题描述】:
我正在尝试将折线从当前位置绘制到另一个位置,我在网上看到的所有示例都没有这部分代码的问题。
void setPolylines() async {
List<PointLatLng> result = await polylinePoints.getRouteBetweenCoordinates(
googleAPIKey,
currentLocation.latitude,
currentLocation.longitude,
destinationLocation.latitude,
destinationLocation.longitude);
上面的这段代码给了我下面的错误
A value of type 'PolylineResult' can't be assigned to a variable of type 'List<PointLatLng>'.
Try changing the type of the variable, or casting the right-hand type to 'List<PointLatLng>'.
Open documentation
Too many positional arguments: 3 expected, but 5 found. Try removing the extra positional arguments, or specifying the name for named arguments. Open documentation
【问题讨论】:
-
你用什么 Flutter 包来绘制折线?什么版本?
标签: flutter google-maps polyline