react-native-map-clustering
react-native-map-clustering copied to clipboard
How to change cluster border?
Good day I have found repos from older versions documenting clusterBorderWidth and clusterBorderColor as props to MapView. It doesn't seem to work anymore? Also cant find any documentation or solution after 2018/2019 posts.
Any help would be appreciated. I'd ultimately like to remove the borders all together.
Use the renderCluster prop of MapView to render custom clusters
Is there any documentation on what renderCluster
returns and what this library needs to render a custom cluster?
Is there any documentation on what
renderCluster
returns and what this library needs to render a custom cluster?
@lucksp this worked for me >>
<MapView style={styles.map} customMapStyle={mapStyle} minPoints={10} minZoom={1} renderCluster={(cluster) => { const { id, geometry, onPress, properties } = cluster; const points = properties.point_count; return ( <Marker key={
cluster-${id}} coordinate={{ longitude: geometry.coordinates[0], latitude: geometry.coordinates[1], }} onPress={onPress} > <View style={{ width: 50, height: 50, backgroundColor: ASTRON_ORANGE, borderRadius: 50, justifyContent: "center", }} > <Text style={{ color: WHITE, textAlign: "center", fontFamily: "avenirnext", }} > {points} </Text> </View> </Marker> ); }} radius={70} showsUserLocation={showUserLocation} showsMyLocationButton={false} region={this.region} loadingEnabled onUserLocationChange={(event) => userLocationChanged(event)} onRegionChange={regionChanged} followUserLocation={followUserLocation} ref={mapRef} onMoveShouldSetResponder={() => { setFollowUserLocation(false); }} key="mapa" >