这是我的代码
PolylinePoints polylinePoints = PolylinePoints();
List<PointLatLng> pointsList =
await polylinePoints.getRouteBetweenCoordinates(
Const.google_map_api_key,
_trackingModel.driverLat,
_trackingModel.driverLng,
_trackingModel.customerLat,
_trackingModel.customerLng);
<块引用>
“PolylineResult”类型的值不能分配给“List”类型的变量。
答案 0 :(得分:0)
这是因为您不是从结果中检索列表,而是直接输入结果对象。尝试通过这样做来提取点列表-
List<PointLatLng> pointsList =
(await polylinePoints.getRouteBetweenCoordinates(
Const.google_map_api_key,
_trackingModel.driverLat,
_trackingModel.driverLng,
_trackingModel.customerLat,
_trackingModel.customerLng)).points;
另外请提供有关问题的更多详细信息,例如您使用的是哪个软件包,以便帮助其他人更好地调试。