Skip to content

Commit

Permalink
DBC22-1266: map icon, popup title fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ray-oxd authored and fatbird committed Dec 21, 2023
1 parent b6d3e5c commit f4ff0e2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/frontend/src/Components/map/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { eventStyles } from '../data/featureStyleDefinitions.js';
// Static assets
export const getEventIcon = (event, state) => {
const severity = event.get('severity').toLowerCase();
const display_category = event.get('display_category').toLowerCase();
const display_category = event.get('display_category');
const geometry = event.getGeometry().getType();
if (geometry === 'Point') {
if (severity === 'major') {
Expand Down
9 changes: 8 additions & 1 deletion src/frontend/src/Components/map/mapPopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ import parse from 'html-react-parser';

import colocatedCamIcon from '../../images/colocated-camera.svg';

const displayCategoryMap = {
majorEvents: 'Major Delay',
minorEvents: 'Minor Delay',
futureEvents: 'Future Delay',
roadConditions: 'Road Condition',
}

function convertDirection(direction) {
switch (direction) {
case "N":
Expand Down Expand Up @@ -107,7 +114,7 @@ export function getEventPopup(eventFeature) {
<EventTypeIcon displayCategory={eventData.display_category} />
</div>

<p className="bold">{severity} delays</p>
<p className="bold">{displayCategoryMap[eventData.display_category]}</p>
</div>

<p className="bold friendly-time--mobile">
Expand Down

0 comments on commit f4ff0e2

Please sign in to comment.