From 945dc6bf301b7e30480842bfbb5e10bc01ec4fd1 Mon Sep 17 00:00:00 2001 From: Keith Paterson Date: Sat, 4 May 2019 18:06:18 +0200 Subject: [PATCH] Fixed TypeError: L.aiLayer is not a function error in Phi --- Phi/topics/Map/AILayer.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Phi/topics/Map/AILayer.js b/Phi/topics/Map/AILayer.js index 9fbb1ed90..2f070a1c1 100644 --- a/Phi/topics/Map/AILayer.js +++ b/Phi/topics/Map/AILayer.js @@ -41,8 +41,7 @@ var l1 = feature.properties.callsign, l2 = feature.properties.heading + 'T ' + feature.properties.speed + 'KTAS ' + formatFL(feature.geometry.coordinates[2]), - l3 = feature.properties.departureAirportId + ' -> ' + feature.properties.arrivalAirportId, - l4 = ; + l3 = feature.properties.departureAirportId + ' -> ' + feature.properties.arrivalAirportId; aiMarker = L.aiAircraftMarker(latlng, { className: AITypeToCssClassMap[feature.properties.type] } ); @@ -144,7 +143,7 @@ types.forEach(function(type) { root.getChildren(type).forEach(function(child) { - if (!child.getNode("valid").getValue()) + if (!child.getNode("valid") || !child.getNode("valid").getValue()) return; var path = child.getPath();