'React Native Maps - Custom Marker Image Not rendering in Higher Android Versions

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

Here you can see the callout but the image is not rendered



Solution 1:[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}
            />
        );

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Prashant ranjan