我正在使用react-native-map-clustering对谷歌地图上的标记进行聚类。除指示我的位置的一个标记外,所有标记都是动态的。当我缩小地图时,所有标记都会聚集在一起。但我想要这样的东西
这是我的实现:
<MapView
layoutAnimationConf={LayoutAnimation.Presets.easeInEaseOut}
animationEnabled={true}
ref={mapRef}
style={styles.map}
provider={PROVIDER_GOOGLE}
initialRegion={currentRegion}
// region={currentRegion}
clusteringEnabled={true}
radius={70}
customMapStyle={mapConfig}>
<Marker coordinate={currentRegion} title={'my location'}>
<Image
source={images.currentLocation}
style={{
height: 20,
width: 20,
}}
/>
</Marker>
{branchMarkers()}
</MapView>
Run Code Online (Sandbox Code Playgroud)