Loading on startup
This commit is contained in:
parent
ac620043a1
commit
67cca39c0b
5
package-lock.json
generated
5
package-lock.json
generated
@ -9173,6 +9173,11 @@
|
|||||||
"resolved": "https://registry.npmjs.org/geo-coordinates-parser/-/geo-coordinates-parser-1.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/geo-coordinates-parser/-/geo-coordinates-parser-1.2.3.tgz",
|
||||||
"integrity": "sha512-d5yj0zfkN4K2tIE877cg0lWofCo+JnWIjX2JMtBOMVgU76DrqEWgKuxZnp0L+hbSkmi1bot22M7a7Go5TNEVJg=="
|
"integrity": "sha512-d5yj0zfkN4K2tIE877cg0lWofCo+JnWIjX2JMtBOMVgU76DrqEWgKuxZnp0L+hbSkmi1bot22M7a7Go5TNEVJg=="
|
||||||
},
|
},
|
||||||
|
"geodesy": {
|
||||||
|
"version": "2.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/geodesy/-/geodesy-2.2.0.tgz",
|
||||||
|
"integrity": "sha512-pNCjfcmU9Q27SJpSLIN0deidCEhGtQvxA7cH28bJKn2lV1xFA4fxfHeYAmGAXqJBQvPIqZsWWvytkJNkL+k2Ug=="
|
||||||
|
},
|
||||||
"geojson-equality": {
|
"geojson-equality": {
|
||||||
"version": "0.1.6",
|
"version": "0.1.6",
|
||||||
"resolved": "https://registry.npmjs.org/geojson-equality/-/geojson-equality-0.1.6.tgz",
|
"resolved": "https://registry.npmjs.org/geojson-equality/-/geojson-equality-0.1.6.tgz",
|
||||||
|
@ -63,6 +63,7 @@
|
|||||||
"file-url": "^3.0.0",
|
"file-url": "^3.0.0",
|
||||||
"fs": "0.0.1-security",
|
"fs": "0.0.1-security",
|
||||||
"geo-coordinates-parser": "^1.2.3",
|
"geo-coordinates-parser": "^1.2.3",
|
||||||
|
"geodesy": "^2.2.0",
|
||||||
"idb": "^4.0.5",
|
"idb": "^4.0.5",
|
||||||
"jquery": "^3.4.1",
|
"jquery": "^3.4.1",
|
||||||
"leaflet": "^1.5.1",
|
"leaflet": "^1.5.1",
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
mounted () {
|
mounted () {
|
||||||
this.$store.dispatch('getAirports')
|
this.$store.dispatch('getAirports')
|
||||||
this.$store.subscribe((mutation, state) => {
|
this.$store.subscribe((mutation, state) => {
|
||||||
if (mutation.type === 'BOUNDS') {
|
if (mutation.type === 'BOUNDS' || mutation.type === 'SET_AIRPORTS') {
|
||||||
// console.log(this.$parent)
|
// console.log(this.$parent)
|
||||||
// console.log(this.$store.state.Settings.bounds)
|
// console.log(this.$store.state.Settings.bounds)
|
||||||
let airportsToLoad = this.$store.state.Airports.airports
|
let airportsToLoad = this.$store.state.Airports.airports
|
||||||
@ -65,6 +65,8 @@
|
|||||||
this.$refs.pavementLayer.load(airportsToLoad[0])
|
this.$refs.pavementLayer.load(airportsToLoad[0])
|
||||||
this.editingAirport = airportsToLoad[0]
|
this.editingAirport = airportsToLoad[0]
|
||||||
}
|
}
|
||||||
|
this.$refs.airportLayer.setVisible(this.zoom < 12)
|
||||||
|
|
||||||
// console.log(this.groundnet)
|
// console.log(this.groundnet)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -81,6 +83,9 @@
|
|||||||
methods: {
|
methods: {
|
||||||
visible (feature) {
|
visible (feature) {
|
||||||
let bounds = this.$store.state.Settings.bounds
|
let bounds = this.$store.state.Settings.bounds
|
||||||
|
if (!bounds.hasOwnProperty('getNorthEast')) {
|
||||||
|
bounds = this.$refs.map.mapObject.getBounds()
|
||||||
|
}
|
||||||
let coordinates = feature.geometry.coordinates
|
let coordinates = feature.geometry.coordinates
|
||||||
let ret = bounds.getNorthEast().lat > Number(coordinates[1]) &&
|
let ret = bounds.getNorthEast().lat > Number(coordinates[1]) &&
|
||||||
bounds.getNorthEast().lng > Number(coordinates[0])
|
bounds.getNorthEast().lng > Number(coordinates[0])
|
||||||
@ -110,11 +115,13 @@
|
|||||||
centerUpdated (center) {
|
centerUpdated (center) {
|
||||||
if (center !== this.$store.state.Settings.center) {
|
if (center !== this.$store.state.Settings.center) {
|
||||||
this.$store.dispatch('setCenter', center)
|
this.$store.dispatch('setCenter', center)
|
||||||
|
this.$refs.airportLayer.setVisible(this.zoom < 12)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
boundsUpdated (bounds) {
|
boundsUpdated (bounds) {
|
||||||
if (bounds !== this.$store.state.Settings.bounds) {
|
if (bounds !== this.$store.state.Settings.bounds) {
|
||||||
this.$store.dispatch('setBounds', bounds)
|
this.$store.dispatch('setBounds', bounds)
|
||||||
|
this.$refs.airportLayer.setVisible(this.zoom < 12)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
const lineReader = require('readline');
|
const lineReader = require('readline');
|
||||||
const zlib = require('zlib');
|
const zlib = require('zlib');
|
||||||
const turf = require('@turf/turf');
|
// const geodesy = require('geodesy');
|
||||||
|
const LatLonEllipsoidal = require( 'geodesy/latlon-ellipsoidal-vincenty.js').default;
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
module.exports.readPavement = function (f, icao, cb) {
|
module.exports.readPavement = function (f, icao, cb) {
|
||||||
@ -52,34 +53,32 @@ var scanMethods = {
|
|||||||
100: (line, icao, layerGroup) => {
|
100: (line, icao, layerGroup) => {
|
||||||
if (module.exports.isScanning) {
|
if (module.exports.isScanning) {
|
||||||
console.log('Runway ', line );
|
console.log('Runway ', line );
|
||||||
var point1 = turf.point([line[9], line[10]]);
|
var point1 = new LatLonEllipsoidal(Number(line[9]), Number(line[10]));
|
||||||
var point2 = turf.point([line[18], line[19]]);
|
var point2 = new LatLonEllipsoidal(Number(line[18]), Number(line[19]));
|
||||||
|
|
||||||
var runwayPoints = [];
|
var runwayPoints = [];
|
||||||
|
|
||||||
var bearing = turf.bearing(point1, point2);
|
var bearing = point1.initialBearingTo(point2);
|
||||||
var runwayEnd1 = [line[9], line[10]];
|
var runwayWidth = Number(line[1]);
|
||||||
var runwayEnd2 = [line[18], line[19]];
|
var destination = point1.destinationPoint( 1000, bearing);
|
||||||
var runwayWidth = Number(line[1])/1000;
|
|
||||||
var destination = turf.destination(point1, runwayWidth/2, bearing, {});
|
|
||||||
|
|
||||||
runwayPoints.push(turf.destination(point1, runwayWidth/2, bearing+90, {}));
|
runwayPoints.push(point1.destinationPoint( runwayWidth/2, (bearing+90)));
|
||||||
runwayPoints.push(turf.destination(point2, runwayWidth/2, bearing+90, {}));
|
runwayPoints.push(point2.destinationPoint( runwayWidth/2, (bearing+90)));
|
||||||
runwayPoints.push(turf.destination(point2, runwayWidth/2, bearing-90, {}));
|
runwayPoints.push(point2.destinationPoint( runwayWidth/2, (bearing-90)));
|
||||||
runwayPoints.push(turf.destination(point1, runwayWidth/2, bearing-90, {}));
|
runwayPoints.push(point1.destinationPoint( runwayWidth/2, (bearing-90)));
|
||||||
|
|
||||||
runwayPoints = runwayPoints.map(p => p.geometry.coordinates);
|
|
||||||
|
|
||||||
var runwayPoly = new L.Polygon(runwayPoints);
|
var runwayPoly = new L.Polygon(runwayPoints);
|
||||||
runwayPoly.setStyle({color: 'grey'});
|
runwayPoly.setStyle({color: 'grey'});
|
||||||
runwayPoly.addTo(layerGroup);
|
runwayPoly.addTo(layerGroup);
|
||||||
|
|
||||||
console.log(turf.bearing(point1, point2), turf.bearing(point2, point1));
|
var runwayLine = new L.Polyline([point1,point2]);
|
||||||
console.log(runwayEnd1, runwayEnd2);
|
runwayLine.setStyle({color: 'red'});
|
||||||
|
// runwayLine.addTo(layerGroup);
|
||||||
|
|
||||||
// var end = turf.destination([start.lat, start.lng], this.attributes.radius / 1000, this.attributes.heading - 180, options);
|
|
||||||
|
|
||||||
|
var runwayLine1 = new L.Polyline([point1 ,destination]);
|
||||||
|
runwayLine1.setStyle({color: 'red'});
|
||||||
|
// runwayLine1.addTo(layerGroup);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// Pavement
|
// Pavement
|
||||||
|
Loading…
Reference in New Issue
Block a user