Skip to content

Custom marker with Image won't render first time on Android #924

@henrikra

Description

@henrikra

When making custom MapView.Marker with children as prop to Marker like this:

<MapView.Marker coordinate={coordinate}>
  <View source={styles.container}>
    <Image source={require('./my-image.png')} style={style.icon}>
    // other stuff here
  </View>
</MapView.Marker>

It does not render image on first render time on Android.

But if i use Marker's image prop like this:

<MapView.Marker coordinate={coordinate} image={require('./my-image.png')}>
  <View source={styles.container}>
  // other stuff here
</MapView.Marker>

It does render on first time on Android too.

But I cant use second option because I have to set custom size to the image via styles. So either would be nice to be:

  1. able to style image which is passed by image prop OR
  2. fix bug where image won't render on first try.

Also note that in order to notice the first render bug you have to actually TURN OFF the app and then back on. :) Tell me if you experience this too

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions