react-native-map-clustering
react-native-map-clustering copied to clipboard
How to disable mapview onPress event when I touch the cluster component(default)
I am using latest package version and I have app logic to create map marker and get coordinate info when I tap any map area. After implementing the clustering on my map with onClusterPress props, clustering zoom event and my map press event are being triggered at the same time always. I need to disable mapview onPress event when I click only clustering circle component which is including the numbers of markers.
Pleaes help me. Thanks
I have the same problem and don't know how to fix it either
You cant disable mapview onPress in default cluster component without edit library.
If you are using a customCluster (renderCluster function) you just need to call stopPropagation() event in native event.
const onClusterPress=(e)=>{
e.stopPropagation()
}
.
.
.
<Marker style={MARKER} coordinate={coordinate} onPress={onClusterPress}>