Map V2 Component

Overview

The Map V2 component is a Charts & Graphs component for displaying a visual map in Express View Express View is how your end-user views you application. Express View also lets you preview your applications to test your configuration and view the styling. This is also the view your end-users will see when interacting with your application. After configuring a module, click Preview in the Module Builder to interact with the module in Express View.. Creators Also known as Unqork Users, or Designer Users; is anyone who is inside the Unqork platform. can use a Data Reference Key containing an address string A string is an object that represents a sequence of characters. Strings typically hold data represented in text form. 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 APIs (application programming interfaces) are a set of protocols and definitions developers use to build and integrate application software. APIs act as the connective tissue between products and services. 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.

Map V2 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 referring to 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

Display Panel

A static image displaying the Map V2 Display settings

Field Text

Setting

Description

Label

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

Multiple Values

Enter a formatted address string for the map to start on.

Read-Only View

Prevents the map from accepting a Data Reference Key, and prevents end-users from adjusting the map view.

Checking this setting disables the following settings:

  • Make Map Draggable

  • Allow Map Zoom

  • Allow Satelite View

  • Allow Fullscreen View

  • Allow Street View

Table View

Displays the value in the table view of the submission data.

Hide Field

Shows or hides the component from view. Setting the Hide Field toggle to  (ON) hides the component in Express View. Setting the toggle to (OFF) shows the component. The component is always visible in the Module Builder.

By default, the Hide Field toggle is set to (OFF).

Reveal a hidden component using the OUTPUTS table in a logic component 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 viewport.

Allow Map Zoom

Set to Checked Box Icon (checked) to let end-users to zoom or out using (Apple Key) + Mousewheel Scroll or (Windows Key) + Mousewheel Scroll.

Allow Satelite View

Set to Checked Box Icon (checked) to insert 2D 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/.

 

Data Panel

A static image displaying the Map V2 Data settings

Data Source

Setting

Description

Data Reference Key

Enter the Property ID A Property ID is the unique field ID used by Unqork to track and link components in your module. of the component that contains a formatted address string. If a valid address exists, moves the map view to the address location and places a pin on it.

To retrieve an address from an Address Search icon Address Search component, use a Data Workflow Icon Data Workflow Get operator to extract the formatted address.

Google Key

Enter an API APIs (application programming interfaces) are a set of protocols and definitions developers use to build and integrate application software. APIs act as the connective tissue between products and services. key to access Google's Maps API.

*This field is required to use the Map V2 component.

Acquire an API key here: https://developers.google.com/maps/documentation/javascript/get-api-key.

The API Key in this field is hard-coded and cannot be dynamically changed.

Data Storage

Setting

Description

Store in Database

The Store Data in Database setting affects how data persists through your application. When set to  (ON), Unqork stores values entered into the field to the database (server-side submission). This occurs in three scenarios:

  • Navigating between Panels in a Navigation component. On navigation between pages (Panels), the component’s value saves to the database.

  • Triggering a module save event using a Button component with an Action Type of Save.

  • Navigating between screens of a workflow. On navigation between screens, the component’s value saves to the database.

By default, workflows persist data from all fields in the client-side submission when navigating between screens. However, only values from fields with Store Data in Database enabled store in the server-side submission.

Set the toggle to (OFF) when you don’t want to store the values from this field in the database.

When using a Plug-In to remote execute a module, ensure data moving between modules is persistent. You can optionally enable Store Data in Database for components in the source module. But any components in the API module whose values are included in an API response must have Store Data in Database enabled. When a component’s data is not persistent, the data isn't included in an API call's response. So, Plug-Ins or external services requesting data from the API module can't receive non-persistent data in the response. To learn more about Store Data in Database in the context of API modules, see the panelResponse Panel section of the API Specification Snippet article in our In-Product Help.

Store Data in Database also affects what data is tracked using Unqork’s built-in tracker. When the Enable Tracker and Track Value toggles are set to  (ON) in Module Settings, only values from fields with Store Data in Database enabled are tracked.

Validation Panel

A static image displaying the Map V2 Validation settings

User Input

Setting

Description

Required

This setting is currently in development.

Advanced Panel

A static image displaying the Map V2 Advanced settings

Set Execution

Setting

Description

Debounce the Calls After

The number of milliseconds that pass before this component calls the Google Maps API using the Data Reference Key value.

If your Data Reference Key dynamically updates, increase the value to reduce the call frequency to the Google Maps API.

The default value is 600 ms.

Additional Display Options

Setting

Description

The Default Location on Browser Load

Enter a formatted address string for the map to begin on.

Default Zoom Level

The map's zoom level based on the location set in The Default Location on Browser Load field. Set a value between 1 (World Map) and 22 (Street Level).

The default value is 8.

Point Zoom Level

