Skip to content
Richard Barad edited this page Jun 8, 2019 · 3 revisions

Introduction

A popup is an element contained inside a layer. Popups are configured for layers which have additional attributes which you want your application users to be able to view. When a user clicks on a geographic feature which has a popup configured the attribute information for the selected fields will be visible in the data tab of the application. Pop-ups are currently only supported for dynamic and feature layers.

The following value-attributes pairs need to be configured for a pop-up:

Property Explanation Data type Example
Title List of popup titles in different languages Title List "title": {"en": "Active Fires","fr": "Feux actifs","sp": "Incendios activos"},
Content List of popup content in different languages Content List See below

Popoup content

The popup contains a list of popup content in different languages. Popups can be configured for all the mapbuilder languages. The content for each language includes a list of attributes which should appear in a popup. Each attribute which appears in the popup must have a specified label and FieldExpression. The label specifies the popup label (typically the field alias) and the FieldExpression indicates the name of the field in the attribute table. The json syntax below shows how to configure an English popup for the active fire layer. The pop will include six fields: Brightness, Confidence, Latitude, Longitude, Acquisition Date, And Acquisition Time.

"popup": {
	"title": {
		"en": "Active Fires"
	},
	"content": {
		"en": [{
			"label": "Brightness",
			"fieldExpression": "BRIGHTNESS"
		},
		{
			"label": "Confidence",
			"fieldExpression": "CONFIDENCE"
		},
		{
			"label": "Latitude",
			"fieldExpression": "LATITUDE"
		},
		{
			"label": "Longitude",
			"fieldExpression": "LONGITUDE"
		},
		{
			"label": "Acquisition Date",
			"fieldExpression": "ACQ_DATE: DateString(hideTime :true)"
		},
		{
			"label": "Acquisition Time",
			"fieldExpression": "ACQ_TIME"
		}]
	}
}

Configuring popups in multiple languages

If your mapbuilder application is configured in multiple languages then you will want to configure the popups in multiple languages as well. The syntax shows an example of an active fire layer which is configured to show popups in both English and French. In the French section, the popup labels have been translated into French.

"popup": {
	"title": {
		"en": "Active Fires",
		"fr": "Feux actifs"
	},
	"content": {
		"en": [{
				"label": "Brightness",
				"fieldExpression": "BRIGHTNESS"
			},
			{
				"label": "Confidence",
				"fieldExpression": "CONFIDENCE"
			},
			{
				"label": "Latitude",
				"fieldExpression": "LATITUDE"
			},
			{
				"label": "Longitude",
				"fieldExpression": "LONGITUDE"
			},
			{
				"label": "Acquisition Date",
				"fieldExpression": "ACQ_DATE: DateString(hideTime :true)"
			},
			{
				"label": "Acquisition Time",
				"fieldExpression": "ACQ_TIME"
			}
		],
		"fr": [{
				"label": "Luminosité",
				"fieldExpression": "BRIGHTNESS"
			},
			{
				"label": "Confiance",
				"fieldExpression": "CONFIDENCE"
			},
			{
				"label": "Latitude",
				"fieldExpression": "LATITUDE"
			},
			{
				"label": "Longitude",
				"fieldExpression": "LONGITUDE"
			},
			{
				"label": "Date d'achat",
				"fieldExpression": "ACQ_DATE: DateString(hideTime :true)"
			},
			{
				"label": "Temps d'acquisition",
				"fieldExpression": "ACQ_TIME"
			}
		],

	}
}