MCPcopy Create free account
hub / github.com/googlemaps/js-api-loader / importLibrary

Function importLibrary

src/index.ts:111–123  ·  view source on GitHub ↗
(libraryName: string)

Source from the content-addressed store, hash-verified

109): Promise<LibraryMap[TLibraryName]>;
110
111export async function importLibrary(libraryName: string): Promise<unknown> {
112 if (!setOptionsWasCalled_) {
113 logDevWarning(MSG_SET_OPTIONS_NOT_CALLED);
114 }
115
116 if (!window?.google?.maps?.importLibrary) {
117 throw new Error("google.maps.importLibrary is not installed.");
118 }
119
120 return (await google.maps.importLibrary(
121 libraryName
122 )) as LibraryMap[keyof LibraryMap];
123}
124
125/**
126 * The installImportLibrary_ function makes sure that a usable version of the

Callers 7

initMapFunction · 0.85
addMarkersFunction · 0.85
initMapFunction · 0.85
addMarkersFunction · 0.85
initMapFunction · 0.85
addMarkersFunction · 0.85
index.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…