The JS_LISTENER_PLANNEDROUTE listener API offers the ability to work with the flight planning features of Microsoft Flight Simulator 2024. These features include:

  • The ability to load the player’s current flight plan route (as presently displayed on the EFB)
  • The ability to subscribe to requests from the EFB to be provided with a route from avionics systems
  • The ability to respond to such requests

The interface of this API is designed to be as avionics and instrument agnostic as possible, while communicating everything necessary for consumers to share and synchronize flight plan routes in a general way to and from the simulator. 

CallDescription
GET_EFB_ROUTEGets the current flight plan route from the EFB.
REPLY_TO_AVIONICS_ROUTE_REQUESTReplies to a request from the EFB for instruments to send their current route.
NOTE

Only one instance of this listener should be created per instrument. Once the listener is created, the Coherent calls will be added to the instrument and will be available with Coherent.call.

Associated Datatypes

The data types below are all associated with this listener and used for flight plan route data. Note that all datatypes are describes as Typescript for ease of understanding but apply equally to vanilla JavaScript as well.

FlightPlanRoute

A generic description of a flight plan.

interface FlightPlanRoute {
  /** Coherent C++ object binding type. */
  __Type: 'JS_FlightPlanRoute';
  /** The ICAO of this route's departure airport. */
  departureAirport: IcaoValue;
  /** The ICAO of this route's destination airport. */
  destinationAirport: IcaoValue;
  /** This route's enroute legs. */
  enroute: FlightPlanRouteEnrouteLeg[];
  /** This route's departure runway. */
  departureRunway: RunwayIdentifier;
  /** The name of this route's departure procedure. */
  departure: string;
  /** The name of this route's departure procedure enroute transition. */
  departureTransition: string;
  /** This route's VFR traffic pattern departure procedure. */
  departureVfrPattern: FlightPlanRouteVfrPatternDeparture;
  /** This route's destination runway. */
  destinationRunway: RunwayIdentifier;
  /** The name of this route's arrival procedure. */
  arrival: string;
  /** The name of this route's arrival procedure enroute transition. */
  arrivalTransition: string;
  /** This route's approach procedure. */
  approach: ApproachIdentifier;
  /** The name of this route's approach procedure transition. */
  approachTransition: string;
  /** This route's VFR traffic pattern approach procedure. */
  approachVfrPattern: FlightPlanRouteVfrPatternApproach;
  /** This route's cruise altitude. */
  cruiseAltitude: FlightPlanRouteAltitude | null;
  /** Whether this route is classified as VFR. */
  isVfr: boolean;
}

FlightPlanRouteEnrouteLeg

An enroute leg used by FlightPlanRoute.

interface FlightPlanRouteEnrouteLeg {
  /** Coherent C++ object binding type. */
  __Type: 'JS_EnrouteLeg';
  /** The ICAO of this leg's terminator fix. */
  fixIcao: IcaoValue;
  /** The airway to follow to this leg's terminator fix, or the empty string if this leg is a DIRECT leg. */
  via: string;
  /** Whether the leg should use the airplane's present position as its terminator fix. */
  isPpos: boolean;
  /** Whether this leg's terminator fix is defined by a set of latitude/longitude coordinates. */
  hasLatLon: boolean;
  /** The latitude of the leg's terminator fix, in degrees. */
  lat: number;
  /** The longitude of this leg's terminator fix, in degrees. */
  lon: number;
  /** Whether this leg's terminator fix is defined by a bearing and distance from a reference facility. */
  hasPointBearingDistance: boolean;
  /** The ICAO of the reference facility with which this leg's terminator fix is defined. */
  referenceIcao: IcaoValue;
  /** The true bearing of this leg's terminator fix from the reference facility, in degrees. */
  bearing: number;
  /** The distance from the reference facility to this leg's terminator fix, in nautical miles. */
  distance: number;
}

FlightPlanRouteAltitude

An altitude used by FlightPlanRoute.

interface FlightPlanRouteAltitude {
  /** Coherent C++ object binding type. */
  __Type: 'JS_FlightAltitude';
  /** The altitude, in feet. */
  altitude: number;
  /** Whether the altitude is a flight level. */
  isFlightLevel: boolean;
}

FlightPlanRouteVfrPatternProcedure

A description of a VFR traffic pattern procedure used by FlightPlanRoute.

interface FlightPlanRouteVfrPatternProcedure<SelectionType extends string> {
  /** Coherent C++ object binding type. */
  __Type: 'JS_VfrPatternProcedure';
  /**
   * The selected pattern type. Must be one of the strings listed in the pattern enums. *
   */
  selection: SelectionType;
  /** Whether the selected traffic pattern side (left or right) must be respected. */
  forcePatternSide: boolean;
}

FlightPlanRouteVfrPatternDepartureSelection

VFR traffic pattern departure selection options used by FlightPlanRoute.

enum FlightPlanRouteVfrPatternDepartureSelection {
  None = '',
  LeftAuto = 'LAuto',
  RightAuto = 'RAuto',
  StraightOut = 'StraightOut',
  LeftPatternTurn = 'LPatternTurn',
  RightPatternTurn = 'RPatternTurn',
  Overhead = 'Overhead'
}

FlightPlanRouteVfrPatternApproachSelection

VFR traffic pattern approach selection options used by FlightPlanRoute.

enum FlightPlanRouteVfrPatternApproachSelection {
  None = '',
  LeftAuto = 'LAuto',
  RightAuto = 'RAuto',
  StraightIn = 'StraightIn',
  LeftPattern = 'LPattern',
  RightPattern = 'RPattern',
  LeftCrossMidfield = 'LCrossMidfield',
  RightCrossMidfield = 'RCrossMidfield',
}

0/255