I'm developing an app for Android using the React-Native, that uses the react-native-maps package.
In Marker Component(react-native-maps) there is prop called "image" which can be used only with local images. but in my case I need to render remote image Url
<Marker
coordinate={marker.latlng}
image={require('../images/pin.png')}
/>
The above code is working fine since the image is static but i need to render a remote image instead of pin.jpg So is there a way i could do like this.
- Download the remote url to images folder.
- Use the saved image uri in Marker Component.
This what i am trying to achieve - Code similar to below
let path_to_save_image = '../images/'
some_package.fetch('http://www.example.com/image/new_image.png',
path_to_save_image, {
//some headers ..
})
.then((res) => {
console.log('The file saved ')
})
render (){
return (
<Marker
coordinate={marker.latlng}
image={require('../images/new_image.png')}
/>)
}
Is there a way i could do this?
I have tried creating custom marker but it is not working out. #issue