Options
All
  • Public
  • Public/Protected
  • All
Menu

JMap.Event.Project.on

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

Index

Functions

postDeactivation

  • postDeactivation(listenerId: string, fn: function): void
  • JMap.Event.Project.on.postDeactivation

    This event is triggered when current active project has been deactived.

    When this event is triggered, the project has been deactivated.

    Project's data on the map, in the redux state, etc... should not be available anymore.

    example
    
    // Each time the current active project will be deactivated it will display the project id in the console
    JMap.Event.Project.on.postDeactivation(
       "custom-project-post-deactivation",
       params => console.log(`Project id="${params.project.id}" is now deactivated`)
    )

    Parameters

    • listenerId: string

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

    • fn: function

      Your listener function

    Returns void

preDeactivation

  • preDeactivation(listenerId: string, fn: function): void
  • JMap.Event.Project.on.preDeactivation

    This event is triggered when current active project will be deactived.

    When this event is triggered, the project is still loaded (the map, the redux state, etc...).

    You can do anything normally.

    example
    
    // Each time the current active project will be deactivated it will display the project id in the console
    JMap.Event.Project.on.preDeactivation(
       "custom-project-pre-deactivation",
       params => console.log(`Project id="${params.project.id}" will be deactivate`)
    )

    Parameters

    • listenerId: string

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

    • fn: function

      Your listener function

    Returns void

projectChange

  • projectChange(listenerId: string, fn: function): void
  • JMap.Event.Project.on.projectChange

    This event is triggered when a new project is loaded.

    example
    
    // Each time a new project is loaded will display the new project id in the console
    JMap.Event.Project.on.projectChange(
       "custom-project-change",
       params => console.log(`New project id="${params.project.id}"`)
    )

    Parameters

    • listenerId: string

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

    • fn: function

      Your listener function

    Returns void

projectsChange

  • projectsChange(listenerId: string, fn: function): void
  • JMap.Event.Project.on.projectsChange

    This event is triggered after the entire project list has been fetched from server.

    It happens once after the user session has been validated and set.

    example
    
    // Each time a new project is loaded will display the new project id in the console
    JMap.Event.Project.on.projectsChange(
       "custom-projects-change",
       params => console.log(`Project count = "${params.projects.length}"`)
    )

    Parameters

    Returns void