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

    Type Alias CustomStyleSource

    CustomStyleSource:
        | { json?: never; url: string }
        | { json: StyleSpecification; url?: never }

    Where a custom style comes from: a URL to fetch it from, or the specification itself. Exactly one.

    Type Declaration

    • { json?: never; url: string }
      • Optionaljson?: never
      • url: string

        URL to a MapLibre style JSON, without an API key — the SDK adds the configured one.

    • { json: StyleSpecification; url?: never }
    const fromUrl: CustomStyleSource = { url: 'https://example.com/my-custom-style.json' };

    const fromJson: CustomStyleSource = {
    json: { version: 8, sources: { ... }, layers: [ ... ] },
    };