Merge pull request #166 from forensic-architecture/bugfix/make-supercluster-independently-configurable

Bugfix/make supercluster independently configurable
This commit is contained in:
Ebrahem Farooqui
2020-10-21 21:00:06 -07:00
committed by GitHub
2 changed files with 11 additions and 6 deletions

View File

@@ -79,7 +79,7 @@ class Map extends React.Component {
/**
* Creates a Leaflet map and a tilelayer for the map background
*/
const { map: mapConfig } = this.props.app
const { map: mapConfig, cluster: clusterConfig } = this.props.app
const map =
L.map(this.props.ui.dom.map)
@@ -90,9 +90,9 @@ class Map extends React.Component {
// Initialize supercluster index
this.superclusterIndex = new Supercluster({
radius: mapConfig.clusterRadius,
maxZoom: mapConfig.maxZoom,
minZoom: mapConfig.minZoom
radius: clusterConfig.radius,
maxZoom: clusterConfig.maxZoom,
minZoom: clusterConfig.minZoom
})
let firstLayer
@@ -385,6 +385,7 @@ function mapStateToProps (state) {
selected: selectors.selectSelected(state),
highlighted: state.app.highlighted,
map: state.app.map,
cluster: state.app.cluster,
language: state.app.language,
loading: state.app.loading,
narrative: state.app.associations.narrative,

View File

@@ -51,8 +51,12 @@ const initial = {
minZoom: 2,
maxZoom: 16,
bounds: null,
maxBounds: [[180, -180], [-180, 180]],
clusterRadius: 30
maxBounds: [[180, -180], [-180, 180]]
},
cluster: {
radius: 30,
minZoom: 2,
maxZoom: 16
},
timeline: {
dimensions: {