diff --git a/src/renderer/components/ArcEdit.vue b/src/renderer/components/ArcEdit.vue
new file mode 100644
index 0000000..4d62b1e
--- /dev/null
+++ b/src/renderer/components/ArcEdit.vue
@@ -0,0 +1,52 @@
+
+
+
+
+
diff --git a/src/renderer/components/EditLayer.vue b/src/renderer/components/EditLayer.vue
index 05aac05..93e5784 100644
--- a/src/renderer/components/EditLayer.vue
+++ b/src/renderer/components/EditLayer.vue
@@ -14,28 +14,13 @@
name: 'edit-layer',
props: [],
created () {
- this.$store.subscribe((mutation, state) => {
- if (mutation.type === 'BOUNDS') {
- // console.log(this.$parent)
- // console.log(this.$store.state.Settings.bounds)
- let airportsToLoad = this.$store.state.Airports.airports
- .filter(feature => this.visible(feature))
- .map(feature => feature.properties.icao)
- if (airportsToLoad[0] !== this.editingAirport) {
- this.groundnet = readGroundnetXML(this.$store.state.Settings.settings.airportsDirectory, airportsToLoad[0])
- this.groundnet.addTo(this.$parent.mapObject)
- this.editingAirport = airportsToLoad[0]
- }
- // console.log(this.groundnet)
- }
- })
- },
- mounted () {
console.log(LMap)
console.log(LMarker)
console.log(L)
console.log(LEdit)
},
+ mounted () {
+ },
beforeDestroy () {
this.remove()
},
@@ -44,6 +29,17 @@
}
},
methods: {
+ load (icao) {
+ this.groundnet = readGroundnetXML(this.$store.state.Settings.settings.airportsDirectory, icao)
+ this.groundnet.addTo(this.$parent.mapObject)
+ this.groundnet.eachLayer(l => {
+ l.enableEdit()
+ if (typeof l.extensions === 'function') {
+ l.extensions()
+ }
+ l.bringToFront()
+ })
+ },
visible (feature) {
let bounds = this.$store.state.Settings.bounds
let coordinates = feature.geometry.coordinates
diff --git a/src/renderer/components/FlightgearMap.vue b/src/renderer/components/FlightgearMap.vue
index 8566317..1fd2343 100644
--- a/src/renderer/components/FlightgearMap.vue
+++ b/src/renderer/components/FlightgearMap.vue
@@ -10,8 +10,7 @@
-
-
+
+
@@ -47,6 +47,21 @@
props: [],
mounted () {
this.$store.dispatch('getAirports')
+ this.$store.subscribe((mutation, state) => {
+ if (mutation.type === 'BOUNDS') {
+ // console.log(this.$parent)
+ // console.log(this.$store.state.Settings.bounds)
+ let airportsToLoad = this.$store.state.Airports.airports
+ .filter(feature => this.visible(feature))
+ .map(feature => feature.properties.icao)
+ if (airportsToLoad[0] !== this.editingAirport) {
+ this.$refs.editLayer.load(airportsToLoad[0])
+ this.$refs.pavementLayer.load(airportsToLoad[0])
+ this.editingAirport = airportsToLoad[0]
+ }
+ // console.log(this.groundnet)
+ }
+ })
},
data () {
return {
@@ -58,19 +73,28 @@
}
},
methods: {
+ visible (feature) {
+ let bounds = this.$store.state.Settings.bounds
+ let coordinates = feature.geometry.coordinates
+ let ret = bounds.getNorthEast().lat > Number(coordinates[1]) &&
+ bounds.getNorthEast().lng > Number(coordinates[0])
+ let ret2 = bounds.getSouthWest().lat < Number(coordinates[1]) &&
+ bounds.getSouthWest().lng < Number(coordinates[0])
+ return ret && ret2
+ },
onClick (item) {
console.log(item)
this.$store.commit('SET_EDIT_AIRPORT', item)
},
zoomUpdated (zoom) {
- this.$store.commit('ZOOM', zoom)
+ this.$store.dispatch('setZoom', zoom)
console.log(this.$refs.airportLayer.setVisible(zoom < 12))
},
centerUpdated (center) {
- this.$store.commit('CENTER', center)
+ this.$store.dispatch('setCenter', center)
},
boundsUpdated (bounds) {
- this.$store.commit('BOUNDS', bounds)
+ this.$store.dispatch('setBounds', bounds)
}
},
computed: {
diff --git a/src/renderer/components/GroundnetEdit.vue b/src/renderer/components/GroundnetEdit.vue
new file mode 100644
index 0000000..3315af1
--- /dev/null
+++ b/src/renderer/components/GroundnetEdit.vue
@@ -0,0 +1,53 @@
+
+
+
+
+
diff --git a/src/renderer/components/LeafletSidebar.vue b/src/renderer/components/LeafletSidebar.vue
index 3aaf56a..55b5c64 100644
--- a/src/renderer/components/LeafletSidebar.vue
+++ b/src/renderer/components/LeafletSidebar.vue
@@ -24,6 +24,8 @@