Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

google-maps-js-api-loader

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

google-maps-js-api-loader

Wrapper for the loading of Google Maps JavaScript API script in the browser

  • 1.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
81
increased by65.31%
Maintainers
1
Weekly downloads
 
Created
Source

google-maps-js-api-loader

Description

Async loader for google maps api

Example

import Loader from "google-maps-js-api-loader";

await Loader.load({
  apiKey: API_KEY,
  // ...some other options
});

// or

// start load in root file
Loader.load({
  apiKey: API_KEY,
  // ...some other options
});

// and then await it in nested files
await Loader.completion;

API

load

async static load(options: LoaderOptions, onLoadingStart?: () => void): Promise<void>

Asynchronously loads Google Maps JavaScript API with given options, can be called multiple times, but always returns promise from the first call

Note: it throws an error if google.maps already exists on the first call or if the options are different from the first call


status

enum LoaderStatus {
  NONE, // default value
  LOADING,
  LOADED,
  ERROR,
}

static status: LoaderStatus

Current status of Loader


completion

static completion: Promise<void>

Promise from load first call


libraries

static libraries: Libraries

List of libraries from options


LoaderOptions

Options structure is similar to @googlemaps/js-api-loader


License

MIT © Krombik

Keywords

FAQs

Package last updated on 26 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc