Options
All
  • Public
  • Public/Protected
  • All
Menu

Module Extension

JMap.Application.Extension

You can manage everything related to JMap NG App extensions here.

Index

Functions

getAllRegisteredIds

  • getAllRegisteredIds(): string[]
  • JMap.Application.Extension.getAllRegisteredIds

    Returns all JMap NG App registered extension ids.

    Desn't list JMap NG Core extensions, only JMap NG App extensions.

    example
    
    // Could returns [ "my-first-extension", "my-second-extension" ]
    JMap.Extension.getAllRegisteredIds()

    Returns string[]

isRegistered

  • isRegistered(extensionId: string): boolean
  • JMap.Application.Extension.isRegistered

    Tells if an JMap NG App extension has been registered or not.

    It can be usefull to know if a JMap NG App extension is in use or not.

    throws

    Error if extensionId format is not correct

    example
    
    // returns true if extension id="my-extension" is in use or not
    JMap.Extension.isRegistered("my-extension")

    Parameters

    • extensionId: string

      The extension id

    Returns boolean

register

  • JMap.Application.Extension.register

    Registers your own JMap NG App extension.

    throws

    Error if a parameter is not correct

    example
    
    JMap.Application.Extension.register({
     id: "MyExtension", // Unique id
     initFn: () => {
       // here you can start your UI component if needed
       console.log("JMap NG is started and my extension has been successfuly started")
     },
     onPanelCreation: panelContainerId => {
       console.info("Create your component here")
     },
     onPanelDestroy: panelContainerId => {
       console.info("Destroy your component here")
     },
     onRegistrationDone: () => {
       console.info("My extension has been successfully registered")
     }
    })

    Parameters

    Returns void