Skip to content

Commit

Permalink
Merge pull request #1 from DigitalHistory/google-maps-docs-update
Browse files Browse the repository at this point in the history
add API key instructions to google maps plugin
  • Loading branch information
menismu authored Nov 26, 2019
2 parents bb992ca + b3fdd0f commit 22b6b2e
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion plugins/_posts/2012-12-12-googlemaps.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,28 @@ title: Googlemap

## Purpose ##

Adds a map to the target div centered on the location specified by the user.
Adds a map to the target div centered on the location specified by the user. See below for a variety of map options.

**New for 1.5.12:** The Google Maps API now requires an API key in order to load. We recommend setting the API key globally before popcorn events are loaded, using the `.defaults()` method of the Popcorn object. Here is an example:

``` javascript
var p = Popcorn( "#video" )
.defaults ('googlemap', {
target: 'map',
apiKey: 'YOUR_API_KEY_HERE'
})

```
It is of course also possible to set the API Key individually for each map, but the API will in any case only ever be loaded once, so all calls to the mapping API will be attributed to the same maps user.

[See the Google Maps API docs](https://developers.google.com/maps/documentation/javascript/get-api-key) for instructions on how to create an API key and set permissions appropriately.

## Options ##

* **start** \[Number\] - is the time \[in seconds\] when you want the Googlemap to appear.
* **end** \[Number\] - is the time \[in seconds\] when you want the Googlemap to become hidden.
* **target** \[String\] - Target is the id of the DOM element that you want the map to appear in. This element must be in the DOM
* **apiKey** \[String\] - is your own Google Maps API Key, required as of June 11, 2018 (**new parameeter as of 1.5.12**)
* **type** \[String, optional\] - either: HYBRID (default), ROADMAP, SATELLITE, TERRAIN, STREETVIEW
* **zoom** \[Number, optional\] - defaults to 0
* **heading** \[Number, optional\] - STREETVIEW orientation of camera in degrees relative to true north (0 north, 90 true east, etc)
Expand Down

0 comments on commit 22b6b2e

Please sign in to comment.