Options
All
  • Public
  • Public/Protected
  • All
Menu

Module on

JMap.Event.Layer.on

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

Index

Functions

dynamicFilterActivationChange

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

    This event is triggered when a layer dynamic filter is activated or deactivated.

    example
    
    // Each time a layer dynamic filter is activated or deactivated, will display a message in the console
    JMap.Event.Layer.on.dynamicFilterActivationChange(
       "custom-layer-dynamic-filter-activation-changed",
       params => {
         console.info(`The dynamic filter of layer id=${params.layerId} has been ${params.isActivation ? "activated" : "deactivated"}`)
       }
    )

    Parameters

    Returns void

dynamicFilterConditionCreated

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

    This event is triggered when a condition is created on a layer dynamic filter.

    example
    
    // Each time a condition is created on a layer dynamic filter, will display a message in the console
    JMap.Event.Layer.on.dynamicFilterConditionCreated(
       "custom-layer-dynamic-filter-condition-created",
       params => {
         console.info(`Condition added on layer id=${params.layerId}'s dynamic filter`, params.filter, params.condition)
       }
    )

    Parameters

    Returns void

dynamicFilterConditionUpdated

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

    This event is triggered when a condition is updated on a layer dynamic filter.

    example
    
    // Each time a condition is updated on a layer dynamic filter, will display a message in the console
    JMap.Event.Layer.on.dynamicFilterConditionUpdated(
       "custom-layer-dynamic-filter-condition-updated",
       params => {
         console.info(`Condition updated on layer id=${params.layerId}'s dynamic filter`, params.filter, params.condition)
       }
    )

    Parameters

    Returns void

dynamicFilterConditionsRemoved

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

    This event is triggered when a condition is removed on a layer dynamic filter.

    example
    
    // Each time one or more conditions are removed for a layer dynamic filter, will display a message in the console
    JMap.Event.Layer.on.dynamicFilterConditionsRemoved(
       "custom-layer-dynamic-filter-conditions-removed",
       params => {
         console.info(`Condition(s) removed on layer id=${params.layerId}'s dynamic filter`, params.filter, params.conditionIds)
       }
    )

    Parameters

    Returns void

dynamicFilterSet

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

    This event is triggered when some dynamic filters are set.

    Could happen when a map context is applied, or when we use the method JMap.Layer.DynamicFilter.set.

    example
    
    // Each time some layer dynamic filters have been set
    JMap.Event.Layer.on.dynamicFilterSet(
       "custom-layer-dynamic-filter-set",
       params => console.info("Some dynamic filters have been set", params)
    )

    Parameters

    Returns void

initialSearchApplied

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

    This event is triggered when the initial layer search is applied (if exist).

    example
    
    // Each time the initial search is applied, will display a message in the console
    JMap.Event.Layer.on.initialSearchApplied(
       "custom-layer-initial-search-applied",
       params => {
         console.info(`Initial search on layer id="${params.layerId}" has been applied`, params.features)
       }
    )

    Parameters

    Returns void

layerDeletion

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

    This event is triggered when a layer is deleted.

    example
    
    // Each time a layer is deleted, will display a message in the console
    JMap.Event.Layer.on.layerDeletion(
       "custom-layer-deletion",
       params => {
         console.log(`Layer id="${params.layerId}" has been deleted client side`)
       }
    )

    Parameters

    • listenerId: string

      Your listener id (must be unique for all layer events)

    • fn: function

      Your listener function

    Returns void

layersChange

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

    This event is triggered when a new project has been loaded, and when its layers have been loaded too.

    If the project has been unloaded, this event is triggered but the provided layerTree is an empty array (in JMap a project has at least one layer).

    example
    
    // Each time a new project is loaded and its layer have also been loaded,
    // this method is processed.
    JMap.Event.Layer.on.layersChange(
       "custom-layers-change",
       params => {
         console.log("This is the new project layer three", params.layerTree)
       }
    )

    Parameters

    Returns void

selectabilityWillChange

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

    This event is triggered just before a vector layer selectability is changed. This permits to act on selection before the layer selectability property is effectively changed

    example
    
    // Each time a vector layer selectability will change, it will display the next selectability
    // in the console
    JMap.Event.Layer.on.selectabilityWillChange(
       "custom-selectability-will-change",
       params => {
         console.log(`Vector layer id="${params.layerId}" next selectability="${params.selectability}"`)
       }
    )

    Parameters

    Returns void

sourceChange

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

    This event is triggered when a layer's source has changed (for instance after modifying, adding or deleting a feature).

    example
    
    // Each time a layer's source has changed, it will display a message
    // in the console
    JMap.Event.Layer.on.sourceChange(
       "custom-source-change",
       params => {
         console.log(`Source for layer id="${params.layerId}" has changed"`)
       }
    )

    Parameters

    • listenerId: string

      Your listener id (must be unique for all layer events)

    • fn: function

      Your listener function

    Returns void

thematicCategoriesVisibilityChange

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

    This event is triggered when the visibility state of a layer thematic categories changes.

    example
    
    // Each time a layer thematic category visibility state is changed this method is processed
    JMap.Event.Layer.on.thematicCategoriesVisibilityChange(
       "custom-thematic-categories-visibility-change",
       params => {
         console.log(
           `Layer id="${params.layerId}", ` +
           `thematic id="${params.thematicId}" ` +
           `hidden categories="${params.hiddenCategoryIndexes.toString()}"`
         )
       }
    )

    Parameters

    Returns void

thematicConditionsVisibilityChange

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

    This event is triggered when the visibility state of a layer thematic condition changes.

    It works only for JMap Cloud server, for style rule thematics.

    example
    
    // Each time a layer thematic condition visibility state is changed this method is processed
    JMap.Event.Layer.on.thematicConditionsVisibilityChange(
       "custom-thematic-conditions-visibility-change",
       params => {
         console.log(
           `Layer id="${params.layerId}", ` +
           `thematic id="${params.thematicId}" ` +
           `hidden conditions="${params.hiddenConditionIds.toString()}"`
         )
       }
    )

    Parameters

    Returns void

thematicVisibilityChange

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

    This event is triggered when a layer thematic visibility changed.

    example
    
    // Each time a layer thematic visibility is changed this method is processed
    JMap.Event.Layer.on.thematicVisibilityChange(
       "custom-thematic-visibility-change",
       params => {
         console.log(
           `Layer id="${params.layerId}", ` +
           `thematic id="${params.thematicId}" ` +
           `visible="${params.visibility}"`
         )
       }
    )

    Parameters

    Returns void

visibilityChange

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

    This event is triggered when a tree element visibility changed.

    example
    
    // Each time a tree element visibility is changed, will display the new visibility
    // in the console
    JMap.Event.Layer.on.visibilityChange(
       "custom-visibility-change",
       params => {
         console.log(`Layer element id="${params.layerId}" visible="${params.visibility}"`)
       }
    )

    Parameters

    Returns void