问题
Images aren't shown on Markers.
Hi, I'm developing an app for Android using the React-Native, that uses the react-native-maps package.
All platforms run without any problem, except on Android 7.1+.
All images contained on Markers are not shown/loaded
In Marker Component there is prop called "image" which can be used only with local images. but in my case I need to render remote image Url so i am not able to use this props So i decided to use custom Marker It was working fine until I tested my app in Higher Android version
回答1:
Use image prop to define image for marker. It works for android 7+ versions
return (
<MapView.Marker
key={`marker-${index}`}
coordinate={{ latitude: Number(latitude), longitude: Number(longitude) }}
onPress={options.onPress ? () => options.onPress(marker) : false}
image={icons[marker.type] || icons.default}
style={styles.marker}
identifier={marker._id}
/>
);
回答2:
Its been resolved since , react-native-maps new update which include the fix. So now I am able to render dynamic Images in maps
来源:https://stackoverflow.com/questions/50993542/react-native-maps-custom-marker-image-not-rendering-in-higher-android-versions