TomTom Maps for JavaScript
    Preparing search index...

    Type Alias SourceWithLayerIDs

    The IDs of a MapLibre source and all its layers.

    With these IDs, you can customize the source and layers directly through the MapLibre API. For example, you can access layers for custom styling, modify layer properties at runtime, remove or update data sources, or debug layer hierarchies.

    // Get the source and layer IDs of one of a module's sources
    const { layerIDs } = routingModule.sourceAndLayerIDs.mainLines;

    // Update layer paint properties
    for (const layerID of layerIDs) {
    map.mapLibreMap.setPaintProperty(layerID, 'line-opacity', 0.5);
    }
    type SourceWithLayerIDs = {
        layerIDs: string[];
        sourceID: string;
    }
    Index
    layerIDs: string[]

    The IDs of the layers that use this source.

    The order usually follows the rendering order, but the actual map style has the definitive ordering.

    // Hide all layers from this source
    layerIDs.forEach(id => {
    map.mapLibreMap.setLayoutProperty(id, 'visibility', 'none');
    });
    sourceID: string

    The unique identifier of the MapLibre data source.

    Use this ID to access or modify the source via MapLibre's source API.

    const source = map.mapLibreMap.getSource(sourceID);