Load all Airports within 5km in high zooms
This commit is contained in:
parent
38c7486c30
commit
872f7dc109
@ -86,6 +86,14 @@
|
|||||||
if (!bounds.hasOwnProperty('getNorthEast')) {
|
if (!bounds.hasOwnProperty('getNorthEast')) {
|
||||||
bounds = this.$refs.map.mapObject.getBounds()
|
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 coordinates = feature.geometry.coordinates
|
||||||
let ret = bounds.getNorthEast().lat > Number(coordinates[1]) &&
|
let ret = bounds.getNorthEast().lat > Number(coordinates[1]) &&
|
||||||
bounds.getNorthEast().lng > Number(coordinates[0])
|
bounds.getNorthEast().lng > Number(coordinates[0])
|
||||||
|
Loading…
Reference in New Issue
Block a user