react-native-map-clustering icon indicating copy to clipboard operation
react-native-map-clustering copied to clipboard

How to change cluster border?

Open stephanbluegrass opened this issue 2 years ago • 3 comments

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.

stephanbluegrass avatar Nov 14 '22 13:11 stephanbluegrass

Use the renderCluster prop of MapView to render custom clusters

AlixH avatar Nov 18 '22 13:11 AlixH

Is there any documentation on what renderCluster returns and what this library needs to render a custom cluster?

lucksp avatar Jan 11 '23 18:01 lucksp

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" >

stephanbluegrass avatar Jan 19 '23 13:01 stephanbluegrass