This is the documentation of version 0.62.2. Go to the latest version, 1.0.0-rc.5.
TomTom Maps for JavaScript
    Preparing search index...

    Type Alias BaseMapModuleConfig

    BaseMapModuleConfig: MapModuleCommonConfig & {
        groups?: Partial<Record<BaseMapLayerGroupName, { visible?: boolean }>>;
        visible?: boolean;
    }

    Configuration for the BaseMapModule (initialization or runtime).

    Controls visibility and behavior of base map layer groups. Can be used both during module initialization and for runtime updates.

    Type Declaration

    • Optionalgroups?: Partial<Record<BaseMapLayerGroupName, { visible?: boolean }>>

      Shows or hides one layer group each, over visible, in the order given. An entry without visible draws its group as the style ships it.

      groups: { buildings3D: { visible: true }, houseNumbers: { visible: false } }

      // Only the roads, drawn as the style ships them
      visible: false, groups: { roads: {} }
    • Optionalvisible?: boolean

      Shows or hides every base-map layer. Unset, each layer is drawn as the style ships it.

    visible applies to every base-map layer, then each entry of groups to its group's layers, in the order given — so a later entry wins where two groups share layers (allPlaceLabels and cityLabels). Whatever neither sets is drawn as the style ships it, and so is a group whose entry leaves visible out. BaseMapModule.setVisible writes the same record, so getConfig() reproduces every call.

    Showing a group shows every layer in it, including the ones the style ships hidden (such as detailed road markings); leave a group out, or its visible unset, to keep the style's choice.

    // Hide the buildings
    const config: BaseMapModuleConfig = {
    groups: { buildings2D: { visible: false }, buildings3D: { visible: false } }
    };

    // Hide everything but water and land
    const minimalConfig: BaseMapModuleConfig = {
    visible: false,
    groups: { water: { visible: true }, land: { visible: true } }
    };