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

    Interface ResultViewerService

    Provides a service to show data tables in the ui.

    The service can be injected by referencing "result-api.ResultViewerService".

    Via the property currentDataTables the available data tables can be accessed.

    const resultViewerService = ...;
    const currentlyAvailableDataTables = resultViewerService.currentDataTables;

    // with default result-ui only one of the tables are shown, to access this table use:
    const firstDataTable = currentDataTables.getFirstSelectedTable();

    // to iterate all available data tables use, for/of:
    for (const dataTable of currentDataTables){
    ...
    }

    If you need an array of the tables use the `tables` property:
    const tableArray = currentDataTables.tables;
    // or
    const tableArray = Array.from(currentDataTables);

    It is possible to watch for the event current-data-changed:

    const resultViewerService = ...;
    resultViewerService.on("current-data-changed", ({shown, hidden})=>{
    // shown is the new currentDataTables property
    resultViewerService.currentDataTables === shown;
    // hidden is the old replaced collection
    resultViewerService.currentDataTables !== hidden;
    })
    interface ResultViewerService {
        currentDataTables: DataTableCollection | undefined;
        dataTableFactory: DataTableFactory;
        enableMapInteraction: boolean;
        on<Name extends "current-data-changed">(
            name: Name,
            callBack: EventCallback<ResultViewerServiceEvents[Name]>,
        ): Handle;
        open(
            dataTables: DataTableCollection,
            options?: ResultViewerServiceOpenOptions,
        ): Handle;
    }

    Hierarchy

    Index

    Properties

    currentDataTables: DataTableCollection | undefined

    As long as a ui is opened, the shown data can be accessed here. If a ui is closed or a new call to open is performed. The data will be replaced.

    dataTableFactory: DataTableFactory

    Provides access to a factory to assemble DataTables.

    enableMapInteraction: boolean

    Controls whether results are visualized and interactive on the map. When enabled, result features are highlighted on the map and selecting a data table will automatically zoom to its features.

    Methods

    • Registers event listener.

      Type Parameters

      • Name extends "current-data-changed"

      Parameters

      Returns Handle

    • Opens the given data tables in the UI and returns a handle that allows the caller to hide the model again.

      This method merges previously opened tables with the given dataTables by default. This behavior can be controlled by the given options object.

      Parameters

      Returns Handle