Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions client/web/src/lit/custom-components/maps_api_loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export interface MapsJsApiOptions {
/** Maps JS API key. */
apiKey: string;
/**
* Maps JS API version or release channel, e.g. `'alpha'`. The `maps3d`
* library used by `GoogleMap` currently requires `'alpha'`, which is the
* Maps JS API version or release channel, e.g. `'beta'`. The `maps3d`
* library used by `GoogleMap` currently requires `'beta'`, which is the
* default.
*/
version?: string;
Expand Down Expand Up @@ -54,7 +54,7 @@ export function configureMapsJsApi(options: MapsJsApiOptions): void {
document.querySelector(MAPS_JS_API_SCRIPT_SELECTOR))) {
return;
}
const version = options.version ?? 'alpha';
const version = options.version ?? 'beta';
configuredImportLibrary = bootstrapMapsJsApi(options.apiKey, version);
}

Expand Down
5 changes: 3 additions & 2 deletions client/web/src/lit/custom-components/maps_api_loader_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ describe('maps_api_loader', () => {

it('injects the API on first import and resolves once it has loaded',
async () => {
// Intentionally use a non-default version.
configureMapsJsApi({apiKey: 'test-key', version: 'alpha'});

const promise = loadMapsLibrary('maps3d');
Expand All @@ -118,7 +119,7 @@ describe('maps_api_loader', () => {
expect(importLibrarySpy).toHaveBeenCalledWith('maps3d');
});

it('defaults to the alpha channel when no version is given', async () => {
it('defaults to the beta channel when no version is given', async () => {
const options = {apiKey: 'test-key'};
configureMapsJsApi(options);

Expand All @@ -127,7 +128,7 @@ describe('maps_api_loader', () => {

expect(appendedScripts.length).toBe(1);
expect(new URL(appendedScripts[0].src).searchParams.get('v'))
.toBe('alpha');
.toBe('beta');
expect(options).toEqual({apiKey: 'test-key'});
});

Expand Down
Loading