TomTom API key for authentication.
Required for all SDK features. Obtain an API key from the my.tomtom.com.
Base URL of every TomTom request: service calls, and the style, tile, sprite and glyph URLs the map fetches.
Change it only to route those requests through a proxy of your own. Leaving apiKey unset too
switches the SDK to proxy-credentials mode, where no key leaves the browser and requests carry the proxy's
session cookie.
It must be https:, or relative to the page; http: is accepted only for a loopback address (localhost,
127.0.0.0/8, [::1]). Otherwise service calls reject, and the map constructor throws, with code INSECURE_BASE_URL.
OptionaldisplayCustom display units for time and distance.
Applied to formatDistance and formatDuration utilities, which are used throughout the SDK for displaying map information. If not provided, default unit labels are used.
OptionalgeopoliticalGeopolitical view of the map and of service results: whose perspective disputed territories are shown from.
Unset, each TomTom API picks the default view for the country the request comes from.
OptionallanguageLanguage code for SDK services and map content.
Accepts IETF language codes (case-insensitive). Affects search results, routing instructions, and map labels.
OptionalretryConfiguration for automatic retry on rate-limited (429) responses.
When set, the SDK automatically retries requests that receive a 429 status code
using exponential backoff. A field left out takes its default; undefined disables retrying.
OptionalsendWhether requests to TomTom carry the tomtom-user-agent header, naming the SDK and its version.
TomTom reads it to tell which SDK versions are in use. Turn it off when that header must not leave the page, or when a proxy of yours should not have to allow it in its CORS preflight answer.
Global configuration for the TomTom Maps SDK.
Contains essential parameters like API keys, language settings, and display preferences that apply across all SDK services and map functionality.
Remarks
This configuration can be set globally using TomTomConfig and will be merged with service-specific configurations, with service configs taking precedence.
Example