mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-18 08:18:33 +03:00
Feature/ux fixes (#167)
* fix card toggle * fix bug and bar marker * reinstate timeline arrows * adjust (hard to interpret) category y calculation * shadows for markers as well * return markers when there are no categories * remove year in timeline * make notifications optional * WIP: render hovered counts * show number on hover * lint * revert to filteredLocations * linting * return mapClustersToLocations * 💄 * lint Co-authored-by: efarooqui <efarooqui@pandora.com>
This commit is contained in:
@@ -89,11 +89,7 @@ class Map extends React.Component {
|
||||
.setMaxBounds(mapConfig.maxBounds)
|
||||
|
||||
// Initialize supercluster index
|
||||
this.superclusterIndex = new Supercluster({
|
||||
radius: clusterConfig.radius,
|
||||
maxZoom: clusterConfig.maxZoom,
|
||||
minZoom: clusterConfig.minZoom
|
||||
})
|
||||
this.superclusterIndex = new Supercluster(clusterConfig)
|
||||
|
||||
let firstLayer
|
||||
|
||||
@@ -116,6 +112,7 @@ class Map extends React.Component {
|
||||
map.zoomControl.remove()
|
||||
|
||||
map.on('moveend', () => {
|
||||
// console.log(map.getZoom())
|
||||
this.updateClusters()
|
||||
this.alignLayers()
|
||||
})
|
||||
@@ -199,11 +196,9 @@ class Map extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
onClusterSelect (e) {
|
||||
const { id } = e.target
|
||||
const { longitude, latitude } = e.target.attributes
|
||||
onClusterSelect ({ id, latitude, longitude }) {
|
||||
const expansionZoom = Math.max(this.superclusterIndex.getClusterExpansionZoom(parseInt(id)), this.superclusterIndex.options.minZoom)
|
||||
this.map.flyTo(new L.LatLng(latitude.value, longitude.value), expansionZoom)
|
||||
this.map.flyTo(new L.LatLng(latitude, longitude), expansionZoom)
|
||||
}
|
||||
|
||||
getClientDims () {
|
||||
|
||||
Reference in New Issue
Block a user