美文网首页
MapboxGL.UserLocation

MapboxGL.UserLocation

作者: jadefan | 来源:发表于2020-03-27 13:17 被阅读0次

<MapboxGL.UserLocation />

用户定位组件,添加上可自动定位用户当前位置、方向,并可自动跟随
也可以只定位不显示,在onUpdate事件获取到坐标后,转换坐标系或记录

props

Prop Type Default Required Description
animated bool true false Whether location icon is animated between updates
renderMode enum 'normal' false Rendermode of user location icon.
One of "normal", "custom".
"custom" must be of type mapbox-gl-native components
visible bool true false Whether location icon is visible
onPress func none false Callback that is triggered on location icon press
onUpdate func none false Callback that is triggered on location update
minDisplacement number 0 false FIX ME NO DESCRIPTION
children any none false Custom location icon of type mapbox-gl-native components

methods

setLocationManager({running})

Whether to start or stop the locationManager
Notice, that locationManager will start automatically when
either onUpdate or visible are set

arguments
Name Type Required Description
{running} n/a Yes undefined

needsLocationManagerRunning()

If locationManager should be running

arguments
Name Type Required Description

相关文章

  • MapboxGL.UserLocation

    用户定位组件,添加上可自动定位用户当前位置、方向,并可自动跟随...

网友评论

      本文标题:MapboxGL.UserLocation

      本文链接:https://www.haomeiwen.com/subject/fcsluhtx.html