Google Maps Viewer
  • 19 Jul 2024
  • 3 Minutes to read
  • Dark
    Light

Google Maps Viewer

  • Dark
    Light

Article summary

The goal of this build is to provide a system for storing and viewing Locations in Decisions using the Google Maps API.


Key Features

  • Users can create, view, and delete Address Locations directly from the Google Maps Views dashboard.
  • Autocomplete feature will dynamically suggest relevant addresses as the user types.
  • Selecting a suggested address will dynamically populate the other address fields on the Form, as well as update the Google Maps view.

Considerations

  • A Google Maps API Key is required for this Project.
    • Prior to using the Google Maps Viewer Project, the user will need to create an API Key for the Google Maps platform.
    • In particular, this key should be configured to make use of the Places API.
    • Users should reference the Google Maps Platform documentation for more information on creating an API key.
  • The API Key  should be configured as a system constant in Decisions.
    • Prior to using the Project, the user should create a Defined Constant to store their API Key in their Decisions environment. This can be accomplished in the System > Designers > Lookup Lists and Constants Folder.
    • The name of the constant should be Google Maps API Key.
    • The list category name should be Google Maps Viewer.
    • If the user provides a different constant name or category name, they will need to update the mapping on the Form in the Create Address Location Flow.

Main Flows

There are a few key Flows in this build, listed below:

Create Address Location

This Flow is used to view and store an Address. As the user types in the street address, the autocomplete feature will populate the dropdown box with relevant suggestions. Once the user selects one of these suggestions, the remaining address fields such as city, state, and zip code will be automatically populated in the Form. Additionally, the map view on the form will also be updated. Clicking on the SAVE button will store the information as an Address Location. This Flow can be run from the Google Maps Views Dashboard.

AutoComplete Address

This Flow provides the autocomplete functionality seen creating an Address Location. A GET request is made to Google Maps and a list of place predictions are returned based on the text provided in the street address field. This predictions list is updated as the user adds or alters the text in the street address field.

Delete All Addresses

This Flow allows the user to delete all saved Address Locations from the database. This Flow is available as an action on the Google Maps Views Dashboard.


How to Use

This section provides step-by-step instructions on utilizing the Google Maps Viewer Project. It details how to create, view, and delete Address Locations.

Create Address Locations

This details how to create a new Address Location.

  • In the Google Maps Viewer folder tree, navigate to the Google Maps Views Dashboard.
  • Click the Open Google Maps Viewer button in the top left corner of the Action Bar. This will display the Create Address Location Form.
  • In the Street Address field, begin typing in the address of the desired location. As the user types, predictions will begin displaying in the Street Address dropdown field.
  • Select the desired location from the dropdown list. This will automatically populate the remaining fields. If desired, the user can update the Name field. Then click Save.
  • The new Address Location will be visible in the Address History Report.

View Address

Saved Address Locations can be viewed at any time from the Google Maps Views Dashboard.

  • In the Google Maps Viewer folder tree, navigate to the Google Maps Views Dashboard.
  • In the Address History Report, right-click on the desired address and click View Address.
  • This will display the name, address, latitude and longitude coordinates, and the map view of the Location.
  • When finished viewing the Address Location, click Close.

Delete Addresses 

This User Action is used to delete one or more specific Address Locations.

  • In the Google Maps Viewer folder tree, navigate to the Google Maps Views Dashboard.
  • In the Address History Report, right-click and press CTRL to select multiple addresses for deletion. Alternatively, a single location can be selected by right-clicking on that address. Click Delete Addresses.
  • The Report will automatically refresh, showing that the selected Address Locations have been deleted.

Delete All Addresses 

This feature allows the user to delete all stored Address Locations.

  • In the Google Maps Viewer folder tree, navigate to the Google Maps Views Dashboard.
  • Click the Delete All Addresses button in the top right corner of the action bar. This will display the Delete Addresses Confirmation Form.
  • To delete all Address Locations, click Delete. Otherwise, close the Form.
  • The Report will automatically refresh, showing that all Address Locations have been deleted.



Was this article helpful?