# map

Name map
Type panel
Version 1.0
Since 2020-01-01

# Prologue

Panels displaying the GPS coordinates on the map.

# Coordinates

Default position may be given in configuration by 'position' param, or is taken from variable if it is present. When variable is present and contains valid data to retrieve GPS coordinates, the map will display this position, otherwise the default position will be displayed. When neither default position params nor coordinates from variable can be extracted a default location of Prague city is displayed with warning message.

# Zoom

You can configure the map zoom setting by zoom params. The higher the value is, the map will be zoomed in more. Maximum zoom level allowed is 18. But for your maps you can lower this limit by your custom soft limit by zoom.max param. zoom.default param tells the map how zoomed it should be when the panel is rendered.

# Marker

GPS position can be marked od the map by the marker. Enable showing the marker with marker.show param. Marker can have a description which is displayed when user clicks the marker. Set your custom description by marker.description config param.

If marker.change.enable is TRUE, the marker becomes draggable and on each movement the current GPS coordinates will be saved to marker.change.variable. Please note that if you use same variable for variable and marker.change.variable, the original content of the variable will be overridden by new gps coordinates.

# Preview

# Configuration

map:
	render: {width: 6}
	config:

		# Optional | default NULL
		# If set, GPS coordinates will be extracted from this variable, otherwise gps coordinates from 'position' param will be used
		# Can be scalar or json variable.
		#  - If scalar, value must be RUIAN code of the address.
		#  - If json, value must contain RUIAN "code" field or must contain "lat" and "lng" fields.
		variable: address

		# Optional
		# You may use this 'position' when you don't want to use 'variable' param (e.g. to display static default address)
		position:
			# Optional | default NULL
			# Default LAT if not present in variable
			lat: 50.08804

			# Optional | default NULL
			# Default LNG if not present in variable
			lng: 14.42076

		zoom:
			# Optional | default 14
			# Default zoom level applied when map is rendered
			default: 10

			# Optional | default 0
			# Minimal allowed zoom level
			min: 5

			# Optional | default 18
			# Maximal allowed zoom level (Max allowed value is 18 for open street maps)
			max: 18

		marker:
			# Optional | default true
			# Whether you want to show a marker on the map or not
			show: true

			# Optional | default ''
			# You can set default text to be displayed in the marker bubble that is displayed when the marker is clicked
			# No bubble will be displayed if description is empty
			description: Some title to describe selected position

			change:

				# Optional | default FALSE
				# Configures whether the marker is draggable
				# When enabled, `marker.change.variable` must be set and be JSON variable
				enabled: true

				# Optionally required | default NULL
				# If `marker.change.enabled` is true, this must be a JSON variable
				# GPS coordinates of current marker position will be stored to this variable
				# You may use the original variable name too, but you should respect that original data of this variable will be overridden by new GPS coordinates
				variable: new_address

		ui:
			# Optional | Default - null
			# Panel title
			title: Map name

			# Optional | Default - null
			# Panel description
			description: Description of the panel

			# Optional | Default - 200
			# Height of the map in px on the screen
			height: 450
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70