Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display user location on react native maps

How to display user location on React Native Maps

<MapView
    region={this.props.coordinate}
>
    //My map markers
</MapView>
like image 786
Mahdi Bashirpour Avatar asked Jul 13 '18 12:07

Mahdi Bashirpour


2 Answers

set showsUserLocation true

<MapView
    region={this.props.coordinate}
    showsUserLocation={true}
  >
    //My map markers
</MapView>
like image 140
Ebrahim Bashirpour Avatar answered Oct 17 '22 09:10

Ebrahim Bashirpour


Either you can use property of MapView called showsUserLocation mentioned here

Or you can fetch user location using GeoLocation and display it on Marker

like image 4
Ravi Avatar answered Oct 17 '22 09:10

Ravi