Options
All
  • Public
  • Public/Protected
  • All
Menu

Module Panel

JMap.Application.Panel

You can manage UI panels (on the left in the screen) here.

There is one diplayed and active panel at a time.

Index

Functions

activateById

  • JMap.Application.Panel.activateById

    Changes the JMap NG App panel.

    If no panelId is provided, will activate the "layer" panel by default, if the "layer" panel is disabled will activate the first available panel.

    throws

    if panel is not found

    example
    
    // will activate and display the panel id="layer"
    JMap.Application.Panel.activateById("layer")

    Parameters

    • Optional panelId: undefined | string

      The new application panel to activate

    • Optional params: JAppPanelActivationParams

      optionnal parameters

    Returns void

add

  • JMap.Application.Panel.add

    Adds a custom panel for a given panel definition to JMap NG App.

    throws

    if panel format is not correct

    example
    
    const customPanelId = "custom-panel"
    // will add the new panel, here an empty panel just for the example
    JMap.Application.Panel.add({
      id: customPanelId,
      // Can be an image encoded as a base64 url or an svg tag as a string.
      // For an svg string a viewbox need to be specified for the icon to appear and if no fill attribute is specified, the icon will follow the app theme.
      icon: "http://url-to-my-image/custom-icon.png",
      iconTooltip: "My custom panel tooltip display when mouse is hover the icon",
      title: "Custom panel"
    })
    // The panel has been created but not displayed, if you want to display it:
    JMap.Applcation.activate(customPanelId)

    Parameters

    • panel: JAppPanel

      an object that is the definition of the new panel

    Returns void

deactivateCurrent

  • JMap.Application.Panel.deactivateCurrent

    Deactivates the current panel, except if the current panel is the layer panel, or if there is only one panel available.

    example
    
    // will activate the current panel
    JMap.Application.Panel.deactivateCurrent()

    Parameters

    Returns void

existById

  • existById(panelId: string): boolean
  • JMap.Application.Panel.existById

    Returns true if the panel exists for a given panel id.

    example
    
    // return true if panel id="layer" exists
    JMap.Application.Panel.existById("custom-panel")

    Parameters

    • panelId: string

      The panel id to test

    Returns boolean

getActive

  • JMap.Application.Panel.getActive

    Returns the active panel.

    example
    
    // return the currently active panel
    JMap.Application.Panel.getActive()

    Returns JAppPanel

getAll

  • JMap.Application.Panel.getAll

    Returns all application panels available.

    example
    
    // return all available application panels
    JMap.Application.Panel.getAll()

    Returns JAppPanel[]

removeById

  • removeById(panelId: string): void
  • JMap.Application.Panel.removeById

    Removes a panel for a given panel id from JMap NG App.

    If the panel was active, will activate the first panel the application finds.

    throws

    if panel is not found or if this is the last panel

    example
    
    // will remove the "custom-panel" panel
    JMap.Application.Panel.removeById("custom-panel")

    Parameters

    • panelId: string

      The application panel id to remove

    Returns void