Socket
Socket
Sign inDemoInstall

google-maps-api

Package Overview
Dependencies
4
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    google-maps-api

Get up and running with the google maps API quickly


Version published
Weekly downloads
2.2K
increased by0.41%
Maintainers
1
Install size
609 kB
Created
Weekly downloads
 

Readme

Source

#google-maps-api Load a Google Maps API Object asynchronously. This module will return a Promise. Which will on resolved will return the "google.maps" object.

Or if you prefer you can simply use the callback instead.

This module also includes utility modules to be able to use parts of the maps api quickly:

geocode

Example

using via promise

var mapsapi = require( 'google-maps-api' )( 'your api key' );

mapsapi().then( function( maps ) {

  //use the google.maps object as you please
});

using via callback

require( 'google-maps-api' )( 'your api key', function( maps ) {

  //use the google.maps object as you please
})

including external google maps libraries

require( 'google-maps-api' )( 'your api key', ['places'], function( maps ) {

  //the google.maps object will now have the places api (google.maps.places)
})

API

  • apikey String | Object - Your Google Maps API Key or an object of the form { client: 'APIClientName', channel: 'APIClientChannel' }
  • [libraries] Array - Optional array of libraries to load such as [ 'places' ]
  • [onComplete] function - Optional callback which will return the google.maps object

Returns: Promise - When this promise resolves it will return the google.maps object

Keywords

FAQs

Last updated on 17 Feb 2016

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc