Optional
authMaps 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.
Optional
channelOptional
clientSee https://developers.google.com/maps/premium/overview, use apiKey
instead.
Optional
idThe id of the script tag. Before adding a new script, the Loader will check for an existing one.
Optional
languageBy 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.
Optional
librariesWhen 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.
Optional
mapOptional
nonceUse a cryptographic nonce attribute.
Optional
regionWhen 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'});
Optional
retriesThe number of script load retries.
Optional
urlUse a custom url and path to load the Google Maps API script.
Optional
versionIn 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.
The Google Maps JavaScript API documentation is the authoritative source for [[LoaderOptions]]. /** Loader options