@versatiles/style
    Preparing search index...

    Function guessStyle

    • Generates a style specification based on the provided TileJSON specification and optional parameters.

      This function is intentionally fault-tolerant: a TileJSON that is partially invalid never causes it to throw. Every field is validated independently and silently dropped if it does not conform, so the remaining valid fields are still used to build a valid style. Even completely invalid input (e.g. null or a TileJSON without usable tiles) yields a valid — if empty — style.

      Parameters

      • tileJSON: TileJSONSpecification

        The TileJSON specification to generate the style from.

      • Optionaloptions: GuessStyleOptions

        Optional parameters to customize the style generation.

        Options for guessing the style of a map.

        • OptionalbaseUrl?: string

          Base URL to resolve URLs for tile sources, glyphs, and sprites.

        • Optionalglyphs?: string

          URL template for glyphs.

        • Optionalsprite?: SpriteSpecification

          URL template for sprites. See also SpriteSpecification.

      Returns StyleSpecification

      The generated style specification.