tsx
import Mapa from 'react-native-mapa';
// or import { MapView, Camera } from 'react-native-mapa';
<Mapa.MapView>
<Mapa.Location locateWhenInit={true} visible={true} style="right" />
</Mapa.MapView>User Location
Props
visible
visible:
boolean
Whether the location icon is displayed on the map
Default Value
ts
truestyle
optionalstyle:PositionStyle|PositionSlot
Default displays in the bottom right corner of the screen, can set style to customize position
Example
{ right: 5, bottom: 5 }
or 'right-top'locateWhenInit?
optionallocateWhenInit:boolean
Auto locate when initialized
Default Value
ts
falseonChange()?
optionalonChange: (e) =>void
Listen for latest location information
Parameters
• e: LocationEvent
Event information
Returns
void