fluttify-project / amap_location_fluttify

高德地图 定位组件 Flutter插件

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

centerCoordinate参数无法动态更新中心点坐标

tadpole145 opened this issue · comments

当第一次设置中心点坐标后,发现点击marker想更改中心点坐标,但是无法更改,查看源码发现 if (widget.centerCoordinate != null || widget.zoomLevel != null) { final latLng = await com_amap_api_maps_model_LatLng.create__double__double( widget.centerCoordinate?.latitude ?? 39.92, widget.centerCoordinate?.longitude ?? 116.46, );
中心点里面的latLng 是final类型,只能被一次性赋值,而无法修改,这个为啥要设置为final呢? 还是有别的方法可以设置中心点坐标呢?

你想更改中心点坐标的话,使用AmapController.setCenterCoodinate()就可以了。

好的,已经解决了,谢谢