Heading Edit

This commit is contained in:
portree_kid 2020-05-24 11:15:25 +02:00
parent 1f395e2157
commit 7142373c2a
2 changed files with 27 additions and 0 deletions

View File

@ -83,6 +83,14 @@
<el-input placeholder="Please input" v-model="coordinates" :disabled="!editing"></el-input>
</el-col>
</el-row>
<el-row>
<el-col :span="7">
<span class="label">Heading :</span>
</el-col>
<el-col :span="17">
<el-input-number v-model="heading" :min="-1" :max="361" step=0.1 :disabled="!editing"></el-input-number>
</el-col>
</el-row>
<el-row>
<el-col :span="7">
<span class="label">Parking Type :</span>
@ -207,6 +215,22 @@
this.$parent.$parent.$parent.$refs.editLayer.setPointCoords(this.$store.state.Editable.index, position)
}
},
heading: {
// getter
get: function () {
return Number(this.$store.state.Editable.data.parking.heading)
},
// setter
set: function (newValue) {
if (newValue>=360) {
newValue -= 360
}
if (newValue<0) {
newValue += 360
}
this.$store.commit('SET_EDIT_PARKING_HEADING', newValue)
}
},
wingspan: {
// getter
get: function () {

View File

@ -55,6 +55,9 @@ const mutations = {
'SET_EDIT_PARKING_NUMBER' (state, parkingName) {
Vue.set(state.data.parking, 'number', parkingName)
},
'SET_EDIT_PARKING_HEADING' (state, heading) {
Vue.set(state.data.parking, 'heading', heading)
},
'SET_EDIT_PARKING_AIRLINES' (state, airlineCodes) {
Vue.set(state.data.parking, 'airlineCodes', airlineCodes)
},