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

  • 2.0.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";

Loader.options = {
  apiKey: API_KEY,
  // ...some other options
};

await Loader.load();

API

options

static options: LoaderOptions

Loader options (query parameters for script url and some script attributes), should be set before load execution


load

async static load(): Promise<void>

Starts loading of Google Maps JavaScript API with given options (if it not loaded yet), returns completion

throws error if google.maps already loaded by something else or if no options was provided


status

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

static status: LoaderStatus

Current status of Loader


completion

static completion: Promise<void>

Promise of loading, it has pending status even if load not called yet (can be useful if you want to do something after loading done, but don't want to start loading)


License

MIT © Krombik

Keywords

FAQs

Package last updated on 07 May 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