Map V2 Component

Prev Next

Overview

The Map V2 Centauri (v1.0) 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:

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

Hide Field

Displays or hides the component from view. Setting Hide Field to A toggle switch indicating an on/off state for a user interface element. (ON) hides the component in Express View. Setting it to A toggle switch in the 'on' position, indicating an active setting or feature. (OFF) displays the component. The component is always visible in the Module Builder.

By default, Hide Field is set to A toggle switch in the 'on' position, indicating an active setting or feature. (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 A toggle switch indicating an on/off state for a user interface element. (ON) to let end-users adjust the map view when clicking and dragging inside the map view port.

Allow Map Zoom

Set to (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) to insert  a two-dimensional map and Satellite imagery buttons to the map view in Express View.

Allow Fullscreen View

Set to (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) 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/.

A static image displaying the Map V2 Display settings

Input Behavior        

Setting

Description

Input Behavior

Controls how end-users interact with the component. Choose from the following options:

  • Enable User Input: Allow end-users to view and enter data in this field.

  • Disable User Input: Prevents end-users from entering data in the field, but lets them view it. In the Module Builder, the field’s background displays as gray. In Express View, when end-users hover over the field, their cursor displays with a prohibited symbol.

  • Read Only - Legacy: Prevents end-users from entering data and replaces the field with the component’s data value. If no value is provided, the component displays None.

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.

A static image displaying the Map V2 Display settings Data Settings

Data Storage        

Setting

Description

Store in Database                    

The Store Data in Database setting affects how data persists through your application. When set to A toggle switch indicating an on/off state for a user interface element. (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 A toggle switch in the 'on' position, indicating an active setting or feature. (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

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 A toggle switch indicating an on/off state for a user interface element. (ON) in Module Settings, only values from fields with Store Data in Database enabled are tracked.

A static image displaying the Map V2 Data settings Data Source

Setting

Description

Data Reference Key                    

Enter the Property ID 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 Get operator to extract the formatted address.

Google Key                    

Enter an API 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.

Validation Settings

User Input        

Setting

Description

Required

Set to A toggle switch indicating an on/off state for a user interface element. (ON) to make this component required. However, this component does not receive user input and no validation occurs.

A static image displaying the Map V2 Validation settings 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.

A static image displaying the Map V2 Advanced settings 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 view port in pixels (px).

The default value is 400px.

This setting accepts only pixel (px) values at this time.

Width of Map, In Pixels or %                    

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

The default value is 100%.

Additional Styling

Setting

Description

Custom CSS Class                        

Enter a Custom CSS 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 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 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 A toggle switch indicating an on/off state for a user interface element. (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 onto the canvas, placing it below the address 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)

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

  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:

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 Hidden 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 Hidden component.

  2. In the Property ID field, enter mapAddress.

  3. In the Label field, enter Address.

  4. Set Hide Field to A toggle switch indicating an on/off state for a user interface element. (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:

Overview

The Map V2 Centauri (v1.0) 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:

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 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.

Formatting

Setting

Description

Make Map Draggable

Set to A toggle switch indicating an on/off state for a user interface element. (ON) so end-users can adjust the map view when clicking and dragging inside the map view port.

Allow Map Zoom

Set to (checked) so end-users can zoom in or out using (Apple Key) + Mousewheel Scroll or (Windows Key) + Mousewheel Scroll.

Allow Satelite View

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

Allow Fullscreen View

Set to (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) 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/.

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

Displays or hides the component from view. Setting Hide Field to A toggle switch indicating an on/off state for a user interface element. (ON) hides the component in Express View. Setting it to A toggle switch in the 'on' position, indicating an active setting or feature. (OFF) displays the component. The component is always visible in the Module Builder.

By default, Hide Field is set to A toggle switch in the 'on' position, indicating an active setting or feature. (OFF).

Reveal a hidden component using the OUTPUTS table in a logic component with the Type set to visible.

Data Panel

A static image displaying the Map V2 Data settings

Data Source

Setting

Description

Data Reference Key                    

Enter the Property ID 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 Get operator to extract the formatted address.

Google Key                    

Enter an API 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 A toggle switch indicating an on/off state for a user interface element. (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 A toggle switch in the 'on' position, indicating an active setting or feature. (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.

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 A toggle switch indicating an on/off state for a user interface element. (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 Styling

Setting

Description

Custom CSS Class                        

Enter a Custom CSS 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.

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%.

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, configure 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 component onto the canvas.

  2. In the Property ID field, enter address.

  3. In the Label Text field, enter Address Search.

  4. Under Address Display Options, set the Show Street, Show City, Show State, and Show Zip toggles to A toggle switch indicating an on/off state for a user interface element. (ON).

  5. To the left of the component's configuration window, select 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

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 onto the canvas, placing it below the address 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:

    Property ID

    Alias

    Type

    Required

    Silent

    address                

    contains

    (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, 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.

  2. In the Property ID field, enter dwfFormatAddress.

  3. In the Label Text 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 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:

    Setting

    Value

    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:

    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 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:

    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 Hidden 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 & Close.

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 Hidden component.

  2. In the Property ID field, enter mapAddress.

  3. In the Label field, enter Address.

  4. Set Hide Field to A toggle switch indicating an on/off state for a user interface element. (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 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. 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 a Map V2 component looks in the component configuration view:

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

Here's how the same Map V2 component looks in the DevTools Console:

A static image displaying a Map V2 component in the DevTools Console view.

Resources