map.apps Bundle APIs 4.20.2
    Preparing search index...

    Interface ActionService

    The ActionService provides access to map-actions.Action instances.

    An instance of this class can be referenced using the service name map-actions.ActionService. The service can be used in different workflows to trigger the same functionality.

    The action service will emit events action-added and action-removed when a new action is registered or an existing action is unregistered. In both cases, an object {id: "action-id"} is passed to the event handler.

    interface ActionService {
        getActionIds(): string[];
        hasAction(actionId: string): boolean;
        trigger(
            actionIds: readonly string[],
            options?: ActionOptions,
        ): Promise<unknown>[];
    }

    Hierarchy (View Summary)

    Index

    Methods

    • Get currently available action ids.

      Returns string[]

    • Checks if an action with the given ID exists.

      Parameters

      • actionId: string

        ID of the action.

      Returns boolean

    • Trigger the actions and return their response as a list of Promises.

      Parameters

      • actionIds: readonly string[]

        List of action IDs to trigger. To trigger all available actions pass a list with only one entry: ["*"].

      • Optionaloptions: ActionOptions

        Options to be passed to the actions. This can, for example, include the items of a search result.

      Returns Promise<unknown>[]

      List of Promises with the actions' result of their trigger methods.