Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add API key instructions to google maps plugin #1

Merged
merged 1 commit into from
Nov 26, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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