Options
All
  • Public
  • Public/Protected
  • All
Menu

JMap.Application.Event.Layer.on

Here you have all JMap NG App available layer events on which you can attach a listener.

Index

Functions

Functions

doubleClick

  • doubleClick(listenerId: string, fn: function): void
  • JMap.Application.Event.Layer.on.doubleClick

    This event is triggered when a user double clicks on a layer name in the hierarchical tree of the layers panel.

    The layer is received as a param property of the event, you can then take any action that would be executed on double click for this layer.

    example
    
    // Triggered when a user double clicks on a layer name
    JMap.Application.Event.Layer.on.doubleClick("my-layer-double-click-listener", params => {
      const layer = params.layer
      console.info(`The following layer has been double clicked by the current user: "${layer.name}". Its visibility will be toggled`)
      if (!JMap.Layer.isVisible(layer.id)) {
        JMap.Layer.ensureLayerIsVisible(layer.id)
      } else {
        JMap.Layer.setVisible(layer.id, false)
      }
    })

    Parameters

    Returns void