Display Asset Locations on a Map

While designing a page, you can use the Google Maps widget to display the locations of assets on a map. To do so, you require the API key generated by Google. This topic describes how to access the key and use it in the application that you want to create.

Procedure

  1. Access https://cloud.google.com/maps-platform/, and follow the on-screen instructions to generate the API key.
    The API key is generated.
    Note:
    Ensure that the following APIs are enabled for the key:
    • The Geocoding API
    • The Maps JavaScript API
  2. At the Ubuntu server command prompt, enter cd <path to the installation folder> to change to the installation directory.
  3. Enter sudo nano endapp/config/config.js to access the configuration file.
  4. In the command line gmapKey: '[GMAPSAPIKEY]', replace [GMAPSAPIKEY] with the API key generated in step 1.
  5. Save and close the file.
  6. Enter sudo docker-compose restart endapp to restart the endapp container.
    The Google Map widget is now available for use in the application. Asset locations are now displayed on a map.