Using AMDB with the Globe
The Globe base layer draws airports from OpenStreetMap: runways, taxiways, aprons, markings, parking positions and buildings. Where SimVector has an AMDB for an airport, you want to draw that instead, because drawing both gives you doubled or misaligned runways and taxiways.
This guide shows how to cover the OpenStreetMap airport wherever AMDB exists and leave every other airport untouched.
Draft
This guide depends on the aerodrome_footprint polygons in the AMDB specification, which are proposed and not final.
How it works
The mask also hides terrain
Covering the OpenStreetMap airport hides hillshade and elevation tint that sit below the mask, inside the footprint. See Terrain and symbology before you use this method.
OpenStreetMap airport features cannot be filtered by airport. Globe runways, taxiways and aprons carry no airport code, and MapLibre filters cannot test whether a feature is inside an area. So instead of hiding the OpenStreetMap features, you cover them:
- Every airport with AMDB has an
aerodrome_footprintpolygon in the AMDBaerodromeslayer, available from zoom 8. - You draw those footprints as a flat fill, in your land colour, above the Globe airport layers and below the AMDB layers.
- The footprint hides the OpenStreetMap airport underneath, and the AMDB layers draw on top of the flat fill.
Airports without AMDB have no footprint, so nothing covers them and OpenStreetMap shows as usual.
1. Add both sources
Add the Globe and AMDB sources as described in their specifications. This guide uses the source ids simvector-globe and simvector-amdb.
2. Order the layers
Layers draw bottom to top, in array order. The mask must sit between the Globe airport layers and the AMDB layers. Starting from the order in Building a Map Style:
| Position | Layers |
|---|---|
| Below the mask | background, land, water, streets, buildings, the Globe aviation layers (aprons, aerodromes, taxiways, runways, aeroway_markings, parking_positions, helipads, aero_navaids), and the labels that belong to them (runway and navaid labels) |
| The mask | amdb-osm-mask |
| Above the mask | The AMDB layers, then place and boundary labels, then your own overlays |
Put the Globe airport labels below the mask. Runway and navaid labels carry no airport code, so the mask is the only way to hide them for an AMDB airport.
// Footprints of every airport that has AMDB, filled with the land colour.
map.addLayer(
{
id: 'amdb-osm-mask',
type: 'fill',
source: 'simvector-amdb',
'source-layer': 'aerodromes',
minzoom: 12,
filter: ['==', ['get', 'feature'], 'aerodrome_footprint'],
paint: {
'fill-color': palette.land,
'fill-antialias': false,
},
},
'amdb-aprons', // the first AMDB layer in your style
)
map.addLayer({
id: 'amdb-aprons',
type: 'fill',
source: 'simvector-amdb',
'source-layer': 'aprons',
paint: { 'fill-color': '#7c8591' },
})
// …then amdb-taxiways, amdb-runways and the rest, in the order given in the AMDB specification.If your style is a JSON file rather than code, place the mask layer object between the last Globe airport layer and the first AMDB layer in the layers array.
3. Match the mask to your land colour
The mask is an opaque fill, so it has to look like the ground it covers.
Colour. Use the same colour as your
landlayer. Re-apply it when the theme changes, together with your other themed layers:typescriptmap.setPaintProperty('amdb-osm-mask', 'fill-color', palette.land)Start zoom. Use
minzoom: 12. The AMDB layers appear at different zooms (runwaysat 10,taxiwaysat 11,apronsat 12), so a mask that starts earlier would hide OpenStreetMap taxiways and aprons before AMDB has drawn its own. Below zoom 12, OpenStreetMap and AMDB draw together; at that scale the difference is small.Edges. Set
fill-antialias: falseso a faint outline is not drawn around the footprint.Terrain. See Terrain and symbology below. The mask occludes terrain layers that sit below it.
Terrain and symbology
The mask is an opaque fill, so it occludes everything drawn below it inside the footprint, including terrain. This may or may not be what you want, so decide before you adopt it.
| Layer type | Effect inside the footprint |
|---|---|
Hillshade and color-relief (tint) below the mask | Hidden. The airport shows as a flat patch of land colour with no shading or elevation tint. |
Hillshade and color-relief above the mask | Still visible, but they then also draw over the Globe layers below them (water, streets, labels). |
3D terrain (map.setTerrain) | The mesh is unaffected and the mask drapes over it. Only the shading and tint are lost. |
| Globe labels below the mask | Hidden. |
| Globe labels above the mask | Still visible, and cannot be hidden per airport (except aerodrome labels, see below). |
Airports are usually flat, so the missing shading is often not noticeable, but on an airport with surrounding relief the flat patch can show at its edge. If that is not acceptable for your product, use the mask without terrain layers below it, or draw hillshade above the mask and accept that it also shades the layers beneath it.
There is no filter-based alternative today: Globe aviation features carry no airport ID, so they cannot be hidden per airport without a mask.
4. Avoid duplicate airport labels (optional)
The mask starts at zoom 12. At zoom 8–11 the Globe aerodrome label and any label you draw from the AMDB aerodromes points can both show for the same airport. To show one label per airport, hide the Globe label for airports that have AMDB.
Globe aerodromes carry an icao field, so unlike the runway layers they can be filtered by airport. The AMDB footprints tell you which airports have AMDB:
const covered = new Set<string>()
function refreshCoverage() {
const footprints = map.querySourceFeatures('simvector-amdb', {
sourceLayer: 'aerodromes',
filter: ['==', ['get', 'feature'], 'aerodrome_footprint'],
})
let changed = false
for (const f of footprints) {
const id = f.properties?.idarpt as string | undefined
if (id && !covered.has(id)) {
covered.add(id)
changed = true
}
}
if (changed) {
map.setFilter('osm-aerodrome-labels', [
'!',
['in', ['coalesce', ['get', 'icao'], ''], ['literal', [...covered]]],
])
}
}
map.on('sourcedata', (e) => {
if (e.sourceId === 'simvector-amdb' && e.isSourceLoaded) refreshCoverage()
})
map.on('moveend', refreshCoverage)querySourceFeatures only sees tiles that are currently loaded, so the set grows as the user pans. That is enough here, because an airport's footprint is in every loaded tile that overlaps it. If your app already has a list of AMDB airports, filter on that list instead and skip this code.
What gets covered
The mask covers everything below it inside the footprint, not just aviation features.
| Inside the footprint | Result |
|---|---|
| Globe runways, taxiways, aprons, markings, parking positions, helipads, navaids | Hidden. AMDB draws its own. |
| Globe buildings and obstacles | Hidden. AMDB structures draws terminals, hangars and obstructions. |
| Globe streets and water | Hidden. AMDB draws service roads and water near the movement area. |
| Globe features outside the footprint | Still drawn. The footprint is the AMDB airfield plus a margin, so public roads and nearby buildings are unaffected. |
If you would rather keep Globe buildings or streets visible, move those layers above the mask. They will then draw over AMDB wherever they overlap.
Troubleshooting
| Symptom | Likely cause |
|---|---|
| OpenStreetMap airport still shows through | The mask is below the Globe airport layers. Check the order, or pass the right beforeId to addLayer. |
| AMDB layers are hidden | The mask is above the AMDB layers. It must be below the first one. |
| A flat patch of the wrong colour | fill-color does not match your land colour, or was not updated after a theme change. |
| Hillshade or tint disappears at the airport | Expected: they are below the mask. See Terrain and symbology. |
| Gaps in taxiways or aprons at zoom 10–11 | The mask minzoom is below 12. Raise it. |
| Part of an OpenStreetMap airport shows beside the AMDB | That part is outside the footprint. Features outside the AMDB airfield are intentionally left alone. |
| Old runway or navaid labels float over the AMDB | Those label layers are above the mask. Move them below it. |
| Airport labels appear twice below zoom 12 | Hide the Globe label for covered airports. See duplicate airport labels. |