@squawk
    Preparing search index...

    Function expansionToLineString

    • Builds a GeoJSON LineString from an expanded procedure leg sequence, ready to render as a polyline on a map (e.g. MapLibre, Leaflet).

      Coordinates follow the GeoJSON [lon, lat] ordering. Returns undefined when the legs yield fewer than two drawable points, since a LineString requires at least two positions to be valid.

      Non-positional legs are skipped (see extractLegPoints), so the line connects only the fix-terminated legs in order. When a procedure mixes positional and non-positional legs the line is an approximation that omits the non-drawable segments rather than a precise flyable track.

      import { createProcedureResolver, expansionToLineString } from '@squawk/procedures';

      const resolver = createProcedureResolver({ data: procedures });
      const expansion = resolver.expand('KDEN', 'AALLE4');
      const line = expansion ? expansionToLineString(expansion.legs) : undefined;
      if (line) {
      map.addSource('procedure', { type: 'geojson', data: line });
      }

      Parameters

      • legs: ProcedureLeg[]

        Ordered procedure legs, e.g. expand(...).legs.

      Returns LineString | undefined

      A GeoJSON LineString, or undefined if fewer than two points.