From 228f16994ba8dcaea478d4fdf4c02746784ed9f6 Mon Sep 17 00:00:00 2001 From: portree_kid Date: Wed, 10 Jun 2020 07:09:39 +0200 Subject: [PATCH] APT Dat 715 Segments (Line code 10) --- package.json | 3 ++- src/renderer/loaders/pavement_loader.js | 31 +++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 798a21b..c7d602c 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,8 @@ "allowToChangeInstallationDirectory": true }, "linux": { - "icon": "build/icons" + "icon": "build/icons", + "target": "AppImage" } }, "dependencies": { diff --git a/src/renderer/loaders/pavement_loader.js b/src/renderer/loaders/pavement_loader.js index e1e91c4..44ae814 100644 --- a/src/renderer/loaders/pavement_loader.js +++ b/src/renderer/loaders/pavement_loader.js @@ -301,6 +301,37 @@ var scanMethods = { module.exports.isScanning = false; } }, + // APTDAT 715 Segment + 10: (line, icao, layerGroup) => { + if (module.exports.isScanning) { + //var marker = new L.marker([line[1], line[2]], { title: '10 Point', color: 'fuchsia' }); + //marker.bindTooltip(String(line), { className: "my-label", offset: [0, 0] }); + //marker.addTo(layerGroup); + var pointMiddle = new LatLonEllipsoidal(Number(line[1]), Number(line[2])); + var point1 = pointMiddle.destinationPoint(line[5]/6.562, line[4]); + var point2 = pointMiddle.destinationPoint(line[5]/6.562, line[4]-180); + + //var runwayPoly2 = new L.Polygon([point1, point2]); + //var marker2 = new L.marker(point2, { title: '10 Point 2', color: 'fuchsia' }); + //marker2.bindTooltip(String(line), { className: "my-label", offset: [0, 0] }); + //marker2.addTo(layerGroup); + //runwayPoly2.setStyle({ color: 'red', interactive: false }); + //runwayPoly2.addTo(layerGroup); + var runwayPoints = []; + + var bearing = point1.initialBearingTo(point2); + var runwayWidth = Number(line[8])/3.281; + + runwayPoints.push(point1.destinationPoint(runwayWidth / 2, (bearing + 90))); + runwayPoints.push(point2.destinationPoint(runwayWidth / 2, (bearing + 90))); + runwayPoints.push(point2.destinationPoint(runwayWidth / 2, (bearing - 90))); + runwayPoints.push(point1.destinationPoint(runwayWidth / 2, (bearing - 90))); + + var runwayPoly = new L.Polygon(runwayPoints); + runwayPoly.setStyle({ color: 'grey', fillColor: 'grey', opacity: 0.5, fillOpacity: 0.5, interactive: false }); + runwayPoly.addTo(layerGroup); + } + }, // Runway 100: (line, icao, layerGroup) => { if (module.exports.isScanning) {