Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2528c04

Browse files
feat: Adopt the inline bootstrap loader (#797)
* Adopt the inline bootstrap loader: https://developers.google.com/maps/documentation/javascript/load-maps-js-api#dynamic-library-import and provide an importLibrary() alias 6fe1903
1 parent ddf38eb commit 2528c04

File tree

14 files changed

+3484
-937
lines changed

14 files changed

+3484
-937
lines changed

‎assets/main.js‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎assets/search.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎classes/Loader.html‎

Lines changed: 21 additions & 17 deletions
Large diffs are not rendered by default.

‎dist/index.d.ts‎

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,9 @@
1414
* limitations under the License.
1515
*/
1616
/// <reference types="google.maps" />
17-
/**
18-
* @ignore
19-
*/
20-
declare global {
21-
interface Window {
22-
__googleMapsCallback: (e: Event) => void;
23-
}
24-
}
2517
export declare const DEFAULT_ID = "__googleMapsScriptId";
26-
export declare type Libraries = ("drawing" | "geometry" | "localContext" | "marker" | "places" | "visualization")[];
18+
export type Library = "core" | "maps" | "places" | "geocoding" | "routes" | "marker" | "geometry" | "elevation" | "streetView" | "journeySharing" | "drawing" | "visualization";
19+
export type Libraries = Library[];
2720
/**
2821
* The Google Maps JavaScript API
2922
* [documentation](https://developers.google.com/maps/documentation/javascript/tutorial)
@@ -248,7 +241,6 @@ export declare class Loader {
248241
* See [[LoaderOptions.authReferrerPolicy]]
249242
*/
250243
readonly authReferrerPolicy: "origin";
251-
private CALLBACK;
252244
private callbacks;
253245
private done;
254246
private loading;
@@ -271,21 +263,40 @@ export declare class Loader {
271263
* CreateUrl returns the Google Maps JavaScript API script url given the [[LoaderOptions]].
272264
*
273265
* @ignore
266+
* @deprecated
274267
*/
275268
createUrl(): string;
276269
deleteScript(): void;
277270
/**
278271
* Load the Google Maps JavaScript API script and return a Promise.
272+
* @deprecated, use importLibrary() instead.
279273
*/
280274
load(): Promise<typeof google>;
281275
/**
282276
* Load the Google Maps JavaScript API script and return a Promise.
283277
*
284278
* @ignore
279+
* @deprecated, use importLibrary() instead.
285280
*/
286281
loadPromise(): Promise<typeof google>;
282+
/**
283+
* See https://developers.google.com/maps/documentation/javascript/reference/top-level#google.maps.importLibrary
284+
*/
285+
importLibrary(name: "core"): Promise<google.maps.CoreLibrary>;
286+
importLibrary(name: "maps"): Promise<google.maps.MapsLibrary>;
287+
importLibrary(name: "places"): Promise<google.maps.PlacesLibrary>;
288+
importLibrary(name: "geocoding"): Promise<google.maps.GeocodingLibrary>;
289+
importLibrary(name: "routes"): Promise<google.maps.RoutesLibrary>;
290+
importLibrary(name: "marker"): Promise<google.maps.MarkerLibrary>;
291+
importLibrary(name: "geometry"): Promise<google.maps.GeometryLibrary>;
292+
importLibrary(name: "elevation"): Promise<google.maps.ElevationLibrary>;
293+
importLibrary(name: "streetView"): Promise<google.maps.StreetViewLibrary>;
294+
importLibrary(name: "journeySharing"): Promise<google.maps.JourneySharingLibrary>;
295+
importLibrary(name: "drawing"): Promise<google.maps.DrawingLibrary>;
296+
importLibrary(name: "visualization"): Promise<google.maps.VisualizationLibrary>;
287297
/**
288298
* Load the Google Maps JavaScript API script with a callback.
299+
* @deprecated, use importLibrary() instead.
289300
*/
290301
loadCallback(fn: (e: ErrorEvent) => void): void;
291302
/**
@@ -298,7 +309,6 @@ export declare class Loader {
298309
private reset;
299310
private resetIfRetryingFailed;
300311
private loadErrorCallback;
301-
private setCallback;
302312
private callback;
303313
private execute;
304314
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /