Not able to add both text and image to map marker #832
How to add index=1 and count =0
{data.map((obj, index) =>
{
return (
<MapView.Marker identifier="Marker1" key={index} coordinate={obj.coordinate} image={require( '../../images/dummy.png')}>
<MapView.Callout style={styles.callout}>
<View>
<Text>{obj.number}</Text>
<Text>{obj.city}</Text>
</View>
</MapView.Callout>
<Text>{obj.number}</Text>
</MapView.Marker>
)
})
}
Without callout its working ..!
(below piece of code)
How to use this with callouts.
```
{data.map((obj, index) =>
{
return (
)
})
}
It was solved by moving <Text>{obj.number}</Text>
top of callout.
{data.map((obj, index) =>
{
return (
<MapView.Marker identifier="Marker1" key={index} coordinate={obj.coordinate} image={require( '../../images/dummy.png')}>
<Text>{obj.number}</Text>
<MapView.Callout style={styles.callout}>
<View>
<Text>{obj.number}</Text>
<Text>{obj.city}</Text>
</View>
</MapView.Callout>
</MapView.Marker>
)
})
}
@iiitmahesh that actually fixed it.. sometimes it's just that stupid I guess... Thanks a lot
Most helpful comment
It was solved by moving
<Text>{obj.number}</Text>
top of callout.