codempireio / react-native-cluster-map

ReactNative MapView clustering component for iOS + Android
MIT License
73 stars 15 forks source link

Proposal for onClusterClick #19

Closed sprotymo closed 4 years ago

sprotymo commented 5 years ago

Please, can you add coordinates in onClusterClick?

sprotymo commented 5 years ago

`JavaScript

this.onClusterMarkerPress = (clusterId, coordinates) => { const { isClusterExpandClick, onClusterClick } = this.props; if (isClusterExpandClick) { const region = clusterService.expandCluster(clusterId); this.mapRef.animateToRegion(region, CLUSTER_EXPAND_TIME); } onClusterClick && onClusterClick(coordinates); };

... onClusterMarkerPress: () => this.onClusterMarkerPress(marker.properties.cluster_id, geometry.coordinates) ...

`

dimagreat commented 4 years ago

Good point, will add. You can open PR as well!

ManigandanRaamanathan commented 4 years ago

@dimagreat @sprotymo can we get list of items in it using clusterId? How do know the items inside the cluster?