|
|
@@ -240,7 +240,7 @@ function getLinesRouter(lineProps, lineAndMarkerStyle) {
|
|
|
coordinates = []
|
|
|
|
|
|
const pointBefore = i == 0 ? startPoint : passPoints[i - 1]
|
|
|
- const pointAfter = i == passPoints.length - 1 ? endPoint : passPoints[i + 1]
|
|
|
+ const pointAfter = i == passPoints.length - 1 ? (endPoint ? endPoint : passPoints[passPoints.length - 1]) : passPoints[i + 1]
|
|
|
|
|
|
lines.push({lineWidth, strokeColor, coordinates: getAirwayPoints(obj, pointBefore, pointAfter)})
|
|
|
}
|
|
|
@@ -381,6 +381,9 @@ function getPolygon(polygonProps, polygonAndMarkerStyle) {
|
|
|
|
|
|
if (Array.isArray(polygonProps[pointsFix])) {
|
|
|
for (let obj of polygonProps[pointsFix]) {
|
|
|
+ if (!obj) {
|
|
|
+ continue
|
|
|
+ }
|
|
|
coordinates.push(drawLineConfig(obj.lat, obj.lng, dataType));
|
|
|
markers.push(addOvalPointConfig(obj.lat, obj.lng, imageName, dataType));
|
|
|
}
|