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:
Lachlan Kermode
2020-10-22 20:09:13 +03:00
committed by GitHub
parent f44d3e2481
commit ddbee03f50
9 changed files with 153 additions and 135 deletions

View File

@@ -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 () {