portree_kid 2020-07-10 21:44:51 +02:00
parent d4aa4b09a0
commit 7e032e73b2
2 changed files with 24 additions and 10 deletions

View File

@ -62,6 +62,8 @@ You should have received a copy of the GNU General Public License along with FG
import ToolLayer from './ToolLayer' import ToolLayer from './ToolLayer'
import PavementLayer from './PavementLayer' import PavementLayer from './PavementLayer'
import ThresholdLayer from './ThresholdLayer' import ThresholdLayer from './ThresholdLayer'
import { Loading } from 'element-ui'
import L from 'leaflet' import L from 'leaflet'
// https://github.com/KoRiGaN/Vue2Leaflet/issues/103 // https://github.com/KoRiGaN/Vue2Leaflet/issues/103
@ -86,10 +88,15 @@ You should have received a copy of the GNU General Public License along with FG
.filter(feature => this.visible(feature)) .filter(feature => this.visible(feature))
.map(feature => feature.properties.icao) .map(feature => feature.properties.icao)
if (airportsToLoad.length > 0 && airportsToLoad[0] !== this.editingAirport && this.zoom > 12) { if (airportsToLoad.length > 0 && airportsToLoad[0] !== this.editingAirport && this.zoom > 12) {
this.$refs.pavementLayer.load(airportsToLoad[0]) let loadingInstance = Loading.service({ fullscreen: true })
this.$refs.editLayer.load(airportsToLoad[0])
this.$refs.thresholdLayer.load(airportsToLoad[0]) this.$nextTick(() => { // Loading should be closed asynchronously
this.editingAirport = airportsToLoad[0] this.$refs.pavementLayer.load(airportsToLoad[0])
this.$refs.editLayer.load(airportsToLoad[0])
this.$refs.thresholdLayer.load(airportsToLoad[0])
loadingInstance.close()
this.editingAirport = airportsToLoad[0]
})
} }
if (this.$refs.editLayer) { if (this.$refs.editLayer) {
this.$refs.editLayer.setVisible(this.zoom >= 12) this.$refs.editLayer.setVisible(this.zoom >= 12)

View File

@ -10,7 +10,7 @@ var turf;
if(process.env.NODE_ENV === 'development') { if(process.env.NODE_ENV === 'development') {
importScripts('../../../node_modules/dijkstrajs/dijkstra.js'); importScripts('../../../node_modules/dijkstrajs/dijkstra.js');
turf = require('../../../../../@turf/turf'); turf = require('./node_modules/@turf/turf');
} else { } else {
importScripts('dijkstra.js'); importScripts('dijkstra.js');
turf = require('@turf/turf') turf = require('@turf/turf')
@ -119,7 +119,7 @@ async function checkGroundnet(data) {
this.postMessage(['progress', 1]); this.postMessage(['progress', 1]);
}); });
}); });
// Check pushback parkings // Build pushback graph
var noPushbackGraph = {}; var noPushbackGraph = {};
parkings.forEach(element => { parkings.forEach(element => {
noPushbackGraph[element] = {}; noPushbackGraph[element] = {};
@ -131,6 +131,7 @@ async function checkGroundnet(data) {
noPushbackGraph[element.start] = {}; noPushbackGraph[element.start] = {};
noPushbackGraph[element.end] = {}; noPushbackGraph[element.end] = {};
}); });
// add all pushback edges
edges.filter(element => element.isPushBackRoute).forEach(element => { edges.filter(element => element.isPushBackRoute).forEach(element => {
var node1 = noPushbackGraph[Number(element.start)]; var node1 = noPushbackGraph[Number(element.start)];
node1[Number(element.end)] = 1; node1[Number(element.end)] = 1;
@ -147,7 +148,16 @@ async function checkGroundnet(data) {
pushbackNodes.forEach(pushbackNode => { pushbackNodes.forEach(pushbackNode => {
var numRoutes = checkRoute(noPushbackGraph, parkingNode, pushbackNode); var numRoutes = checkRoute(noPushbackGraph, parkingNode, pushbackNode);
if (numRoutes===0) { if (numRoutes===0) {
okPushbacks.push(parkingNode); /*
if(parkingNode===14) {
debugger;
}
*/
if (multiplePushbackRoutes[parkingNode]===undefined &&
Object.keys(noPushbackGraph[parkingNode])>0) {
// Only when there is a edge leaving
multiplePushbackRoutes[parkingNode] = [];
}
} else if (numRoutes===1){ } else if (numRoutes===1){
if (multiplePushbackRoutes[parkingNode]===undefined) { if (multiplePushbackRoutes[parkingNode]===undefined) {
multiplePushbackRoutes[parkingNode] = [pushbackNode]; multiplePushbackRoutes[parkingNode] = [pushbackNode];
@ -181,9 +191,6 @@ async function checkGroundnet(data) {
return this[e] != undefined && this[e].length != 1; return this[e] != undefined && this[e].length != 1;
} }
, multiplePushbackRoutes).map( , multiplePushbackRoutes).map(
//multiplePushbackRoutes.push();
id => { id => {
var endPoints = multiplePushbackRoutes[id]; var endPoints = multiplePushbackRoutes[id];
if( endPoints.length<1) if( endPoints.length<1)