Skip to content

Commit

Permalink
correctly label stops/locations
Browse files Browse the repository at this point in the history
  • Loading branch information
miles-grant-ibigroup committed Aug 2, 2024
1 parent d8d8ef5 commit bf947a6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/editor/components/map/PatternStopsLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default class PatternStopsLayer extends Component<Props> {
patternStops.findIndex(ps => ps.id === activePatternStop.id) === -1
let cpIndex = 0
let psIndex = 0
const patternStopsWithControlPointIndexes = patternStops.filter(ps => ps.locationId === null || ps.locationGroupId === null)
const patternStopsWithControlPointIndexes = patternStops.filter(ps => ps.locationId !== null || ps.locationGroupId !== null)
// Associate pattern stops with control point indices.
while (controlPoints[cpIndex]) {
if (controlPoints[cpIndex].pointType === POINT_TYPE.STOP) {
Expand All @@ -79,8 +79,10 @@ export default class PatternStopsLayer extends Component<Props> {
}
return (
<div id='PatternStops'>
{patternStopsWithControlPointIndexes.map((patternStop, index) => {
const {cpIndex, stopId, locationId, locationGroupId} = patternStop
{patternStops.map((patternStop, index) => {
const matchedPatternStop = patternStopsWithControlPointIndexes.find(ps => ps.stopId === patternStop.stopId)
const {stopId, locationId, locationGroupId} = patternStop
const cpIndex = matchedPatternStop ? matchedPatternStop.cpIndex : null
const stop = activePatternStops.find(s => s && s.stop_id === stopId)
const location = activePatternLocations.find(l => l && l.location_id === locationId)
const locationGroup = activePatternLocationGroups.find(l => l && l.location_group_id === locationGroupId)
Expand Down

0 comments on commit bf947a6

Please sign in to comment.