Map Chart

On this page you will find instructions on how to set up a Map.

A Map should be used when you want to show a specific location of a data entry (e.g. Locations of partners).

For each map chart you have the option to choose your basemap between three options: Basic map (pictured above), Satellite and Hybrid.

See here how to upload maps to the system.

How to configure a map tooltip

Configuring the aggregation

  • To configure a tooltip to have an image, text and a link we first need to configure our aggregation to pass this data to our chart. For this go to the aggregation config editor (see image below)

     

  • after the editor opens on the left side we can declare variables from the retrieved data as we wish.

  • declare 3 variables named tooltipPhoto, tooltipLink and tooltipText (see image below) and point them to the respective questions in a submission you want to have displayed. These variables will be important later when we configure the tooltip in the map. The example code below shows these variables with the path to the questions defined:

    { parameters: [], parameterValues: {}, filterCriteria: [], lookUpPaths: [], modificationTime: '2021-08-30T14:02:35.617+00:00', aggregations: [ { '$project': { result: '$answers.name.en', value: '$answers.name.en', geo: '$answers.gPSCoordinate', tooltipPhoto: '$answers.photos', tooltipText: '$answers.name', tooltipLink: '$code' } } ] }

Explanation: each of these variables points to a question that is defined in the submission template. For example tooltipPhoto points to “$answers.photos”. The ‘$answers’ part indicates that we want any of the questions of the template and the ‘.photos' part indicates that we want the question named ‘photos’. Now when a submission is returned from a query to the database we will write the value of the question ‘photos’ into the variable 'tooltipPhoto’. Since this is an aggregation this is done for all retrieved submissions and each submission returned has its own set of these variables.

Configuring the tooltips

  • click on the three dots menu and select “Edit“ (see image below).

  • select the Map you want to create the tooltip for and click on “Settings“ (see Image below).

  • you are now presented with the Chart editor. If you want to configure a tooltip you can either type in the JSON directly or switch to the simple view.

  • to switch to simple click on the Pencil icon shown in the image

  • in the simple view you are presented with three input fields. In these fields we will enter the variable names that we declared earlier in the aggregation config (see Configuring the aggregation)

    • Tooltip Photo: This is the field to input the configured photo data source in your data.

    • Tooltip Text: This is the field to input the configured Text data source in your data.

    • Tooltip Link: This is the field to input the configured link data source in your data.