portree_kid 2020-07-01 22:37:25 +02:00
parent 7a75e4f392
commit 921321d3b0
3 changed files with 13 additions and 9 deletions

View File

@ -14,6 +14,7 @@ You should have received a copy of the GNU General Public License along with FG
<Upload :visible.sync="uploadVisible" ref="upload"></Upload>
<ZoomButton icon="fas fa-th" v-on:click="zoomin" :show="true" tooltip="Zoomin"></ZoomButton>
<ZoomButton icon="fas fa-th-large" v-on:click="zoomout" :show="!editing" tooltip="Zoomout"></ZoomButton>
<ZoomButton icon="far fa-eye-slash" v-on:click="hideAPT" :show="!editing" tooltip="Hide APT"></ZoomButton>
<EditButton icon="fas fa-upload" v-on:click="upload" :show="!editing" tooltip="Upload"></EditButton>
<EditButton icon="fas fa-plane" v-on:click="test" :show="!editing" tooltip="Export"></EditButton>
@ -85,7 +86,7 @@ You should have received a copy of the GNU General Public License along with FG
export default {
components: { EditButton, Upload, ZoomButton },
data () {
return {isEditing: false, uploadVisible: false, centerDialogVisible: false, saveDialogVisible: false, checkDialogVisible: false, checking: false, progress: 0, max: 0}
return {isEditing: false, uploadVisible: false, centerDialogVisible: false, saveDialogVisible: false, checkDialogVisible: false, checking: false, progress: 0, max: 0, pavementLayerVisible: true}
},
created () {
},
@ -103,6 +104,10 @@ You should have received a copy of the GNU General Public License along with FG
this.$parent.$parent.$refs.editLayer.stopDrawing()
this.$parent.$parent.zoomUpdated(14)
},
hideAPT() {
this.pavementLayerVisible = !this.pavementLayerVisible
this.$parent.$parent.$refs.pavementLayer.setVisible(this.pavementLayerVisible)
},
edit () {
this.isEditing = true
this.$emit('edit')

View File

@ -209,14 +209,14 @@ You should have received a copy of the GNU General Public License along with FG
if (zoom !== this.$store.state.Settings.zoom) {
this.$store.dispatch('setZoom', zoom)
this.$refs.airportLayer.setVisible(zoom < 12)
this.$refs.pavementLayer.setVisible(zoom < 12)
this.$refs.pavementLayer.setVisible(zoom >= 12)
}
},
async centerUpdated (center) {
if (center !== this.$store.state.Settings.center) {
this.$store.dispatch('setCenter', center)
this.$refs.airportLayer.setVisible(this.zoom < 12)
this.$refs.pavementLayer.setVisible(this.zoom < 12)
this.$refs.pavementLayer.setVisible(this.zoom >= 12)
}
},
async boundsUpdated (bounds) {

View File

@ -25,8 +25,7 @@
this.remove()
},
data () {
return {
}
return {groundnet: Object}
},
methods: {
load (icao) {
@ -57,7 +56,7 @@
this.layerGroup = L.layerGroup()
},
remove () {
if (this.layerGroup) {
if (this.groundnet) {
this.$parent.removeLayer(this.layerGroup)
}
},
@ -67,11 +66,11 @@
}
},
setVisible (visible) {
if (this.layerGroup !== undefined) {
if (this.groundnet !== undefined) {
if (visible) {
this.layerGroup.addTo(this.$parent.mapObject)
this.groundnet.addTo(this.$parent.mapObject)
} else {
this.layerGroup.removeFrom(this.$parent.mapObject)
this.groundnet.removeFrom(this.$parent.mapObject)
}
}
}