ICAO Control

This commit is contained in:
portree_kid 2020-03-08 15:34:19 +01:00
parent 76db33a686
commit 06f630afab
2 changed files with 25 additions and 8 deletions

View File

@ -75,11 +75,11 @@
if (this.groundnetLayerGroup !== undefined) { if (this.groundnetLayerGroup !== undefined) {
this.groundnetLayerGroup.removeFrom(this.$parent.mapObject) this.groundnetLayerGroup.removeFrom(this.$parent.mapObject)
} }
this.$parent.$parent.setIcao(icao)
this.icao = icao this.icao = icao
this.groundnetLayerGroup = readGroundnetXML(this.$store.state.Settings.settings.airportsDirectory, icao, force) this.groundnetLayerGroup = readGroundnetXML(this.$store.state.Settings.settings.airportsDirectory, icao, force)
if (this.groundnetLayerGroup === undefined) { if (this.groundnetLayerGroup === undefined) {
console.console.error('ICAO not loaded ' + icao) console.error('ICAO not loaded ' + icao)
return return
} }
this.groundnetLayerGroup.eachLayer(l => { this.groundnetLayerGroup.eachLayer(l => {

View File

@ -9,8 +9,12 @@
ref="map" ref="map"
> >
<!--The backgroundmap--> <!--The backgroundmap-->
<l-tile-layer :url="url" :attribution="attribution" :options="{maxZoom: 22, maxNativeZoom: 19}"> <l-tile-layer :url="url" :attribution="attribution" :options="{maxZoom: 22, maxNativeZoom: 17}"></l-tile-layer>
</l-tile-layer> <l-control position="topright" >
<el-card :body-style="{ padding: '0px' }">
<p>&nbsp;{{ icao }}&nbsp;</p>
</el-card>
</l-control>
<!--<l-marker :lat-lng="marker"></l-marker>--> <!--<l-marker :lat-lng="marker"></l-marker>-->
<LeafletSidebar></LeafletSidebar> <LeafletSidebar></LeafletSidebar>
<EditBar></EditBar> <EditBar></EditBar>
@ -21,7 +25,7 @@
:key="index" :key="index"
:lat-lng="[item.geometry.coordinates[1], item.geometry.coordinates[0]]" :lat-lng="[item.geometry.coordinates[1], item.geometry.coordinates[0]]"
:radius="((item.properties.flights+5)*20)" :radius="((item.properties.flights+5)*20)"
:color='item.color' :color="item.color"
@add="addEvent($event, item)" @add="addEvent($event, item)"
@click="onClick(item)" @click="onClick(item)"
></l-circle> ></l-circle>
@ -32,7 +36,7 @@
<script lang="js"> <script lang="js">
import 'leaflet/dist/leaflet.css' import 'leaflet/dist/leaflet.css'
import { LMap, LTileLayer, LMarker, LCircle, LLayerGroup } from 'vue2-leaflet' import { LMap, LTileLayer, LMarker, LCircle, LLayerGroup, LControl } from 'vue2-leaflet'
import LeafletSidebar from './LeafletSidebar' import LeafletSidebar from './LeafletSidebar'
import EditBar from './EditBar' import EditBar from './EditBar'
import EditLayer from './EditLayer' import EditLayer from './EditLayer'
@ -49,7 +53,7 @@
}) })
export default { export default {
name: 'flightgear-map', name: 'flightgear-map',
components: { LMap, LTileLayer, LMarker, LCircle, LeafletSidebar, EditBar, EditLayer, PavementLayer, LLayerGroup }, components: { LMap, LTileLayer, LMarker, LCircle, LeafletSidebar, EditBar, EditLayer, PavementLayer, LLayerGroup, LControl },
props: [], props: [],
mounted () { mounted () {
this.$store.dispatch('getAirports') this.$store.dispatch('getAirports')
@ -79,10 +83,14 @@
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors', attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors',
marker: L.latLng(47.413220, -1.219482), marker: L.latLng(47.413220, -1.219482),
airports: this.$store.state.Airports.airports, airports: this.$store.state.Airports.airports,
options: {editable: true} options: {editable: true},
icao: 'TEST'
} }
}, },
methods: { methods: {
setIcao (icao) {
this.icao = icao
},
visible (feature) { visible (feature) {
let bounds = this.$store.state.Settings.bounds let bounds = this.$store.state.Settings.bounds
if (!bounds.hasOwnProperty('getNorthEast')) { if (!bounds.hasOwnProperty('getNorthEast')) {
@ -157,4 +165,13 @@
.flightgear-map { .flightgear-map {
color: aqua; color: aqua;
} }
.item {
padding: 18px 0;
}
.l-control.el-card {
padding-left: 2px;
padding-top: 0px;
padding-right: 2px;
padding-bottom: 0px;
}
</style> </style>