# Map

{% hint style="danger" %} <mark style="color:red;">Theme retirement</mark> | Context is no longer available on the Shopify theme store. **Theme support and updates for current users will end after May 18, 2024**. [Learn more here](https://help.fluorescent.co/context/readme/theme-retirement).
{% endhint %}

Use the **Map** section to promote your brick-and-mortar retail stores. This section is designed specifically for your address information and store hours.

## **Set up section**

Add this section to any template (except Checkout) and use the drag-and-drop handles to re-order its position. You can add this section multiple times with different content and settings.

{% hint style="warning" %}
Editing a template changes all pages that use that template. To edit specific pages, you can create and assign new templates or use metafields and dynamic sources.
{% endhint %}

<details>

<summary><mark style="color:blue;">STEPS</mark></summary>

In your theme editor (**Customize**):

1. Select a **Template** to edit from the dropdown menu in the top bar.
2. Under **Template**, click **(+) Add section** and select **Map**.
3. Change the order of your sections by using the drag and drop handles **`⋮⋮`**
4. Click on the title block to change the **Heading** text for the section.
5. Click on the **Store info** block to add your address and opening hours.

</details>

## **Configure your map**

To add a Google Map, you will need to set up a Google Maps API Key.

<details>

<summary><mark style="color:blue;">STEPS</mark></summary>

In your theme editor (**Customize**):

1. Click on the **Map** section to open the settings.
2. (*Optional*.) Add an **Image** for the map section.

   > This image will display as a fallback image if the map does not load.
3. The next fields (**Map address**, **Google Maps API key**, and **Custom map JSON**) require some additional set up.

   > To learn more, see: [Get a Google Maps API key](#get-a-google-maps-api-key)
4. Return to the list of sections to find your new Map section.

   > Use the drag handles to rearrange the order of your sections:

   ![](https://3096289102-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fvbp0IBkqpivnJ0UBSwsh%2Fuploads%2Fgit-blob-8673b93ceb2d3d37d426aced9e38549d24c85c52%2Fshopify-section-drag-handles.jpeg?alt=media)
5. Click **Save** in the top-right corner.

</details>

## **Get a Google Maps API key**

Here's what you need to do to get a Google Maps API key:

<details>

<summary><mark style="color:blue;">STEPS</mark></summary>

1. Sign up for Google Maps Platform. ([Link](https://cloud.google.com/maps-platform/#get-started).)
2. Select the **Maps** product.

   ![](https://3096289102-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fvbp0IBkqpivnJ0UBSwsh%2Fuploads%2Fgit-blob-4865b87aa836863059a993d71a81e85777d6d88d%2Fenable-google-maps-platform.jpeg?alt=media)
3. Create a project for your Shopify store.
4. Enter your billing information.

   > Unless you get more than 500,000 views per month, you will not be charged for map API requests. They will all be paid for with the recurring $200 credit Google gives its Cloud Platform users each month.

</details>

After this process, you are granted a Google Maps API key, which you can copy into Context's map section *Google Maps API Key* field:

![](https://3096289102-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fvbp0IBkqpivnJ0UBSwsh%2Fuploads%2Fgit-blob-6d85bd933ef219d34ac2a603a6fb04bb782dd38e%2Fenable-google-maps-platform-finish.jpeg?alt=media)

The API key should be a large jumbled string of characters, like this: **`AIzaSyCuv0hqbs8Itd_UvRQ0gAkwe5OxkYw_q08`**.

We recommend that you restrict your API key so it can only be used on requests to your store's URL (like **`https://your-store.com`**). You can restrict to multiple URLs if you also want to add your **`https://your-store.myshopify.com`** address for testing purposes.

The following video shows you how to do this from the [Google Cloud Platform Google Maps dashboard](https://console.cloud.google.com/google/maps-apis/overview) here:

If you lost your API key, you can find it again (or regenerate it) from the Google Cloud Platform [API Credentials](https://console.cloud.google.com/apis/credentials) page.

## **Custom map JSON**

Using JavaScript Object Notation (JSON), a form of JavaScript code used to send structured information and configuration, you can change the look and feel of your map.

Using the [Google Maps Platform Styling Wizard](https://mapstyle.withgoogle.com/) website, you can choose different map themes or tweak map settings.

Check out the following video for more information:

Once you have copied the JSON to your clipboard, you can paste it into Context's **Custom map JSON** setting.

## Settings reference

Click on the section to find the following settings:

| Setting             | Description                                                                                                                                                                                                   |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Heading             | Enter heading text to display as a section title.                                                                                                                                                             |
| Store information   | Add your store information, like your address and hours.                                                                                                                                                      |
| Image               | Select or upload an image to be displayed.                                                                                                                                                                    |
| Map address         | Add a street address that Google Maps can use to find your store.                                                                                                                                             |
| Google Maps API key | Add your Google Maps API key. You can generate one using the directions                                                                                                                                       |
| Custom map JSON     | <p>You can paste JSON configuration in this field to change the look and feel of your map.<br><br>You can find some map presets using Google's <a href="https://mapstyle.withgoogle.com/">Map styles</a>.</p> |
| Map link text       | Add link text for the map link generated by Google Maps.                                                                                                                                                      |

<br>

***

> **Related links**
>
> [Image with text](https://help.fluorescent.co/context/sections/theme-sections/image-with-text)\
> [Rich text section](https://help.fluorescent.co/context/sections/theme-sections/rich-text)
