Parking group selection

This commit is contained in:
portree_kid 2020-06-30 21:45:00 +02:00
parent 57b83daa51
commit 72dc611764
5 changed files with 15 additions and 13 deletions

View File

@ -45,12 +45,15 @@
export default {
data () {
return {activeTab: 'first', editLayer: null}
return {activeTab: 'first', editing: Boolean}
},
components: {
Frequency, ParkingList
},
methods: {
setEditing (editing) {
this.editing = editing
},
addFrequency () {
this.$store.dispatch('addFrequency', {type: 'AWOS', value: 0})
},
@ -66,14 +69,6 @@ export default {
}
},
computed: {
editing: {
get: function () {
if (this.editLayer === null) {
this.initLayer()
}
return this.editLayer !== null && this.editLayer.editing
}
},
icao: function () {
return this.$store.state.Airports.currentAirport.icao
},

View File

@ -118,8 +118,10 @@ You should have received a copy of the GNU General Public License along with FG
methods: {
onSelectedPolygon (ring) {
var parkings = this.$refs.editLayer.getParkings(ring)
console.log(ring)
console.log(parkings)
console.debug(ring)
console.debug(parkings)
this.$store.commit('SET_EDIT_TYPE', 'parking-group')
this.$refs.sidebar.setData(parkings)
},
onEdit (event) {

View File

@ -40,7 +40,7 @@ You should have received a copy of the GNU General Public License along with FG
<ArcEdit></ArcEdit>
<NodeEdit></NodeEdit>
<ParkingGroupEdit ref="parkingGroupEdit" @edit="(msg) => $emit('edit', msg)"></ParkingGroupEdit>
<AirportEdit></AirportEdit>
<AirportEdit ref="airportEdit"></AirportEdit>
</div>
<!--
<div class="leaflet-sidebar-pane" id="parking">
@ -137,6 +137,7 @@ You should have received a copy of the GNU General Public License along with FG
},
setEditing (editing) {
this.$refs.parkingGroupEdit.setEditing(editing)
this.$refs.airportEdit.setEditing(editing)
},
setData (data) {
if (data.length > 0) {

View File

@ -175,7 +175,8 @@ const convert = require('geo-coordinates-parser');
},
computed: {
parking: function () {
return this.data !== null
return this.data !== null && this.$store.state.Editable.type === 'parking-group'
},
airlines: function () {
var airlineCodes = [];

View File

@ -13,6 +13,9 @@ const SET_EDIT_ARC = 'SET_EDIT_ARC'
const SET_EDIT_RUNWAY = 'SET_EDIT_RUNWAY'
const mutations = {
SET_EDIT_TYPE (state, type) {
state.type = type
},
SET_EDIT (state, editing) {
state.editing = editing
},