Set up Google Maps API

Map pages enable you to graphically display data on a Google Map, based on location data.

Before you begin

Role required: admin

About this task

Maps can be generated using basic JavaScript, but are flexible enough to display even the most complicated of queries. The maps you generate use standard Google Maps API mapping features, including varoius link types to records in your instance. This feature requires the Google Maps plugin.
Figure 1. Map page
Map page

Procedure

  1. If necessary, obtain a Google Maps for Work license key to cover development use of the Google Maps API.
    See the Getting Started Guide on the Google web site for details on obtaining a key, using the API, and relevant terms of service.
  2. When you receive your key, enter it in the System Properties > Google Maps property form, and configure your maps using the property definitions from the table.
  3. After you complete the configuration, create map pages or use the default pages included with the plugin.
    Map pages define what data is displayed on the map and the appearance of the links. For a tutorial on how to display all markers that link to your records, see the Display Map Markers on Google Maps blog post on theServiceNow Community.
    Property Description
    google.maps.auto_close If true, automatically closes a map information window before opening a new one.
    • Type: true/false
    • Default value: true
    • Location: System Properties > Google Maps
    google.maps.client Client ID for Google Maps API for Work.
    • Type: string
    • Default value: gme-servicenow
    • Location: System Properties > Google Maps
    google.maps.private.key Private key for Google Maps API for Work. This key activates the geolocation feature, which locates users in the system precisely, using data from their mobile devices.
    • Type: string
    • Default value: empty
    • Location: System Properties > Google Maps
    google.maps.version Version number of the current installation of Google Maps API.
    • Type: string
    • Default value: current version number
    • Location: System Properties > Google Maps
    google.maps.key The Google Maps API key that is tied to the URL of the server. This key authorizes development use of Google Maps API.
    • Type: string
    • Default value: empty
    • Location: System Properties > Google Maps
    google.maps.latitude Starting latitude of the map. This value determines the starting position displayed in Google Maps.
    • Type: string
    • Default value: 36.008522
    • Location: System Properties > Google Maps
    google.maps.longitude Starting longitude of the map. This value determines the starting position displayed in Google Maps pages.
    • Type: string
    • Default value: -95.221764
    • Location: System Properties > Google Maps
    google.maps.max_items Maximum number of items to display on the map.
    • Type: integer
    • Default value: 500
    • Location: System Properties > Google Maps
    google.maps.table Table used by the map. The table needs the following fields: name, longitude, latitude.
    • Type: string
    • Default value: cmn_location
    • Location: System Properties > Google Maps
    google.maps.zoom Starting zoom level of the map (1 is the lowest)
    • Type: string
    • Default value: 4
    • Location: System Properties > Google Maps