Options
All
  • Public
  • Public/Protected
  • All
Menu

JMap.Event.Feature.on

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

Index

Functions

creation

  • creation(listenerId: string, fn: function): void
  • JMap.Event.Feature.on.creation

    This event is triggered when a feature has been created.

    example
    
    // Each time a feature is created, this method is processed
    JMap.Event.Feature.on.creation(
       "custom-feature-creation",
       params => console.info(`For layer id="${params.layerId}", feature id="${params.featureId}" geometry has been created`)
    )

    Parameters

    Returns void

deletion

  • deletion(listenerId: string, fn: function): void
  • JMap.Event.Feature.on.deletion

    This event is triggered when a feature has been deleted.

    example
    
    // Each time layer features are deleted, this method is processed
    JMap.Event.Feature.on.deletion(
       "custom-feature-deletion",
       params => console.info(`For layer id="${params.layerId}", deleted feature ids: ${params.deletedFeatures.map(f => f.id).join(", ")}`)
    )

    Parameters

    Returns void

geometryChanged

  • geometryChanged(listenerId: string, fn: function): void
  • JMap.Event.Feature.on.geometryChanged

    This event is triggered when a feature geometry has been changed.

    example
    
    // Each time a layer feature geometry has been changed, this method is processed
    JMap.Event.Feature.on.geometryChanged(
       "custom-feature-geometry-changed",
       params => console.info(
         `For layer id="${params.layerId}", feature id="${params.updatedFeature.id}" geometry has been changed`,
         params.updatedFeature
       )
    )

    Parameters

    Returns void