Centerlines

This commit is contained in:
portree_kid 2020-04-11 21:51:24 +02:00
parent 4c76d30010
commit 677695d0ba

View File

@ -317,16 +317,28 @@ var scanMethods = {
runwayPoints.push(point1.destinationPoint(runwayWidth / 2, (bearing + 90))); 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(point2.destinationPoint(runwayWidth / 2, (bearing - 90))); runwayPoints.push(point2.destinationPoint(runwayWidth / 2, (bearing - 90)));
runwayPoints.push(point1.destinationPoint(runwayWidth / 2, (bearing - 90))); runwayPoints.push(point1.destinationPoint(runwayWidth / 2, (bearing - 90)));
var runwayPoly = new L.Polygon(runwayPoints); var runwayPoly = new L.Polygon(runwayPoints);
runwayPoly.setStyle({ color: 'grey', interactive: false }); runwayPoly.setStyle({ color: 'grey', interactive: false });
runwayPoly.addTo(layerGroup); runwayPoly.addTo(layerGroup);
var runwayLine = new L.Polyline([point1, point2]); var displacedEnd1 = point1.destinationPoint(Number(line[20]), bearing)
runwayLine.setStyle({ color: 'red' }); var displacedEnd2 = point2.destinationPoint(Number(line[20]), bearing-180)
// runwayLine.addTo(layerGroup);
var runwayLine = new L.Polyline([displacedEnd1, displacedEnd2]);
runwayLine.setStyle({ color: 'yellow', stroke: true, dashArray: [50,50] });
runwayLine.addTo(layerGroup);
var t1 = new L.Polyline([displacedEnd1.destinationPoint(runwayWidth / 2, (bearing - 90)),
displacedEnd1.destinationPoint(runwayWidth / 2, (bearing + 90))]);
t1.setStyle({ color: 'yellow' });
t1.addTo(layerGroup);
var t2 = new L.Polyline([displacedEnd2.destinationPoint(runwayWidth / 2, (bearing - 90)),
displacedEnd2.destinationPoint(runwayWidth / 2, (bearing + 90))]);
t2.setStyle({ color: 'yellow' });
t2.addTo(layerGroup);
var runwayLine1 = new L.Polyline([point1, destination]); var runwayLine1 = new L.Polyline([point1, destination]);
runwayLine1.setStyle({ color: 'red' }); runwayLine1.setStyle({ color: 'red' });