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
wodin
July 12, 2021, 8:00am
#2
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 :
opened 11:49AM - 20 Jun 17 UTC
closed 11:37PM - 11 Dec 17 UTC
I have a problem with custom markers.
When I use them in dev mode everything is… ok, but when I build my app for release, then out of nowhere markers are about 2/3 times bigger and look very bad. I think it's not it is supposed to work. I also attach code responsible for markers
<MapView.Marker
key={key}
image={stopMarker}
anchor={{ x: 0.5, y: 0.5 }}
coordinate={{ latitude: stop.lat, longitude: stop.lon }}
title={stop.name}
/>


1 Like
system
closed
August 11, 2021, 8:00am
#3
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.