UNPKG

553 BPlain TextView Raw
1import {MapsAPILoader} from './maps-api-loader';
2
3/**
4 * When using the NoOpMapsAPILoader, the Google Maps API must be added to the page via a `<script>`
5 * Tag.
6 * It's important that the Google Maps API script gets loaded first on the page.
7 */
8export class NoOpMapsAPILoader implements MapsAPILoader {
9 load(): Promise<void> {
10 if (!(<any>window).google || !(<any>window).google.maps) {
11 throw new Error(
12 'Google Maps API not loaded on page. Make sure window.google.maps is available!');
13 }
14 return Promise.resolve();
15 };
16}