Minor changes

This commit is contained in:
portree_kid 2020-02-14 13:32:17 +01:00
parent 77bb7c5ba6
commit 07c7caff2f
2 changed files with 13 additions and 2 deletions

View File

@ -391,6 +391,17 @@
writeGroundnetXML(this.$store.state.Settings.settings.airportsDirectory, this.icao, xml) writeGroundnetXML(this.$store.state.Settings.settings.airportsDirectory, this.icao, xml)
}, },
setVisible(visible) { setVisible(visible) {
if (this.layerGroup) {
if (visible) {
this.layerGroup.addTo(this.$parent.mapObject)
} else {
this.layerGroup.removeFrom(this.$parent.mapObject)
}
}
if (this.groundnetLayerGroup === undefined) {
return;
}
if (visible) { if (visible) {
this.groundnetLayerGroup.addTo(this.$parent.mapObject) this.groundnetLayerGroup.addTo(this.$parent.mapObject)
} else { } else {

View File

@ -122,13 +122,13 @@
this.$refs.airportLayer.setVisible(zoom < 12) this.$refs.airportLayer.setVisible(zoom < 12)
} }
}, },
centerUpdated (center) { async 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) this.$refs.airportLayer.setVisible(this.zoom < 12)
} }
}, },
boundsUpdated (bounds) { async 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) this.$refs.airportLayer.setVisible(this.zoom < 12)