android - 如何在 Flutter 的地图上绘制从源到目的地的路径?
问题描述
如何在颤动图中绘制路径并显示方向。我正在使用 google_map_flutter API,但我没有找到任何可能的方法来绘制路径。
我也尝试了 map_view 插件,但无法获得可能的解决方案
GoogleMap(
markers: _markers,
mapType: MapType.normal,
initialCameraPosition: CameraPosition(
target: latLng,
zoom: 14.4746,
),
onMapCreated: (GoogleMapController controller) {
_controller.complete(controller);
},
),
floatingActionButton: FloatingActionButton.extended(
onPressed: _goToTheLake,
label: Text('To the lake!'),
icon: Icon(Icons.directions_boat),
),
Future<void> _goToTheLake() async {
final GoogleMapController controller = await _controller.future;
controller.animateCamera(CameraUpdate.newLatLng( LatLng(20.008751,
73.780037)));
}
解决方案
推荐阅读
- php - Laravel 将用户同步到所有可以不受限制的类别
- google-apps-script - 从工作表中的某个点获取第一列
- python - Python Crash Course Game 显示未正确显示图像
- scala - 如何在 Scala 中模拟 JDBC 结果集
- apache-spark - Spark on Kubernetes 故障排除
- typescript - 如果构造函数是私有的,则评估参数是否为“泛型类的实例”的泛型
- reactjs - 滚动到页面上某个组件的“反应”方式是什么?
- java - 使用 JSON 识别 JsonPrimitve 是 BigDecimal 还是 Integer
- javascript - 按钮在点击时不起作用。我关注了一个 YouTube 视频,但它对我不起作用
- apache - .htaccess 文件的 RewriteRule 不起作用