This commit is contained in:
portree_kid 2020-03-20 17:30:53 +01:00
parent ffca8da053
commit ec629a7ef4
6 changed files with 13 additions and 9 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 257 KiB

View File

@ -43,9 +43,11 @@ L.RunwayNode = L.Marker.extend({
});
},
highlight() {
var style = {};
style['color'] = 'red';
this.setStyle(style);
try {
this._icon.style['color'] = 'red';
} catch (error) {
console.error(error);
}
},
extensions: function (editLayer) {
this.options.attributes = {};

View File

@ -133,7 +133,7 @@ var mapParkings = function (o) {
var lat = convertLat(o.getLatLng());
var lon = convertLon(o.getLatLng());
// <Parking index="0" type="gate" name="GA_Parking" lat="S9 25.739923" lon="E160 2.927602" heading="67" radius="44" airlineCodes="" />
return { '@index': String(o['id']), '@type': o.options.attributes.type, '@name': o.options.attributes.name, '@lat': lat, '@lon': lon, '@heading': Number(o.options.attributes.heading+180), '@radius': String(o.options.attributes.radius) };
return { '@index': String(o['id']), '@type': o.options.attributes.type, '@name': o.options.attributes.name, '@lat': lat, '@lon': lon, '@heading': Number(o.options.attributes.heading%360), '@radius': String(o.options.attributes.radius) };
}
}
@ -143,7 +143,7 @@ var mapRunwayNodes = function (o) {
return { '@index': String(o['glueindex']), '@lat': convertLat(o._latlng), '@lon': convertLon(o._latlng), '@isOnRunway': '1', '@holdPointType': 'none' };
}
if (o instanceof L.HoldNode) {
return { '@index': String(o['glueindex']), '@lat': convertLat(o._latlng), '@lon': convertLon(o._latlng), '@isOnRunway': '0', '@holdPointType': o['holdPointType'] };
// return { '@index': String(o['glueindex']), '@lat': convertLat(o._latlng), '@lon': convertLon(o._latlng), '@isOnRunway': '0', '@holdPointType': o['holdPointType'] };
}
}

View File

@ -73,16 +73,18 @@ async function checkGroundnet(data) {
if(ok) {
okNodes.push(parkingNode);
okNodes.push(runwayNode);
}
} else {
console.log(`No route from ${parkingNode} to ${runwayNode}`);
}
this.postMessage(['progress', 1]);
});
});
okNodes = okNodes.filter((v,i) => okNodes.indexOf(v) === i);
var allLegitimateEndNodes = parkings.concat(runwayNodes);
var notOkNodes = allLegitimateEndNodes.filter(
var allLegitimateEndNodes = parkings.concat(runwayNodes).concat(pushbackNodes);
var notOkNodes = parkings.concat(runwayNodes).filter(
(v,i) => okNodes.indexOf(v) < 0
).map(
id => {return {id:id, message:'Node not connected'}}
id => {return {id:id, message:'No way to each runway'}}
);
if (parkings.length === 0) {
notOkNodes.push({id:0, message:'No parkings'});