don't draw lines for unlocated events in narrative mode

This commit is contained in:
Lachlan Kermode
2018-12-26 12:33:08 +01:00
parent 2f05533a20
commit ede2f1efaa

View File

@@ -39,10 +39,18 @@ class MapNarratives extends React.Component {
return 1;
}
hasNoLocation(step) {
return (step.latitude === '' || step.longitude === '')
}
renderNarrativeStep(allSteps, step, idx, n) {
const { x, y } = this.projectPoint([step.latitude, step.longitude]);
const step2 = allSteps[idx + 1];
// don't draw if one of the steps has no location
if (this.hasNoLocation(step) || this.hasNoLocation(step2))
return null
const p2 = this.projectPoint([step2.latitude, step2.longitude]);
return (