我怎么会有谷歌地图的当前位置的样式标记,它甚至可以显示当前位置的方向?
这是我的代码,我的代码的标记样式只是一个大头针,我想要 拥有谷歌地图的标记样式,甚至可以显示当前位置的方向。
_markerSet.add(
Marker(
markerId: MarkerId('current_Postion'),
infoWindow: InfoWindow(title: 'Current Position'),
position: _userCurrentPositionLatLng,
icon: BitmapDescriptor.defaultMarkerWithHue(
BitmapDescriptor.hueGreen,
),
),
这是我的标记的样子 enter image description here
这是我想要的谷歌标记 enter image description here
有什么建议提示吗?
最佳答案
编辑:
在 GoogleMap
小部件上设置 myLocationEnabled: true,
。它会自动处理。
这适用于自定义标记:
您无法直接从 Google map 获取位置。
你可以用这个 location包以获取用户位置(纬度和经度),然后将标记相应地添加到 map 。
关于当前位置的 flutter 谷歌地图标记,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62700163/