Map V2 Component

Overview
The Map V2 component is a Charts & Graphs component for displaying a visual map in Express View. Creators can use a Data Reference Key containing an address string to move the map view to the address location and pin it. You can also enable other map features, like Satellite View and Street View.
A Google Map API key is required when using this component. Visit the Google Maps Platform website to obtain a key: https://developers.google.com/maps/documentation/javascript/get-api-key.
The Map V2 component uses a Google Maps API key to access Google's Maps Javascript API and Geocoding APIs. Each API serves a different function:
-
Maps Javascript API: Displays a map that includes imagery and local data from the same source as Google Maps.
To learn more about the Maps Javascript API, visit the Google APIs Marketplace: https://console.cloud.google.com/marketplace/product/google/maps-backend.googleapis.com.
-
Geocoding API: Converts an address to a geographic coordinate. The Maps V2 component uses this API when referencing the address in the Data Reference Key field.
To learn more about the Geocoding API, visit the Google APIs Marketplace: https://console.cloud.google.com/marketplace/product/google/geocoding-backend.googleapis.com.
You'll find the Map V2 component in the Charts & Graphs group to the left side of the Module Builder.
About the Configuration Window
To learn more about general component settings, view our General Component Settings article.
Display Settings
Field Text
Setting |
Description |
---|---|
Label Text |
Label Text conveys what the input component is and what information it displays. Enter the purpose of the corresponding component or field. User-friendly labels make your module more accessible. Keep labels short and descriptive (a word or two) using title case. For longer entries, use sentence case. |
Default State Options
Setting |
Description |
---|---|
Read-Only View |
Prevents the map from accepting a Data Reference Key, and prevents end-users from adjusting the map view. Enabling this setting disables the following settings:
|
Hide Field |
Displays or hides the component from view. Setting Hide Field to (ON) hides the component in Express View. Setting it to (OFF) displays the component. The component is always visible in the Module Builder. By default, Hide Field is set to (OFF). Reveal a hidden component by using a logic component's Outputs table with the Type set to visible. |
Formatting
Setting |
Description |
---|---|
Make Map Draggable |
Set to (ON) to let end-users adjust the map view when clicking and dragging inside the map view port. |
Allow Map Zoom |
Set to |
Allow Satelite View |
Set to |
Allow Fullscreen View |
Set to |
Allow Street View |
Set to Learn more about street view here: https://www.google.com/streetview/. |
Multiple Values |
Enter a formatted address string for the map to begin on. |
Table View |
Displays the value in the table view of the submission data. |
Adding a Map V2 Component
For this example, create a module that lets end-users search for map locations by entering an address into an Address Search component. You need a Google Map API key to configure this module. Visit the Google Maps Platform website to obtain a key: https://developers.google.com/maps/documentation/javascript/get-api-key.
Configure the Address Search Component
First, add an Address Search component, so end-users can enter an address that stores in the Map V2 component.
1. | In the Module Builder, drag and drop an ![]() |
2. | In the Property ID field, enter address. |
3. | In the Label Text field, enter Address Search. |
4. | Under Formatting, set the Show Street, Show City, Show State, and Show Zip toggles to (ON). |
5. | Navigate to the Data settings. |
6. | From the Select API drop-down, select an available Google Places API. If you are in the Unqork Training environment, select Test Google Places API. |
To learn more about Address Search APIs, view our Enabling Address Search Using Address Services article.
7. | Click Save Component. |
Configure the Decisions Component
Configure a Decisions component to make the Map V2 component visible and trigger a Data Workflow component to get the address from the Address Search component.
1. | Drag and drop a ![]() ![]() |
2. | In the Property ID field, enter ruleMap. |
3. | In the Label Text field, enter ruleMap. |
4. | In the Inputs table, enter the following: |
Source |
Alias |
Type | Required | Silent | |
---|---|---|---|---|---|
1 |
address |
|
contains |
|
☐ (unchecked) |
5. | In the Outputs table, enter the following: |
Property ID |
Type | |
---|---|---|
1 |
dwfFormatAddress |
trigger |
2 |
mapAddress |
visible |
You'll add components configured with the dwfFormatAddress and mapAddress Property IDs in the following steps.
6. | Below the Conditionals table, click New Row. |
7. | In the Conditionals table, enter the following: |
address |
dwfFormatAddress_trigger | mapAddress_visible | |
---|---|---|---|
1 |
|
yes |
yes |
8. | Click Save Component. |
Configure the Data Workflow Component
The Data Workflow component retrieves the formatted address from the Address Search component. Then, it sends it to a Hidden component, so the Map V2 component can reference it.
1. | Drag and drop a Data Workflow onto the canvas, placing it below the ruleMap ![]() |
2. | In the Property ID field, enter dwfFormatAddress. |
3. | In the Label Text field, enter dwfFormatAddress. |
Configure the Input Operator
The Input operator brings the data from the address Address Search component into the Data Workflow.
1. | Drag and drop an Input operator onto your Data Workflow canvas. |
2. | Configure the Input operator's Info window as follows: |
Info | |
---|---|
category |
Input |
Component |
address |
required |
Yes |
source |
Default |
Configure the Get Operator
The Get operator selects the formatted key from the address Address Search component. The formatted key is an address in a string format.
1. | Drag and drop an Get operator onto your Data Workflow canvas. |
2. | Configure the Get operator's Info window as follows: |
Info | |
---|---|
category |
Get |
label |
formatted |
Preserve Argument Type |
☐ (unchecked) |
Path |
formatted |
3. | Connect the output port (right) of the address Input operator to the input port (left) of the formatted Get operator. |
Configure the Output Operator
The Output operator sends the data to the hiddenAddress Hidden component to store it.
1. | Drag and drop an Output operator onto your Data Workflow canvas. |
2. | Configure the Output operator's Info window as follows: |
Info | |
---|---|
category |
Output |
Component |
hiddenAddress |
action |
value |
3. | Connect the output port (right) of the formatted Get operator to the input port (left) of the hiddenAddress Output operator. |
4. | Click Save Component. |
Your completed Data Workflow looks like the following:
Configure the Hidden Component
The Hidden component stores the formatted address retrieved from the Data Workflow component. The Map V2 component uses the Hidden component as its Data Reference Key for placing a pin on the map view.
1. | Drag and drop a ![]() |
2. | In the Property ID field, enter hiddenAddress. |
3. | In the Label Text field, enter hiddenAddress. |
4. | Click Save Component. |
Configure the Map V2 Component
Lastly, configure a Map V2 component for end-users to visualize the address they searched. You'll configure the component to be hidden, using the Decisions component from earlier to make it visible when an end-user enters an address.
1. | Drag and drop a Map V2 component onto the canvas, placing it below the hiddenAddress ![]() |
2. | In the Property ID field, enter mapAddress. |
3. | In the Label field, enter Address. |
4. | Set Hide Field to (ON). This setting hides the map view until the end-user enters an address. |
5. | In the Data Reference Key field, enter hiddenAddress. |
6. | In the Google Key field, enter your Google Maps API key. You can obtain one here: https://developers.google.com/maps/documentation/javascript/get-api-key. |
7. | Click Save Component. |
8. | Save your module. |
Preview your module in Express View. You'll see the following functionality:
Structure of a Map V2 Component's Data
When using a Data Reference Key, the Map V2 component stores the address string in a key and the coordinates in an array. From the previous example, you'll see the following see in Express View and in the DevTools Console:
Here's how the same Map V2 component looks in the DevTools Console:
Resources