• JMap.Map.Interaction.addInteractor

    Add a map interactor.

    If the id has already an existing interactor defined for, it will replace the old one.

    So be carrefull not to remove JMap interactors.

    You can get the list of already existing interactor ids like this :

    JMap.Map.Interaction
    .getAllInteractorDescriptors()
    .map(interactor => interactor.id)

    Parameters

    • id: string

      The new interactor id.

    • interactor: JMapInteractor

      The map interactor object

    • Optional active: boolean

      If true will activate the new interactor after being added

    Returns void

    Throws

    Error if bad parameters are passed

    Example

    // add a new interactor
    JMap.Map.Interaction.addInteractor("my-custom-pin", { ...mapInteractor }, false)

    // add and activate a new interactor
    JMap.Map.Interaction.addInteractor("my-custom-pin", { ...mapInteractor }, true)