Skip to content
This repository was archived by the owner on Dec 6, 2019. It is now read-only.

Commit aacb49a

Browse files
Nabeel Shahzadnabeelio
authored andcommitted
Check that lat/lng are in the points
1 parent 18a359f commit aacb49a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

core/templates/route_map.tpl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,12 @@ points.push(depCoords);
9292
9393
// rendering for if there's smartcars data
9494
if(flight.rawdata instanceof Object && Array.isArray(flight.rawdata.points)) {
95-
console.log('using raw data');
9695
$.each(flight.rawdata.points, function(i, nav) {
97-
const loc = L.latLng(nav.lat, nav.lng);
98-
points.push(loc);
96+
if(nav.lat === undefined || nav.lng === undefined) {
97+
return;
98+
}
99+
100+
points.push(L.latLng(nav.lat, nav.lng));
99101
});
100102
} else {
101103
$.each(flight.route_details, function(i, nav) {

0 commit comments

Comments
 (0)