Map V2 Component

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.

To learn more about general component settings, view our General Component Settings article.

Field Text

A static image displaying the Map V2 Display settings

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:

  • Make Map Draggable

  • Allow Map Zoom

  • Allow Satelite View

  • Allow Fullscreen View

  • Allow Street View

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 Checked Box Icon (checked) to let end-users zoom in or out using (Apple Key) + Mousewheel Scroll or (Windows Key) + Mousewheel Scroll.

Allow Satelite View

Set to Checked Box Icon (checked) to insert a two-dimensional map and Satellite imagery buttons to the map view in Express View.

Allow Fullscreen View

Set to Checked Box Icon (checked) to display a Full Screen button in the top-right corner of the map view in Express View. When end-users click the Full Screen button, the map expands to full-screen view.

Allow Street View

Set to Checked Box Icon (checked) to insert the Google Street View(Street View) icon into the bottom-right corner of the map view in Express View. End-Users can click and drag the Google Street View(Street View) icon onto the map, placing them in the ground-level Street View.

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.

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 Address Search icon Address Search component onto the canvas.
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.

A static image displaying the Address Search componment's data settings.

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 Decisions Component icon Decisions component onto the canvas, placing it below the address Address Search icon Address Search component.
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

Checked Box Icon (checked)

☐ (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

A static image displaying the Decisions component with the Inputs, Outputs, and Micro Decisions tables filled in.

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 Decisions Component icon Decisions component.
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 icon 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 icon 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 iconHidden 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:

A static image displaying the dwfFormatAddress component's settings.

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 iconHidden component onto the canvas, placing it below the dwfFormatAddress Data Workflow component.
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 iconHidden component.
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:

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 a Map V2 component looks in the component configuration view:

A static image displaying a Map V2 component in Express View.

Resources