SDK 25: Custom map-markers are now HUGE on iOS

I’m currently on a branch, upgrading our app from SDK 24 to SDK 25 and the first thing that pops, is that our map icons are extremely large.

We are using icon.png (48 px wide), icon@2x.png (96 px wide), icon@3x.png (144 px wide) as instructed by the React Native documentation and the markers are declared like this:

const Marker = ({coordinates}) => (
  <MapView.Marker coordinates={coordinates} image={require('./icon.png')} />
)

Screenshot SDK 25

Screenshot SDK 24

This does not seem to affect the Android devices I’ve tested on.

Thanks for reporting this. Do you think this is the same issue?
https://github.com/expo/expo/issues/1182

Is there any chance you could post a Snack with code, or a github repo, that could reproduce the problem?
That would help us fix it.

Sorry for the trouble.

Found it!

Image.prefetch() is causing this. We do a prefetch of critical assets during app startup and if I comment out this particular image. It works fine… but as soon as I uncomment, it goes huge again.

My code looks almost identical to this: https://docs.expo.io/versions/latest/guides/preloading-and-caching-assets.html#content

I’m not sure where to report a bug like that.

1 Like

Oh wow, weird. thanks for sharing that information.

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