Skip to content

Commit

Permalink
icon-mode-in-routes
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanocudini committed Apr 7, 2023
1 parent 9b714d6 commit f3f15df
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions journey/src/otp-ui/overlay-route-viewer/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { encodedPolylineType, leafletPathType } from "../core-utils/types";
import { polylineLength, humanizeDistanceStringMetric } from "../core-utils/distance";

import OpenMoveModeIcon from "../../otp-ui/icons/openmove-mode-icon";

import PropTypes from "prop-types";
import React from "react";
import {
Expand Down Expand Up @@ -58,14 +60,12 @@ class RouteViewerOverlay extends MapLayer {

if (!routeData || !routeData.patterns) return <FeatureGroup />;

const routeColor = routeData.color ? `#${routeData.color}` : path.color;
const text =
routeData.longName !== routeData.shortName ? routeData.longName : null;
const desc = routeData?.desc;
const bikesAllowed = routeData?.bikesAllowed;
const segments = [];

console.log('routeData', routeData)
const routeColor = routeData.color ? `#${routeData.color}` : path.color
, text = routeData.longName !== routeData.shortName ? routeData.longName : null
, desc = routeData?.desc
, mode = routeData.mode
, bikesAllowed = routeData?.bikesAllowed
, segments = [];

Object.values(routeData.patterns).forEach( pattern => {
if (!pattern.geometry) return;
Expand All @@ -86,7 +86,9 @@ console.log('routeData', routeData)
sticky={true}
>
<div className="leaflet-tooltip-content">

<h4>
<OpenMoveModeIcon mode={mode} width={20} height={20} /> &nbsp;
{routeData.shortName} <small>{routeData.id}</small>
</h4>
<p>{text}</p>
Expand Down

0 comments on commit f3f15df

Please sign in to comment.