pantheon-systems/google-map-gutenberg-block

Name: google-map-gutenberg-block

Owner: Pantheon

Description: null

Created: 2018-01-10 01:25:45.0

Updated: 2018-05-10 15:54:50.0

Pushed: 2018-05-10 15:55:13.0

Homepage: null

Size: 17625

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Map Embed Gutenberg Block for Google Maps By Pantheon

This WordPress plugin provides a Google Maps embed block for the Gutenberg WordPress editor.

Installation

The Map Embed Gutenberg Block for Google Maps By Pantheon plugin can be installed just like you would install any other WordPress plugin. To install from GitHub simply download the .zip file. You can then either unzip it and add it to your plugins folder or upload the .zip file when adding a new plugin in the WordPress dashboard.

Because Google Map embes require an API key you'll need to provide a valid API key in plugin settings as well. See the detailed steps below.

  1. Install and activate the Gutenberg plugin if you are on a WordPress version <= 5.0
  2. Search for 'embed-gutenberg-block-google-maps' when adding a new plugin in the WordPress dashboard or upload the plugin files manually to the /wp-content/plugins/ directory
  3. Activate the plugin through the 'Plugins' menu in WordPress
  4. Obtain a Google Map embed API key (instructions below)
  5. Visit the plugin settings page and enter/save your Google Map embed API key
  6. Clear full page cache if enabled for your site so the API key can be read from the plugin settings via the REST API
  7. Search for Google Map when adding a new content block
  8. Enter a location for the map. This can be an exact address for a queryable location, such as New York, NY
  9. Optionally edit the advanced block settings
API Key

This plugin requires an API key to interact with Google Maps. Without an API key maps will not be displayed.

To obtain an API key follow these steps:

  1. Create a new project in the Google Developer's console by clicking here and selecting Create new project
  2. Name your project
  3. Select HTTP referrers (web sites) for the Key restriction type
  4. Enter the domains where your API key will be used
    • Example: *.mysite.com
  5. Click the Create button
  6. Write your API key down in a safe place
  7. Enter the API key into the plugin settings
  8. Clear full page caching, if necessary

Note: The API key will be exposed publicly to generate the map. It is important to restrict your API key so others do not abuse it. The API key will be used, and displayed, in both the WordPress editor and the front end of the site.

Use

Once you have saved an API key into the plugin settings simply enter a location, such as New York, NY, or a full address. You may also choose the map width, height, zoom level and toggle between an interactive map or a static image in the block settings, which are visible in the right-hand sidebar when the block is selected.

Google Map Gutenberg Block Demo

Changelog
1.3.1
1.3
1.2
1.1.2
1.1.1
1.1.0
1.0.0

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.