'How can I hide tooltip with MapBoxGL.Callout manually in react native (react-native-mapbox-gl)?
I am now showing several markers on the mapview using MapBoxGL.PointAnnotation. I added MapboxGL.Callout component to show tooltip when the marker is selected.
<MapboxGL.PointAnnotation
key={random.toString()}
id={random.toString() + '_source'}
coordinate={tagCoordinates}>
<Image source={getIconLocal(tagIcon)} />
<MapboxGL.Callout
title={`Tag: Pathogen\n${typeName}\nUser: ${userName}\nDate: ${createDate}`}
style={{minWidth: 200}}
contentStyle={styles.tagContainer}
textStyle={styles.tagText}
tipStyle={styles.tagTip}
/>
</MapboxGL.PointAnnotation>
It's working as I expected. The problem is that I can't hide tooltip when select the rest area of the mapbox. When I select another marker, it's working fine (hide current tooltip and show selected marker's tooltip), but tooltip is remained when select the rest area of the mapview except markers.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
