diff --git a/src/components/map/LocationInfo.tsx b/src/components/map/LocationInfo.tsx index ec953a7..3559635 100644 --- a/src/components/map/LocationInfo.tsx +++ b/src/components/map/LocationInfo.tsx @@ -77,6 +77,7 @@ const LocationInfo: React.FC<{}> = () => { const findNotes = async () => { setNotes(undefined); + setNoteIndex(0); const metresPerDegree = 111111 * Math.cos((scope.center.lat * Math.PI) / 180); const deltaDegrees = 2000 / metresPerDegree; @@ -249,41 +250,42 @@ const LocationInfo: React.FC<{}> = () => { /> - {notes.features[noteIndex].properties.comments.map( - (comment: any, index: number) => ( - - - - - - ) - )} + {noteIndex < notes.features.length && + notes.features[noteIndex].properties.comments.map( + (comment: any, index: number) => ( + + + + + + ) + )}