The Google Maps JavaScript API documentation is the authoritative source for [[LoaderOptions]]. /** Loader options

interface LoaderOptions {
    apiKey: string;
    authReferrerPolicy?: "origin";
    channel?: string;
    client?: string;
    id?: string;
    language?: string;
    libraries?: Libraries;
    mapIds?: string[];
    nonce?: string;
    region?: string;
    retries?: number;
    url?: string;
    version?: string;
}

Properties

apiKey: string
authReferrerPolicy

Maps JS customers can configure HTTP Referrer Restrictions in the Cloud Console to limit which URLs are allowed to use a particular API Key. By default, these restrictions can be configured to allow only certain paths to use an API Key. If any URL on the same domain or origin may use the API Key, you can set auth_referrer_policy=origin to limit the amount of data sent when authorizing requests from the Maps JavaScript API. This is available starting in version 3.46. When this parameter is specified and HTTP Referrer Restrictions are enabled on Cloud Console, Maps JavaScript API will only be able to load if there is an HTTP Referrer Restriction that matches the current website's domain without a path specified.

channel?: string
client?: string

See https://developers.google.com/maps/premium/overview, use apiKey instead.

id?: string

The id of the script tag. Before adding a new script, the Loader will check for an existing one.

language?: string

By default, the Maps JavaScript API uses the user's preferred language setting as specified in the browser, when displaying textual information such as the names for controls, copyright notices, driving directions and labels on maps. In most cases, it's preferable to respect the browser setting. However, if you want the Maps JavaScript API to ignore the browser's language setting, you can force it to display information in a particular language when loading the Maps JavaScript API code.

For example, the following example localizes the language to Japan:

const loader = Loader({apiKey, language: 'ja', region: 'JP'});

See the list of supported languages. Note that new languages are added often, so this list may not be exhaustive.

libraries?: Libraries

When loading the Maps JavaScript API via the URL you may optionally load additional libraries through use of the libraries URL parameter. Libraries are modules of code that provide additional functionality to the main Maps JavaScript API but are not loaded unless you specifically request them.

const loader = Loader({
apiKey,
libraries: ['drawing', 'geometry', 'places', 'visualization'],
});

Set the list of libraries for more options.

mapIds?: string[]

Passing mapIds is no longer required in the script tag.

nonce?: string

Use a cryptographic nonce attribute.

region?: string

When you load the Maps JavaScript API from maps.googleapis.com it applies a default bias for application behavior towards the United States. If you want to alter your application to serve different map tiles or bias the application (such as biasing geocoding results towards the region), you can override this default behavior by adding a region parameter when loading the Maps JavaScript API code.

The region parameter accepts Unicode region subtag identifiers which (generally) have a one-to-one mapping to country code Top-Level Domains (ccTLDs). Most Unicode region identifiers are identical to ISO 3166-1 codes, with some notable exceptions. For example, Great Britain's ccTLD is "uk" (corresponding to the domain .co.uk) while its region identifier is "GB."

For example, the following example localizes the map to the United Kingdom:

const loader = Loader({apiKey, region: 'GB'});
retries?: number

The number of script load retries.

url?: string

Use a custom url and path to load the Google Maps API script.

version?: string

In your application you can specify release channels or version numbers:

The weekly version is specified with version=weekly. This version is updated once per week, and is the most current.

const loader = Loader({apiKey, version: 'weekly'});

The quarterly version is specified with version=quarterly. This version is updated once per quarter, and is the most predictable.

const loader = Loader({apiKey, version: 'quarterly'});

The version number is specified with version=n.nn. You can choose version=3.40, version=3.39, or version=3.38. Version numbers are updated once per quarter.

const loader = Loader({apiKey, version: '3.40'});

If you do not explicitly specify a version, you will receive the weekly version by default.