mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-12 05:18:34 +03:00
reconfigures initial settings with a 30 year setting, more sensible defaults for zooms
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import React from 'react'
|
||||
|
||||
function zoomIsActive (duration, extent) {
|
||||
if (duration > 1570000 && extent > 1570000) {
|
||||
function zoomIsActive (duration, extent, max) {
|
||||
if (duration >= max && extent >= max) {
|
||||
return true
|
||||
}
|
||||
return duration === extent
|
||||
@@ -9,7 +9,8 @@ function zoomIsActive (duration, extent) {
|
||||
|
||||
const TimelineZoomControls = ({ extent, zoomLevels, dims, onApplyZoom }) => {
|
||||
function renderZoom (zoom, idx) {
|
||||
const isActive = zoomIsActive(zoom.duration, extent)
|
||||
const max = zoomLevels.reduce((acc, vl) => acc.duration < vl.duration ? vl : acc)
|
||||
const isActive = zoomIsActive(zoom.duration, extent, max.duration)
|
||||
return (
|
||||
<text
|
||||
className={`zoom-level-button ${isActive ? 'active' : ''}`}
|
||||
|
||||
Reference in New Issue
Block a user