Skip to content

Commit

Permalink
Make selected area in trips vis stand out from transport mode colors
Browse files Browse the repository at this point in the history
  • Loading branch information
tituomin committed Feb 13, 2022
1 parent 27b3e5d commit caf0e77
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions analytics/client/src/Map.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ function AreaMap({ geoData, getFillColor, getElevation, getTooltip, colorStateKe
const [hoverInfo, setHoverInfo] = useState({});
const initialView = getInitialView(bbox);
const getLineColor = d => {
if (selectedArea == d?.properties?.id) {
return [0,0,0,255];
}
return (hoverInfo?.object?.properties !== undefined &&
d?.properties?.id === hoverInfo?.object?.properties?.id) ?
[174, 30, 32] : [0, 0, 0, 60]
[174, 30, 32] : [0, 0, 0, 60];
};
const layers = [
new GeoJsonLayer({
Expand Down Expand Up @@ -183,7 +186,7 @@ export function TransportModeShareMap({ areaType,
return [0, 0, 0, 0]
}
if (id === selectedArea) {
return [174, 30, 32, 255];
return [255, 255, 255, 255];
}
const area = areasById.get(id);
if (area == null || !area.data || area.data[modeId] == null) return [0, 0, 0, 0];
Expand Down

0 comments on commit caf0e77

Please sign in to comment.