Skip to content

Latest commit

 

History

History
149 lines (87 loc) · 2.49 KB

UserLocation.md

File metadata and controls

149 lines (87 loc) · 2.49 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 Set Displacement

onPress

func

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

Show Map

onUpdate

func

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

User Location Updates

renderMode

UserLocationRenderMode

@deprecated use LocationPuck component instead of UserLocationRenderMode.Native Which render mode to use.

defaults to: UserLocationRenderMode.Normal User Location Render Mode

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 User Location Render Mode

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