use remote image uri in react-native-maps MapView -
i'm using react-native-maps react-native application. need post image on mapview on map. but, image web. whereas, know local images can added mapview in react-native-maps. know way post image uri
in react-native-maps mapview
?
i tried
<mapview style={{flex: 1}} loadingenabled={true} region={this.state.region} onregionchangecomplete={this.onregionchangecomplete}> <mapview.marker coordinate={{latitude: this.props.user_location[0], longitude: this.props.user_location[1]}} title={this.props.user_name} description={this.props.user_desc}> <image source={{uri: 'https://facebook.github.io/react/img/logo_og.png'}} /> </mapview.marker> </mapview>
and result
and deleted <image/>
<mapview style={{flex: 1}} loadingenabled={true} region={this.state.region} onregionchangecomplete={this.onregionchangecomplete}> <mapview.marker coordinate={{latitude: this.props.user_location[0], longitude: this.props.user_location[1]}} title={this.props.user_name} description={this.props.user_desc}> </mapview.marker> </mapview>
and result
you can try custom marker view
<mapview.marker coordinate={marker.latlng}> <image source={{uri: 'http://somecustomimageurl' }} /> </mapview.marker>
Comments
Post a Comment