Man*_*ham 5 flutter google-maps-flutter
我在 Flutter 中使用谷歌地图时遇到问题,
https://pub.dev/packages/google_maps_flutter
我的代码如下:
GoogleMap(
mapType: MapType.normal,
myLocationEnabled: true,
myLocationButtonEnabled: true,
onMapCreated: _onMapCreated,
padding: EdgeInsets.only(top: ScreenUtil().setHeight(100)),
zoomControlsEnabled: false,
initialCameraPosition: CameraPosition(
target: _currentPosition ?? Constants.DEFAULT_POSITION,
zoom: 17,
),
)
Run Code Online (Sandbox Code Playgroud)
第一次运行时,出现位置权限对话框,当我接受权限时,我的位置按钮没有出现。
当我第二次打开googlemap页面时(此时已经授予权限),我的位置显示正常。
谢谢
| 归档时间: |
|
| 查看次数: |
943 次 |
| 最近记录: |