The MapContextMenu is the main contextmenu shown to the user whenever it rightclicks on the map. It is the primary interaction method for the user. It allows to spawn units, create explosions and smoke, and edit CoalitionAreas.

Hierarchy

Constructors

Properties

#aircraftSpawnMenu: AircraftSpawnMenu
#coalitionArea: null | CoalitionArea = null
#coalitionSwitch: Switch
#container: null | HTMLElement
#groundUnitSpawnMenu: GroundUnitSpawnMenu
#helicopterSpawnMenu: HelicopterSpawnMenu
#latlng: LatLng = ...
#navyUnitSpawnMenu: NavyUnitSpawnMenu
#visibleSubMenu: null | string = null
#x: number = 0
#y: number = 0

Methods

  • Callback called when the user left clicks on the coalition switch

    Parameters

    • value: boolean

      Switch position (false: "blue", true: "red")

    Returns void

  • Callback called when the user rightclicks on the coalition switch. This will select the "neutral" coalition.

    Returns void

  • Shows the submenu depending on unit selection

    Parameters

    • type: string

      Submenu type, either "aircraft", "helicopter", "groundunit", "navyunit", "smoke", or "explosion"

    Returns void

  • If the user rightclicked on a CoalitionArea, it will be given the ability to edit it.

    Parameters

    • coalitionArea: CoalitionArea

      The CoalitionArea the user can edit

    Returns void

  • Show the contextmenu on top of the map, usually at the location where the user has clicked on it.

    Parameters

    • x: number

      X screen coordinate of the top left corner of the context menu

    • y: number

      Y screen coordinate of the top left corner of the context menu

    • latlng: LatLng

      Leaflet latlng object of the mouse click

    Returns void

Generated using TypeDoc