How to show Google Maps

You can display Google Maps in the following places in the system:

  1. In static HTML of a content panel of a visual perspective
  2. In object forms
  3. In object presentations

A Google map shown on a form can only show one address and this address must be stored in some attribute of the object. A Google map shown in a visual perspective or a presentation can show multiple. Again an object that the query queries on must have the attribute that stores the address to be shown on a Google map.

To define a Google map on a form define a form layout cell of the “Google Map” type – see the “Editing Form Sections” section. To define a Google Map on a presentation select the Google Map element in the Report Designer when defining a presentation for an object. Then define a query that would display this presentation. If a query finds multiple instances of an object, multiple addresses will be shown on the Google Map.

Defining a Google Map in a content panel of a visual perspective is explained in detail in the “Defining Content Panel with Static HTML content” section. The look and feel of markers can be customized using presentation rules of the corresponding attribute. This is explained here Common Properties

You can show colored areas on Google Maps using the so-called “polygon” feature. Each area must be represented as a collection of map points in the KML format. An example of the polygon specified in the KML format is provided here:

https://developers.google.com/kml/documentation/kml_tut#polygons

To display polygon areas on a Google Map you need to do the following:

  1. Define a business object representing the area. This object can have any attributes you like, but it must have an attribute that will store the KML representation of the polygon as described in the example above.
  2. Define a query that will retrieve instances of this object. Note that:
    1. You can define item rules on this query to specify the background color of the area
    2. You can define “Mouse Over” options to specify what happens when the user moves the mouse over the area
    3. You can define operations to specify what happens when the user clicks on the area
  3. When specifying Google Map options provide the query above and identify the attribute of the “Polygon” object that stores the KML data of the polygon.

Note: Some usages of Google Maps require you to create an account and specify a special key. If you need to provide a key for your Google Maps account you can do this in the predefined GoogleMapsKey attribute of the SystemSettings object.

  • Last modified: 2024/01/30 04:01