Skip to content

Commit

Permalink
Fixes undefined property error
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishan Ajwani authored and Ishan Ajwani committed Mar 23, 2024
1 parent 2761085 commit 3639918
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions client/src/components/FlightMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,7 @@ const FlightPlanMap = props => {


const handleClick = event => {
let waypointNum = props.getters.Awaypoint[0].num
console.log(waypointNum)
console.log(props.getters.path[2])


if (["disabled", "distance"].includes(props.getters.placementMode) || ["jump"].includes(props.getters.placementType)) {
return
Expand Down Expand Up @@ -346,7 +344,9 @@ const FlightPlanMap = props => {
const getTargetWaypoint = () => {

if (props.getters.Awaypoint.length > 0 && props.getters.planePoints.length > 0 && props.getters.path) {
let waypointNum = props.getters.Awaypoint[0].num

let waypointNum = props.getters.Awaypoint[0].num % props.getters.path.length

return [props.getters.planePoints[props.getters.planePoints.length - 1], props.getters.path[waypointNum]]
}
return []
Expand Down Expand Up @@ -520,15 +520,15 @@ const FlightPlanMap = props => {
})}
</LayerGroup>
</LayersControl.Overlay>
<LayersControl.Overlay checked name="test">
<LayersControl.Overlay checked name={props.display.airdropBoundary[1]}>
<LayerGroup>
<Polyline positions={props.getters.planePoints.slice(-20)} color="#8a2be2" weight={3} />
{props.getters.planePoints.map((marker, index) => {
return popup(marker, index, "uavPath")
})}
</LayerGroup>
</LayersControl.Overlay>
<LayersControl.Overlay checked name="test">
<LayersControl.Overlay checked name={props.display.airdropBoundary[1]}>
<LayerGroup>
<Polyline positions={getTargetWaypoint()} color="#FFFFFF" weight={3} />
{props.getters.planePoints.map((marker, index) => {
Expand Down

0 comments on commit 3639918

Please sign in to comment.