Description:
A simple React Native module that adds map clustering for both iOS and Android.
Installation:
# NPM $ npm install react-native-maps --save
Usage:
import MapView from 'react-native-map-clustering';
import { Marker } from 'react-native-maps';
<MapView
region={{latitude: 52.5, longitude: 19.2,
latitudeDelta: 8.5, longitudeDelta: 8.5}}
style={{width: mapWidth, height: mapHeight}}>
<Marker coordinate={{latitude: 52.0, longitude: 18.2}} />
<Marker coordinate={{latitude: 52.4, longitude: 18.7}} />
...
</MapView>Props.
defaultProps = {
clusterColor: '#F5F5F5',
clusterTextColor: '#FF5252',
clusterTextSize: 17,
clusterBorderColor: '#FF5252',
clusterBorderWidth: 1,
clustering: true,
radius: 22,
};