react-native-maps markers on iOS

Hi,
my app shows some Points of Interest on a map. I use react-native-maps. If I use expo-go to debug my app, the markers on the map are ok. But when I build it, the result is that every marker icon are zoomed twice, with the result in the image below.

This is the code I use to show markers:

<Marker
      key={index}
      coordinate={marker.latlng}
	  centerOffset={{ x: 0.5, y: 0.5 }}
	  anchor={{ x: 0.5, y: 0.5 }}
      title={marker.title}
      description={marker.description}
	 zIndex={3}
	  onPress={(e) => {
		  e.stopPropagation();
		  this.markerClick(marker.codice);
		  //this.setState({region:this.mapView.region});
		}}
    >
		<Image
			source={marker.icona}
			style={{width: 24, height: 24}}
			resizeMode="center"
			resizeMethod="resize"
		/>
	</Marker>

Any help to obtain the correct result?

Massimo

Hi @masai2k

I see in the Marker docs there is an image prop. Does it make a difference if you use that instead of nesting an Image inside of the Marker?

It looks like you need to provide @2x and @3x versions of your images:
https://github.com/react-native-maps/react-native-maps/issues/1422#issuecomment-350894668

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.