Skip to content

Latest commit

 

History

History
145 lines (81 loc) · 2.09 KB

UserLocation.md

File metadata and controls

145 lines (81 loc) · 2.09 KB
import { UserLocation } from '@rnmapbox/maps';

UserLocation

props

androidRenderMode

'normal' | 'compass' | 'gps'

native/android only render mode

  • normal: just a circle
  • compass: triangle with heading
  • gps: large arrow

@platform android

animated

boolean

Whether location icon is animated between updates

defaults to: true

children

ReactElement | ReactElement[]

Custom location icon of type mapbox-gl-native components

minDisplacement

number

Minimum amount of movement before GPS location is updated in meters

defaults to: 0

onPress

func

Callback that is triggered on location icon press signature:() => void

onUpdate

func

Callback that is triggered on location update signature:(location:Location) => void

renderMode

UserLocationRenderMode

Which render mode to use.

defaults to: UserLocationRenderMode.Normal

requestsAlwaysUse

boolean

Request the always location permission, and listen to the location even when the app is in background

@platform ios

defaults to: false

showsUserHeadingIndicator

boolean

Show or hide small arrow which indicates direction the device is pointing relative to north.

defaults to: false

visible

boolean

Whether location icon is visible

defaults to: true

methods

setLocationManager({ running }: { running?: boolean })

Whether to start or stop listening to the locationManager

Notice, that listening will start automatically when
either onUpdate or visible are set

arguments

Name Type Required Description
{ running }: { running?: boolean } {running?:boolean} Yes undefined

needsLocationManagerRunning()

If locationManager should be running

arguments

Name Type Required Description