This is the documentation of version 1.0.0-rc.4. 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 }>>;
        roads?: BaseMapRoadsConfig;
        visible?: boolean;
    }

    The configuration of the BaseMapModule, at initialization or at runtime.

    It controls the visibility and behaviour of base map layer groups.

    Type Declaration

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

      The visibility of each layer group, applied 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: {} }
    • Optionalroads?: BaseMapRoadsConfig

      The visibility of road parts on their own. A part never shows while its group is hidden.

    • Optionalvisible?: boolean

      Whether every base-map layer shows. If 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. A later entry wins where two groups share layers, such as 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. To keep the style's choice, leave a group out or its visible unset.

    // 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 } }
    };