How to display user location on React Native Maps
<MapView
region={this.props.coordinate}
>
//My map markers
</MapView>
How to display user location on React Native Maps
<MapView
region={this.props.coordinate}
>
//My map markers
</MapView>
set showsUserLocation
true
<MapView
region={this.props.coordinate}
showsUserLocation={true}
>
//My map markers
</MapView>
followsUserLocation={true}
to enable that. –
Dentition Location.getCurrentPositionAsync
to get current user location Latitude & Longitude to pass to the MapView
region and set the lat/longitude delta to zoom an appropriate amount. –
Harridan Either you can use property of MapView
called showsUserLocation
mentioned here
Or you can fetch user location using GeoLocation and display it on Marker
<MapView
region={this.props.coordinate}
showsUserLocation={true} >
© 2022 - 2024 — McMap. All rights reserved.