Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions src/components/markers/s2cell.js

This file was deleted.

12 changes: 12 additions & 0 deletions src/components/markers/scanCell.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export default function scanCellMarker(ago) {
const value = ago <= 1050 ? 0 : Math.min((ago - 1050) / 750, 1)
const hue = ((1 - value) * 120).toString(10)

return {
fillColor: ['hsl(', hue, ',100%, 50%)'].join(''),
color: 'black',
opacity: 0.75,
fillOpacity: 0.5,
weight: 0.5,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Trans, useTranslation } from 'react-i18next'

import Utility from '@services/Utility'

export default function S2CellPopup({ cell, ts }) {
export default function ScanCellPopup({ cell, ts }) {
const { t } = useTranslation()
const { id, updated } = cell
const lastUpdated = new Date(updated * 1000)
Expand Down
10 changes: 5 additions & 5 deletions src/components/tiles/ScanCell.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, { memo } from 'react'
import { Polygon, Popup } from 'react-leaflet'

import PopupContent from '../popups/S2cell'
import marker from '../markers/s2cell'
import PopupContent from '../popups/ScanCell'
import marker from '../markers/scanCell'

const S2cellTile = ({ item, config, zoom, ts }) =>
const ScanCellTile = ({ item, config, zoom, ts }) =>
zoom >= config.scanCellsZoom && (
<Polygon positions={item.polygon} pathOptions={marker(item.updated)}>
<Polygon positions={item.polygon} pathOptions={marker(ts - item.updated)}>
<Popup position={[item.center_lat, item.center_lon]}>
<PopupContent cell={item} ts={ts} />
</Popup>
Expand All @@ -18,4 +18,4 @@ const areEqual = (prev, next) =>
prev.item.updated === next.item.updated &&
prev.zoom === next.zoom

export default memo(S2cellTile, areEqual)
export default memo(ScanCellTile, areEqual)