diff --git a/src/renderer/components/FlightgearMap.vue b/src/renderer/components/FlightgearMap.vue index 23a3a26..b3cb14e 100644 --- a/src/renderer/components/FlightgearMap.vue +++ b/src/renderer/components/FlightgearMap.vue @@ -86,6 +86,14 @@ if (!bounds.hasOwnProperty('getNorthEast')) { bounds = this.$refs.map.mapObject.getBounds() } + let width = bounds.getNorthWest().distanceTo(bounds.getSouthEast()) + // Load all airports in a minimum 5 km box + if (width < 5000) { + let rest = 5000 - width + let padFactor = rest / width + bounds = bounds.pad(padFactor) + } + let coordinates = feature.geometry.coordinates let ret = bounds.getNorthEast().lat > Number(coordinates[1]) && bounds.getNorthEast().lng > Number(coordinates[0])