Skip to content

Commit

Permalink
[Task] #109, line dashed when diff is high, marker start icon when di…
Browse files Browse the repository at this point in the history
…ff is higher
  • Loading branch information
Type-Style committed Aug 27, 2024
1 parent 11d760a commit e032d88
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/client/components/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,17 @@ const MultiColorPolyline = ({ cleanEntries }: { cleanEntries: Models.IEntry[] })

const correctedColor = toGamut('rgb', 'oklch', null)(color); // map OKLCH to the RGB gamut

let strokeDashArray = null;

if (entry.time.diff > 60) { strokeDashArray = "4 8";}
return (<Polyline
key={entry.time.created * 1.1 + Math.random()} // random to force rerender while new data is incoming (maxSpeed might have changed)
positions={[[previousEntry.lat, previousEntry.lon], [entry.lat, entry.lon]]}
color={formatCss(correctedColor)} weight={5}
color={formatCss(correctedColor)}
weight={5}
dashArray={strokeDashArray}
lineCap={"butt"}

/>)
});
}
Expand All @@ -71,7 +77,7 @@ function Map({ entries }: { entries: Models.IEntry[] }) {
function createCustomIcon(entry: Models.IEntry) {
let className = "";
let iconSize = 15;
if (entry.index == 0) {
if (entry.index == 0 || entry.time.diff >= 300) {
className = "start"
}
if (entry == lastEntry) {
Expand Down

0 comments on commit e032d88

Please sign in to comment.