diff --git a/classes/Loader.html b/classes/Loader.html index 4288e453..8cb2d41c 100644 --- a/classes/Loader.html +++ b/classes/Loader.html @@ -6,40 +6,40 @@ document head and wrapping the callback function so as to return a promise.

const loader = new Loader({
apiKey: "",
version: "weekly",
libraries: ["places"]
});

loader.load().then((google) => {
const map = new google.maps.Map(...)
})
-

Hierarchy

Index

Constructors

Hierarchy

Index

Constructors

  • Creates an instance of Loader using LoaderOptions. No defaults are set using this library, instead the defaults are set by the Google Maps JavaScript API server.

    const loader = Loader({apiKey, version: 'weekly', libraries: ['places']});
     
    -

    Parameters

    Returns Loader

Properties

apiKey: string
+

Parameters

Returns Loader

Properties

apiKey: string
authReferrerPolicy: "origin"
+
authReferrerPolicy: "origin"
channel: string
+
channel: string
client: string
+
client: string
id: string
+
id: string
language: string
+
language: string
libraries: Libraries
+
libraries: Libraries
mapIds: string[]
+
mapIds: string[]
nonce: string
+
nonce: string
region: string
+
region: string
retries: number
+
retries: number
url: string
+
url: string
version: string
+
version: string

Accessors

Methods

  • deleteScript(): void
  • load(): Promise<typeof google>

Accessors

Methods

  • deleteScript(): void
  • load(): Promise<typeof google>
  • Load the Google Maps JavaScript API script and return a Promise.

    -

    Returns Promise<typeof google>

  • loadCallback(fn: (e: ErrorEvent) => void): void
  • loadCallback(fn: (e: ErrorEvent) => void): void
  • Load the Google Maps JavaScript API script with a callback.

    Parameters

    • fn: (e: ErrorEvent) => void
        • (e: ErrorEvent): void
        • Parameters

          • e: ErrorEvent

          Returns void

    Returns void

Generated using TypeDoc

\ No newline at end of file diff --git a/enums/LoaderStatus.html b/enums/LoaderStatus.html index 53286c57..4ef81497 100644 --- a/enums/LoaderStatus.html +++ b/enums/LoaderStatus.html @@ -1,3 +1,3 @@ LoaderStatus | @googlemaps/js-api-loader
Options
All
  • Public
  • Public/Protected
  • All
Menu

Enumeration LoaderStatus

The status of the Loader.

-

Index

Enumeration members

FAILURE = 3
INITIALIZED = 0
LOADING = 1
SUCCESS = 2

Generated using TypeDoc

\ No newline at end of file +

Index

Enumeration members

FAILURE = 3
INITIALIZED = 0
LOADING = 1
SUCCESS = 2

Generated using TypeDoc

\ No newline at end of file diff --git a/interfaces/LoaderOptions.html b/interfaces/LoaderOptions.html index 374420c7..fbb9da7a 100644 --- a/interfaces/LoaderOptions.html +++ b/interfaces/LoaderOptions.html @@ -4,9 +4,9 @@ is the authoritative source for LoaderOptions. /** Loader options

-

Hierarchy

Index

Properties

apiKey: string
+

Hierarchy

Index

Properties

apiKey: string
authReferrerPolicy?: "origin"
+
authReferrerPolicy?: "origin"

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 @@ -17,11 +17,11 @@ 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
deprecated

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

-
id?: string
+
channel?: string
client?: string
deprecated

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
+
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 @@ -35,7 +35,7 @@

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

-
libraries?: Libraries
+
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 @@ -43,10 +43,10 @@

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

Set the list of libraries for more options.

-
mapIds?: string[]
deprecated

Passing mapIds is no longer required in the script tag.

-
nonce?: string
+
mapIds?: string[]
deprecated

Passing mapIds is no longer required in the script tag.

+
nonce?: string

Use a cryptographic nonce attribute.

-
region?: string
+
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 @@ -62,11 +62,11 @@

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

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

The number of script load retries.

-
url?: string
+
url?: string

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

-
version?: string
+
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.

diff --git a/modules.html b/modules.html index e2302d8c..7b045782 100644 --- a/modules.html +++ b/modules.html @@ -1 +1 @@ -@googlemaps/js-api-loader
Options
All
  • Public
  • Public/Protected
  • All
Menu

@googlemaps/js-api-loader

Index

Enumerations

Classes

Interfaces

Type aliases

Variables

Type aliases

Libraries: ("drawing" | "geometry" | "localContext" | "places" | "visualization")[]

Variables

DEFAULT_ID: "__googleMapsScriptId" = "__googleMapsScriptId"

Legend

  • Constructor
  • Property
  • Method
  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +@googlemaps/js-api-loader
Options
All
  • Public
  • Public/Protected
  • All
Menu

@googlemaps/js-api-loader

Index

Enumerations

Classes

Interfaces

Type aliases

Variables

Type aliases

Libraries: ("drawing" | "geometry" | "localContext" | "places" | "visualization")[]

Variables

DEFAULT_ID: "__googleMapsScriptId" = "__googleMapsScriptId"

Legend

  • Constructor
  • Property
  • Method
  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file