mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-13 05:48:36 +03:00
Moved supercluster config outside of map; to set the lowest level at which clusters appear, set maxZoom in config
This commit is contained in:
@@ -79,7 +79,7 @@ class Map extends React.Component {
|
|||||||
/**
|
/**
|
||||||
* Creates a Leaflet map and a tilelayer for the map background
|
* 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 =
|
const map =
|
||||||
L.map(this.props.ui.dom.map)
|
L.map(this.props.ui.dom.map)
|
||||||
@@ -90,9 +90,9 @@ class Map extends React.Component {
|
|||||||
|
|
||||||
// Initialize supercluster index
|
// Initialize supercluster index
|
||||||
this.superclusterIndex = new Supercluster({
|
this.superclusterIndex = new Supercluster({
|
||||||
radius: mapConfig.clusterRadius,
|
radius: clusterConfig.radius,
|
||||||
maxZoom: mapConfig.maxZoom,
|
maxZoom: clusterConfig.maxZoom,
|
||||||
minZoom: mapConfig.minZoom
|
minZoom: clusterConfig.minZoom
|
||||||
})
|
})
|
||||||
|
|
||||||
let firstLayer
|
let firstLayer
|
||||||
@@ -385,6 +385,7 @@ function mapStateToProps (state) {
|
|||||||
selected: selectors.selectSelected(state),
|
selected: selectors.selectSelected(state),
|
||||||
highlighted: state.app.highlighted,
|
highlighted: state.app.highlighted,
|
||||||
map: state.app.map,
|
map: state.app.map,
|
||||||
|
cluster: state.app.cluster,
|
||||||
language: state.app.language,
|
language: state.app.language,
|
||||||
loading: state.app.loading,
|
loading: state.app.loading,
|
||||||
narrative: state.app.associations.narrative,
|
narrative: state.app.associations.narrative,
|
||||||
|
|||||||
@@ -52,7 +52,11 @@ const initial = {
|
|||||||
maxZoom: 16,
|
maxZoom: 16,
|
||||||
bounds: null,
|
bounds: null,
|
||||||
maxBounds: [[180, -180], [-180, 180]],
|
maxBounds: [[180, -180], [-180, 180]],
|
||||||
clusterRadius: 30
|
},
|
||||||
|
cluster: {
|
||||||
|
radius: 30,
|
||||||
|
minZoom: 2,
|
||||||
|
maxZoom: 16
|
||||||
},
|
},
|
||||||
timeline: {
|
timeline: {
|
||||||
dimensions: {
|
dimensions: {
|
||||||
|
|||||||
Reference in New Issue
Block a user