就像奥伯(Uber)的奥拉(Ola),我需要从摆在GoogleMap中的屏幕中央的大头针取lat_long。 我得到了地图,我知道如何从lat_long取得地址。 帮助我进行拖动侦听器部分...
这是代码
GoogleMap(
onMapCreated: _onMapCreated,
compassEnabled: true,
myLocationEnabled: true,
initialCameraPosition: CameraPosition(target: LatLng(0.0,0.0)),
),
void _onMapCreated(GoogleMapController controller) async {
mapController = controller;
mapController.addListener(_onMapChanged);
refresh(); <----gps function that works fine and cool
}
答案 0 :(得分:0)
更新后(google_maps_flutter ^ 0.5.7)
GoogleMap(
onMapCreated: _onMapCreated,
initialCameraPosition:
CameraPosition(target: LatLng(28.556160, 77.100281)), // INDIA
onCameraMove: ((pinPosition) {}), // <-----pinPosition gives LatLong
),