diff --git a/app/src/components/map/SliderTicks.vue b/app/src/components/map/SliderTicks.vue index cab4ef7544..bc8e7b86ba 100644 --- a/app/src/components/map/SliderTicks.vue +++ b/app/src/components/map/SliderTicks.vue @@ -74,11 +74,8 @@ export default { this.lines.forEach((line, index) => { const currentTime = DateTime.fromISO(this.times[index].value); - console.log(currentTime); const currentYear = currentTime.year; - console.log(`Current year: ${currentYear} | Previous year: ${previousYear}`); - // If it's the first tick or if the year has changed, add a year mark if (index === 0 || currentYear !== previousYear) { yearMarks.push({ @@ -91,6 +88,16 @@ export default { previousYear = currentYear; }); + // Filter out year marks that are too close together, in favor of the second one. + return yearMarks.filter((current, i) => { + const next = yearMarks[i + 1]; + if (next && next.position - current.position < 20) { + return false; + } else { + return true; + } + }); + return yearMarks; }, },