The level of zoom after Set a value between 1 (World Map) and 22 (Street Level).

The default for this setting is 15.

Height of Map, In Pixels or %

Set the height of the map viewport in pixels (px).

The default value is 400px.

This setting accepts only pixel values at this time.

Width of Map, In Pixels or %

Set the width of the map viewport in pixels (px) or percentage (%).

The default value is 100%.

Additional Styling

Setting

Description

Custom CSS Class

Enter a Custom CSS Cascading Style Sheets (CSS) is a style sheet language used for presenting how a HTML or XML document looks to end-users. Class to apply to your component. Custom CSS lets you maintain a consistent look and feel when the field or element is part of a template or multiple modules.

Updated CSS styling applies to all components that reference this custom class name.

Adding a Map V2 Component

For this example, create a module that lets end-users End-users, also known as Express Users, are the individuals accessing an application through Express View. In most cases, end-users are the customers using the product. 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.

What You Need

To configure this module, you need the following components:

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 a Address Search icon Address Search component onto the canvas.
2. In the Property ID A Property ID is the unique field ID used by Unqork to track and link components in your module. field, enter address.
3. In the Label Text Label Text conveys what the input component is and what information it displays. Enter the purpose of the corresponding component or field. field, enter Address Search.
4. Under Address Display Options, set the Show Street, Show City, Show State, and Show Zip toggles to (ON).
5. To the left of the component's configuration window, select Data Icon Data.
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 & Close.

Configure the Decisions Component

Add 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 A Property ID is the unique field ID used by Unqork to track and link components in your module. field, enter ruleMap.
3. In the Label Text Label Text conveys what the input component is and what information it displays. Enter the purpose of the corresponding component or field. field, enter ruleMap.
4. In the INPUTS table, enter the following:

Property ID

Alias

Type Required Silent

address

 

contains

Checked Box Icon (checked)

☐ (unchecked)

5. In the OUTPUTS table, enter the following:

Property ID

Type

dwfFormatAddress

trigger

mapAddress

visible

You'll add components configured with the dwfFormatAddress and mapAddress Property IDs in the following steps.

6. In the MICRO DECISIONS table, enter the following:

Input Values

Output Values  
address dwfFormatAddress_trigger mapAddress_visible

 

yes

yes

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

7. Click Save.

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 that the Map V2 component references.

1. Drag and drop a Data Workflow Icon Data Workflow onto the canvas, placing it below the ruleMap Decisions Component icon Decisions component.
2. In the Property ID A Property ID is the unique field ID used by Unqork to track and link components in your module. field, enter dwfFormatAddress.
3. In the Label Text Label Text conveys what the input component is and what information it displays. Enter the purpose of the corresponding component or field. field, enter dwfFormatAddress.
4. From the Trigger Type drop-down, select Watch.

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 Icon Data Workflow canvas.
2. Configure the Input operator's Info window as follows:

Setting

Value

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 A string is an object that represents a sequence of characters. Strings typically hold data represented in text form. format.

1. Drag and drop an Get operator onto your Data Workflow Icon Data Workflow canvas.
2. Configure the Get operator's Info window as follows:

Setting

Value

Label

formatted

Preserve Argument Type

☐ (unchecked)

Path

formatted

3. Connect the output port (right) of the Input operator to the input port (left) of the 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 Icon Data Workflow canvas.
2. Configure the Output operator's Info window as follows:

Setting

Value

Component

hiddenAddress

action

value

3. Connect the output port (right) of the Get operator to the input port (left) of the Output operator.
4. Click Save.

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 Icon Data Workflow component.
2. In the Property ID A Property ID is the unique field ID used by Unqork to track and link components in your module. field, enter hiddenAddress.
3. In the Label Text Label Text conveys what the input component is and what information it displays. Enter the purpose of the corresponding component or field. field, enter hiddenAddress.
4. Click Save & Close.

Configure the Map V2 Component

Lastly, add a Map V2 component for end-users to visualize the address they search for. You'll configure the component to be hidden. The Decision component from earlier makes 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 A Property ID is the unique field ID used by Unqork to track and link components in your module. field, enter mapAddress.
3. In the Label Label Text conveys what the input component is and what information it displays. Enter the purpose of the corresponding component or field. field, enter Address.
4. Set the Hide Field toggle to (ON). This hides the map view until the user has entered 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 acquire one here: https://developers.google.com/maps/documentation/javascript/get-api-key.
7. Click Save & Close.
8. Save your module.

Preview your module in Express View Express View is how your end-user views you application. Express View also lets you preview your applications to test your configuration and view the styling. This is also the view your end-users will see when interacting with your application. After configuring a module, click Preview in the Module Builder to interact with the 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 The DevTools Console helps you securely store, build, test, and deploy your software.:

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