@versatiles/style
    Preparing search index...

    Interface StyleBuilderOptions

    Options for configuring the style builder.

    interface StyleBuilderOptions {
        baseUrl?: string;
        bounds?: [number, number, number, number];
        colors?: Partial<StyleBuilderColors<string | Color>>;
        elevationTilejson?: string;
        fonts?: Partial<StyleBuilderFonts>;
        glyphs?: string;
        hideLabels?: boolean;
        hillshade?: HillshadeOption;
        iconScale?: number;
        language?: Language;
        recolor?: RecolorOptions;
        sprite?: SpriteSpecification;
        terrain?: TerrainOption;
        textScale?: number;
        tiles?: string[];
        [key: string]: unknown;
    }

    Indexable

    • [key: string]: unknown
    Index

    Properties

    baseUrl?: string

    The base URL for loading external resources like tiles, sprites, and fonts.

    document.location.origin (in the browser), or 'https://tiles.versatiles.org'
    
    bounds?: [number, number, number, number]

    The bounding box for the map, formatted as [sw.lng, sw.lat, ne.lng, ne.lat].

    [-180, -85.0511287798066, 180, 85.0511287798066]
    
    colors?: Partial<StyleBuilderColors<string | Color>>

    An object specifying overrides for default color values, keyed by the color names. See also: StyleBuilderColors

    elevationTilejson?: string

    URL to elevation TileJSON used for terrain and hillshade. Defaults to /tiles/elevation/tiles.json (resolved against baseUrl) when terrain or hillshade is enabled. Only consulted if terrain or hillshade is set.

    fonts?: Partial<StyleBuilderFonts>

    An object specifying overrides for default font names, keyed by the font names. See also: StyleBuilderFonts

    glyphs?: string

    The URL template for loading font glyphs, formatted with '{fontstack}' and '{range}' placeholders.

    '/assets/glyphs/{fontstack}/{range}.pbf'
    
    hideLabels?: boolean

    If set to true, hides all map labels.

    false
    
    hillshade?: HillshadeOption

    Enable a hillshade layer. Pass true for defaults or an object for custom paint properties. When set, the returned style is a Promise because the elevation TileJSON must be fetched.

    iconScale?: number

    Multiplier applied to every symbol layer's icon-size. Symbol layers that have an icon-image but no explicit icon-size get icon-size: iconScale (MapLibre's spec default is 1).

    1
    
    language?: Language

    Set the language ('en', 'de', ...) of all map labels. A null value means that the language of the country in which the label is drawn will be used. See also: Language

    null
    
    recolor?: RecolorOptions

    Options for color adjustments and transformations applied to the entire style. See also: RecolorOptions

    The URL for loading sprite images and metadata.

    [{ id: 'basics', url: '/assets/sprites/basics/sprites' }]
    
    terrain?: TerrainOption

    Enable 3D terrain. Pass true for defaults or an object for a custom exaggeration. When set, the returned style is a Promise because the elevation TileJSON must be fetched.

    textScale?: number

    Multiplier applied to every symbol layer's text-size. Halo width, padding, line widths, and other non-text dimensions are not affected.

    1
    
    tiles?: string[]

    An array of URL templates for loading map tiles, using '{z}', '{x}', and '{y}' placeholders.

    ['/tiles/osm/{z}/{x}/{y}']