diff --git a/ChangeLog.d/bugfix/ZBX-26089 b/ChangeLog.d/bugfix/ZBX-26089
new file mode 100644
index 00000000000..aa382975f90
--- /dev/null
+++ b/ChangeLog.d/bugfix/ZBX-26089
@@ -0,0 +1 @@
+A.F....... [ZBX-26089] added the validation for the advanced custom labels in Network map (msnihach)
diff --git a/ui/include/classes/api/services/CMap.php b/ui/include/classes/api/services/CMap.php
index f5c2b1f0779..c43acbb551c 100644
--- a/ui/include/classes/api/services/CMap.php
+++ b/ui/include/classes/api/services/CMap.php
@@ -627,20 +627,7 @@ class CMap extends CMapElement {
 	 * @throws APIException if the input is invalid.
 	 */
 	private function validateCreate(array &$maps): void {
-		$api_input_rules = ['type' => API_OBJECTS, 'flags' => API_NOT_EMPTY | API_NORMALIZE | API_ALLOW_UNEXPECTED, 'fields' => [
-			'background_scale' =>	['type' => API_INT32, 'in' => implode(',', [SYSMAP_BACKGROUND_SCALE_NONE, SYSMAP_BACKGROUND_SCALE_COVER])],
-			'show_element_label' =>	['type' => API_INT32, 'in' => implode(',', [MAP_SHOW_LABEL_AUTO_HIDE, MAP_SHOW_LABEL_ALWAYS])],
-			'show_link_label' =>	['type' => API_INT32, 'in' => implode(',', [MAP_SHOW_LABEL_AUTO_HIDE, MAP_SHOW_LABEL_ALWAYS])],
-			'selements' =>			['type' => API_OBJECTS, 'flags' => API_NORMALIZE | API_ALLOW_UNEXPECTED, 'uniq' => [['selementid']], 'fields' => [
-				'selementid' =>			['type' => API_SELEMENTID],
-				'show_label' =>			['type' => API_INT32, 'in' => implode(',', [MAP_SHOW_LABEL_DEFAULT, MAP_SHOW_LABEL_AUTO_HIDE, MAP_SHOW_LABEL_ALWAYS])],
-				'zindex' =>				['type' => API_INT32]
-			]],
-			'links' =>				['type' => API_OBJECTS, 'flags' => API_NORMALIZE | API_ALLOW_UNEXPECTED, 'fields' => [
-				'linkid' =>				['type' => API_UNEXPECTED],
-				'item_value_type' =>	['type' => API_UNEXPECTED]
-			]]
-		]];
+		$api_input_rules = self::getValidationRules();
 
 		if (!CApiInputValidator::validate($api_input_rules, $maps, '/', $error)) {
 			self::exception(ZBX_API_ERROR_PARAMETERS, $error);
@@ -899,77 +886,6 @@ class CMap extends CMapElement {
 				unset($shared_user_groupids);
 			}
 
-			// Map labels.
-			$map_labels = ['label_type' => ['typeName' => _('icon')]];
-
-			if (array_key_exists('label_format', $map) && $map['label_format'] == SYSMAP_LABEL_ADVANCED_ON) {
-				$map_labels['label_type_hostgroup'] = [
-					'string' => 'label_string_hostgroup',
-					'typeName' => _('host group')
-				];
-				$map_labels['label_type_host'] = [
-					'string' => 'label_string_host',
-					'typeName' => _('host')
-				];
-				$map_labels['label_type_trigger'] = [
-					'string' => 'label_string_trigger',
-					'typeName' => _('trigger')
-				];
-				$map_labels['label_type_map'] = [
-					'string' => 'label_string_map',
-					'typeName' => _('map')
-				];
-				$map_labels['label_type_image'] = [
-					'string' => 'label_string_image',
-					'typeName' => _('image')
-				];
-			}
-
-			foreach ($map_labels as $label_name => $label_data) {
-				if (!array_key_exists($label_name, $map)) {
-					continue;
-				}
-
-				if (sysmapElementLabel($map[$label_name]) === false) {
-					self::exception(ZBX_API_ERROR_PARAMETERS,
-						_s('Incorrect %1$s label type value for map "%2$s".', $label_data['typeName'], $map['name'])
-					);
-				}
-
-				if ($map[$label_name] == MAP_LABEL_TYPE_CUSTOM) {
-					if (!array_key_exists('string', $label_data)) {
-						self::exception(ZBX_API_ERROR_PARAMETERS,
-							_s('Incorrect %1$s label type value for map "%2$s".', $label_data['typeName'], $map['name'])
-						);
-					}
-
-					if (!array_key_exists($label_data['string'], $map) || zbx_empty($map[$label_data['string']])) {
-						self::exception(ZBX_API_ERROR_PARAMETERS, _s(
-								'Custom label for map "%2$s" elements of type "%1$s" may not be empty.',
-								$label_data['typeName'],
-								$map['name']
-							)
-						);
-					}
-				}
-
-				if ($label_name == 'label_type_image' && $map[$label_name] == MAP_LABEL_TYPE_STATUS) {
-					self::exception(ZBX_API_ERROR_PARAMETERS,
-						_s('Incorrect %1$s label type value for map "%2$s".', $label_data['typeName'], $map['name'])
-					);
-				}
-
-				if ($label_name === 'label_type' || $label_name === 'label_type_host') {
-					continue;
-				}
-
-				if ($map[$label_name] == MAP_LABEL_TYPE_IP) {
-					self::exception(ZBX_API_ERROR_PARAMETERS,
-						_s('Incorrect %1$s label type value for map "%2$s".', $label_data['typeName'], $map['name'])
-					);
-				}
-			}
-
 			// Validating grid options.
 			$possibleGridSizes = [20, 40, 50, 75, 100];
 
@@ -1062,7 +978,7 @@ class CMap extends CMapElement {
 	 *
 	 * @throws APIException if the input is invalid.
 	 */
-	protected function validateUpdate(array &$maps, ?array &$db_maps): void {
+	protected function validateUpdate(array &$maps, ?array &$db_maps) {
 		$api_input_rules = ['type' => API_OBJECTS, 'flags' => API_NOT_EMPTY | API_NORMALIZE | API_ALLOW_UNEXPECTED, 'uniq' => [['sysmapid']], 'fields' => [
 			'sysmapid' =>	['type' => API_ID, 'flags' => API_REQUIRED]
 		]];
@@ -1072,8 +988,10 @@ class CMap extends CMapElement {
 		}
 
 		$db_maps = $this->get([
-			'output' => self::OUTPUT_FIELDS,
+			'output' => API_OUTPUT_EXTEND,
 			'sysmapids' => array_column($maps, 'sysmapid'),
+			'selectLinks' => API_OUTPUT_EXTEND,
+			'selectSelements' => API_OUTPUT_EXTEND,
 			'selectShapes' => ['sysmap_shapeid', 'type', 'x', 'y', 'width', 'height', 'text', 'font', 'font_size',
 				'font_color', 'text_halign', 'text_valign', 'border_type', 'border_width', 'border_color',
 				'background_color', 'zindex'
@@ -1089,34 +1007,23 @@ class CMap extends CMapElement {
 		]);
 
 		if (count($db_maps) != count($maps)) {
-			self::exception(ZBX_API_ERROR_PARAMETERS, _('No permissions to referred object or it does not exist!'));
-		}
-
-		$api_input_rules = ['type' => API_OBJECTS, 'flags' => API_ALLOW_UNEXPECTED, 'fields' => [
-			'sysmapid' =>			['type' => API_ANY],
-			'background_scale' =>	['type' => API_INT32, 'in' => implode(',', [SYSMAP_BACKGROUND_SCALE_NONE, SYSMAP_BACKGROUND_SCALE_COVER])],
-			'show_element_label' =>	['type' => API_INT32, 'in' => implode(',', [MAP_SHOW_LABEL_AUTO_HIDE, MAP_SHOW_LABEL_ALWAYS])],
-			'show_link_label' =>	['type' => API_INT32, 'in' => implode(',', [MAP_SHOW_LABEL_AUTO_HIDE, MAP_SHOW_LABEL_ALWAYS])],
-			'selements' =>			['type' => API_OBJECTS, 'flags' => API_NORMALIZE | API_ALLOW_UNEXPECTED, 'uniq' => [['selementid']], 'fields' => [
-				'selementid' =>			['type' => API_SELEMENTID],
-				'show_label' =>			['type' => API_INT32, 'in' => implode(',', [MAP_SHOW_LABEL_DEFAULT, MAP_SHOW_LABEL_AUTO_HIDE, MAP_SHOW_LABEL_ALWAYS])],
-				'zindex' =>				['type' => API_INT32]
-			]],
-			'links' =>				['type' => API_OBJECTS, 'flags' => API_NORMALIZE | API_ALLOW_UNEXPECTED, 'uniq' => [['linkid']], 'fields' => [
-				'linkid' =>				['type' => API_ID],
-				'item_value_type' =>	['type' => API_UNEXPECTED]
-			]]
-		]];
+			self::exception(ZBX_API_ERROR_PERMISSIONS, _('No permissions to referred object or it does not exist!'));
+
+		}
+
+		$this->extendObjectsByKey($maps, $db_maps, 'sysmapid', ['label_format', 'label_type',
+			'label_type_host', 'label_type_hostgroup', 'label_type_image', 'label_type_map', 'label_type_trigger']
+		);
+
+		$api_input_rules = self::getValidationRules(true);
 
 		if (!CApiInputValidator::validate($api_input_rules, $maps, '/', $error)) {
 			self::exception(ZBX_API_ERROR_PARAMETERS, $error);
 		}
 
-		self::addAffectedObjects($maps, $db_maps);
-
 		self::validateLinks($maps, $db_maps);
 
-		$user_data = self::$userData;
+		self::addAffectedObjects($maps, $db_maps);
 
 		$check_names = [];
 
@@ -1177,6 +1084,8 @@ class CMap extends CMapElement {
 		$expandproblem_types = [SYSMAP_PROBLEMS_NUMBER, SYSMAP_SINGLE_PROBLEM, SYSMAP_PROBLEMS_NUMBER_CRITICAL];
 		$expandproblem_validator = new CLimitedSetValidator(['values' => $expandproblem_types]);
 
+		$user_data = self::$userData;
+
 		foreach ($maps as $map_index => $map) {
 			// Check if owner can be set.
 			if (array_key_exists('userid', $map)) {
@@ -1375,85 +1284,6 @@ class CMap extends CMapElement {
 				unset($shared_user_groupids);
 			}
 
-			// Map labels.
-			$map_labels = ['label_type' => ['typeName' => _('icon')]];
-
-			if (array_key_exists('label_format', $map)
-					&& $map['label_format'] == SYSMAP_LABEL_ADVANCED_ON) {
-				$map_labels['label_type_hostgroup'] = [
-					'string' => 'label_string_hostgroup',
-					'typeName' => _('host group')
-				];
-				$map_labels['label_type_host'] = [
-					'string' => 'label_string_host',
-					'typeName' => _('host')
-				];
-				$map_labels['label_type_trigger'] = [
-					'string' => 'label_string_trigger',
-					'typeName' => _('trigger')
-				];
-				$map_labels['label_type_map'] = [
-					'string' => 'label_string_map',
-					'typeName' => _('map')
-				];
-				$map_labels['label_type_image'] = [
-					'string' => 'label_string_image',
-					'typeName' => _('image')
-				];
-			}
-
-			foreach ($map_labels as $label_name => $labelData) {
-				if (!array_key_exists($label_name, $map)) {
-					continue;
-				}
-
-				if (sysmapElementLabel($map[$label_name]) === false) {
-					self::exception(ZBX_API_ERROR_PARAMETERS, _s(
-						'Incorrect %1$s label type value for map "%2$s".',
-						$labelData['typeName'],
-						$map['name']
-					));
-				}
-
-				if ($map[$label_name] == MAP_LABEL_TYPE_CUSTOM) {
-					if (!array_key_exists('string', $labelData)) {
-						self::exception(ZBX_API_ERROR_PARAMETERS, _s(
-							'Incorrect %1$s label type value for map "%2$s".',
-							$labelData['typeName'],
-							$map['name']
-						));
-					}
-
-					if (!array_key_exists($labelData['string'], $map) || zbx_empty($map[$labelData['string']])) {
-						self::exception(ZBX_API_ERROR_PARAMETERS, _s(
-							'Custom label for map "%2$s" elements of type "%1$s" may not be empty.',
-							$labelData['typeName'],
-							$map['name']
-						));
-					}
-				}
-
-				if ($label_name === 'label_type_image' && $map[$label_name] == MAP_LABEL_TYPE_STATUS) {
-					self::exception(ZBX_API_ERROR_PARAMETERS, _s(
-						'Incorrect %1$s label type value for map "%2$s".',
-						$labelData['typeName'],
-						$map['name']
-					));
-				}
-
-				if ($label_name === 'label_type' || $label_name === 'label_type_host') {
-					continue;
-				}
-
-				if ($map[$label_name] == MAP_LABEL_TYPE_IP) {
-					self::exception(ZBX_API_ERROR_PARAMETERS, _s(
-						'Incorrect %1$s label type value for map "%2$s".',
-						$labelData['typeName'],
-						$map['name']
-					));
-				}
-			}
-
 			// Validating grid options.
 			$possibleGridSizes = [20, 40, 50, 75, 100];
 
@@ -1541,6 +1371,84 @@ class CMap extends CMapElement {
 		$this->validateCircularReference($maps);
 	}
 
+	private static function getValidationRules(bool $is_update = false): array {
+		$api_required = $is_update ? 0 : API_REQUIRED;
+
+		return ['type' => API_OBJECTS, 'flags' => API_NOT_EMPTY | API_NORMALIZE | API_ALLOW_UNEXPECTED, 'fields' => [
+			'background_scale' =>			['type' => API_INT32, 'in' => implode(',', [SYSMAP_BACKGROUND_SCALE_NONE, SYSMAP_BACKGROUND_SCALE_COVER])],
+			'show_element_label' =>			['type' => API_INT32, 'in' => implode(',', [MAP_SHOW_LABEL_AUTO_HIDE, MAP_SHOW_LABEL_ALWAYS])],
+			'show_link_label' =>			['type' => API_INT32, 'in' => implode(',', [MAP_SHOW_LABEL_AUTO_HIDE, MAP_SHOW_LABEL_ALWAYS])],
+			'label_format' =>				['type' => API_INT32, 'flags' => $api_required, 'in' => implode(',', [SYSMAP_LABEL_ADVANCED_ON, SYSMAP_LABEL_ADVANCED_OFF])] + ($is_update ? [] : ['default' => DB::getDefault('sysmaps', 'label_format')]),
+			'label_type' =>					['type' => API_MULTIPLE, 'rules' => [
+												['if' => ['field' => 'label_format', 'in' => SYSMAP_LABEL_ADVANCED_OFF], 'type' => API_INT32, 'in' => implode(',', [MAP_LABEL_TYPE_LABEL, MAP_LABEL_TYPE_IP, MAP_LABEL_TYPE_NAME, MAP_LABEL_TYPE_STATUS, MAP_LABEL_TYPE_NOTHING, MAP_LABEL_TYPE_CUSTOM])],
+												['else' => true, 'type' => API_INT32, 'in' => DB::getDefault('sysmaps', 'label_type')]
+			]],
+			'label_type_host' =>			['type' => API_MULTIPLE, 'rules' => [
+												['if' => ['field' => 'label_format', 'in' => implode(',', [SYSMAP_LABEL_ADVANCED_ON])], 'type' => API_INT32, 'in' => implode(',', [MAP_LABEL_TYPE_LABEL, MAP_LABEL_TYPE_IP, MAP_LABEL_TYPE_NAME, MAP_LABEL_TYPE_STATUS, MAP_LABEL_TYPE_NOTHING, MAP_LABEL_TYPE_CUSTOM])],
+												['else' => true, 'type' => API_INT32, 'in' => DB::getDefault('sysmaps', 'label_type_host')]
+			]],
+			'label_string_host' =>			['type' => API_MULTIPLE, 'rules' => [
+												['if' => ['field' => 'label_format', 'in' => implode(',', [SYSMAP_LABEL_ADVANCED_ON])], 'type' => API_MULTIPLE, 'rules' => [
+													['if' => ['field' => 'label_type_host', 'in' => implode(',', [MAP_LABEL_TYPE_CUSTOM])], 'type' => API_STRING_UTF8, 'flags' => $api_required | API_NOT_EMPTY, 'length' => DB::getFieldLength('sysmaps', 'label_string_host')],
+													['else' => true, 'type' => API_STRING_UTF8, 'in' => DB::getDefault('sysmaps', 'label_string_host')]
+												]],
+												['else' => true, 'type' => API_STRING_UTF8, 'in' => DB::getDefault('sysmaps', 'label_string_host')]
+			]],
+			'label_type_hostgroup' =>		['type' => API_MULTIPLE, 'rules' => [
+												['if' => ['field' => 'label_format', 'in' => implode(',', [SYSMAP_LABEL_ADVANCED_ON])], 'type' => API_INT32, 'in' => implode(',', [MAP_LABEL_TYPE_LABEL, MAP_LABEL_TYPE_IP, MAP_LABEL_TYPE_NAME, MAP_LABEL_TYPE_STATUS, MAP_LABEL_TYPE_NOTHING, MAP_LABEL_TYPE_CUSTOM])],
+												['else' => true, 'type' => API_INT32, 'in' => DB::getDefault('sysmaps', 'label_type_hostgroup')]
+			]],
+			'label_string_hostgroup' =>		['type' => API_MULTIPLE, 'rules' => [
+												['if' => ['field' => 'label_format', 'in' => implode(',', [SYSMAP_LABEL_ADVANCED_ON])], 'type' => API_MULTIPLE, 'rules' => [
+													['if' => ['field' => 'label_type_hostgroup', 'in' => implode(',', [MAP_LABEL_TYPE_CUSTOM])], 'type' => API_STRING_UTF8, 'flags' => $api_required | API_NOT_EMPTY, 'length' => DB::getFieldLength('sysmaps', 'label_string_hostgroup')],
+													['else' => true, 'type' => API_STRING_UTF8, 'in' => DB::getDefault('sysmaps', 'label_string_hostgroup')]
+												]],
+												['else' => true, 'type' => API_STRING_UTF8, 'in' => DB::getDefault('sysmaps', 'label_string_hostgroup')]
+			]],
+			'label_type_image' =>			['type' => API_MULTIPLE, 'rules' => [
+												['if' => ['field' => 'label_format', 'in' => implode(',', [SYSMAP_LABEL_ADVANCED_ON])], 'type' => API_INT32, 'in' => implode(',', [MAP_LABEL_TYPE_LABEL, MAP_LABEL_TYPE_IP, MAP_LABEL_TYPE_NAME, MAP_LABEL_TYPE_STATUS, MAP_LABEL_TYPE_NOTHING, MAP_LABEL_TYPE_CUSTOM])],
+												['else' => true, 'type' => API_INT32, 'in' => DB::getDefault('sysmaps', 'label_type_image')]
+			]],
+			'label_string_image' =>			['type' => API_MULTIPLE, 'rules' => [
+												['if' => ['field' => 'label_format', 'in' => implode(',', [SYSMAP_LABEL_ADVANCED_ON])], 'type' => API_MULTIPLE, 'rules' => [
+													['if' => ['field' => 'label_type_image', 'in' => implode(',', [MAP_LABEL_TYPE_CUSTOM])], 'type' => API_STRING_UTF8, 'flags' => $api_required | API_NOT_EMPTY, 'length' => DB::getFieldLength('sysmaps', 'label_string_image')],
+													['else' => true, 'type' => API_STRING_UTF8, 'in' => DB::getDefault('sysmaps', 'label_string_image')]
+												]],
+												['else' => true, 'type' => API_STRING_UTF8, 'in' => DB::getDefault('sysmaps', 'label_string_image')]
+			]],
+			'label_type_map' =>				['type' => API_MULTIPLE, 'rules' => [
+												['if' => ['field' => 'label_format', 'in' => implode(',', [SYSMAP_LABEL_ADVANCED_ON])], 'type' => API_INT32, 'in' => implode(',', [MAP_LABEL_TYPE_LABEL, MAP_LABEL_TYPE_IP, MAP_LABEL_TYPE_NAME, MAP_LABEL_TYPE_STATUS, MAP_LABEL_TYPE_NOTHING, MAP_LABEL_TYPE_CUSTOM])],
+												['else' => true, 'type' => API_INT32, 'in' => DB::getDefault('sysmaps', 'label_type_map')]
+			]],
+			'label_string_map' =>			['type' => API_MULTIPLE, 'rules' => [
+												['if' => ['field' => 'label_format', 'in' => implode(',', [SYSMAP_LABEL_ADVANCED_ON])], 'type' => API_MULTIPLE, 'rules' => [
+													['if' => ['field' => 'label_type_map', 'in' => implode(',', [MAP_LABEL_TYPE_CUSTOM])], 'type' => API_STRING_UTF8, 'flags' => $api_required | API_NOT_EMPTY, 'length' => DB::getFieldLength('sysmaps', 'label_string_map')],
+													['else' => true, 'type' => API_STRING_UTF8, 'in' => DB::getDefault('sysmaps', 'label_string_map')]
+												]],
+												['else' => true, 'type' => API_STRING_UTF8, 'in' => DB::getDefault('sysmaps', 'label_string_map')]
+			]],
+			'label_type_trigger' =>			['type' => API_MULTIPLE, 'rules' => [
+												['if' => ['field' => 'label_format', 'in' => implode(',', [SYSMAP_LABEL_ADVANCED_ON])], 'type' => API_INT32, 'in' => implode(',', [MAP_LABEL_TYPE_LABEL, MAP_LABEL_TYPE_IP, MAP_LABEL_TYPE_NAME, MAP_LABEL_TYPE_STATUS, MAP_LABEL_TYPE_NOTHING, MAP_LABEL_TYPE_CUSTOM])],
+												['else' => true, 'type' => API_INT32, 'in' => DB::getDefault('sysmaps', 'label_type_trigger')]
+			]],
+			'label_string_trigger' =>		['type' => API_MULTIPLE, 'rules' => [
+												['if' => ['field' => 'label_format', 'in' => implode(',', [SYSMAP_LABEL_ADVANCED_ON])], 'type' => API_MULTIPLE, 'rules' => [
+													['if' => ['field' => 'label_type_trigger', 'in' => implode(',', [MAP_LABEL_TYPE_CUSTOM])], 'type' => API_STRING_UTF8, 'flags' => $api_required | API_NOT_EMPTY, 'length' => DB::getFieldLength('sysmaps', 'label_string_trigger')],
+													['else' => true, 'type' => API_STRING_UTF8, 'in' => DB::getDefault('sysmaps', 'label_string_trigger')]
+												]],
+												['else' => true, 'type' => API_STRING_UTF8, 'in' => DB::getDefault('sysmaps', 'label_string_trigger')]
+			]],
+			'selements' =>					['type' => API_OBJECTS, 'flags' => API_NORMALIZE | API_ALLOW_UNEXPECTED, 'uniq' => [['selementid']], 'fields' => [
+				'selementid' =>					['type' => API_SELEMENTID],
+				'show_label' =>					['type' => API_INT32, 'in' => implode(',', [MAP_SHOW_LABEL_DEFAULT, MAP_SHOW_LABEL_AUTO_HIDE, MAP_SHOW_LABEL_ALWAYS])],
+				'zindex' =>						['type' => API_INT32]
+			]],
+			'links' =>						['type' => API_OBJECTS, 'flags' => API_NORMALIZE | API_ALLOW_UNEXPECTED, 'fields' => [
+				'linkid' =>						['type' => API_UNEXPECTED],
+				'item_value_type' =>			['type' => API_UNEXPECTED]
+			]]
+		]];
+	}
 	private static function addAffectedObjects(array $maps, array &$db_maps): void {
 		self::addAffectedSelements($maps, $db_maps);
 		self::addAffectedLinks($maps, $db_maps);
@@ -2249,7 +2157,7 @@ class CMap extends CMapElement {
 	 *
 	 * @throws APIException if input is invalid.
 	 */
-	protected function validateCircularReference(array $maps) {
+	protected function validateCircularReference(array $maps): void {
 		foreach ($maps as $map) {
 			if (!array_key_exists('selements', $map) || !$map['selements']) {
 				continue;
diff --git a/ui/include/classes/import/converters/C74ImportConverter.php b/ui/include/classes/import/converters/C74ImportConverter.php
index c4ee52f3144..ef7617605b6 100644
--- a/ui/include/classes/import/converters/C74ImportConverter.php
+++ b/ui/include/classes/import/converters/C74ImportConverter.php
@@ -29,6 +29,39 @@ class C74ImportConverter extends CConverter {
 	public function convert(array $data): array {
 		$data['zabbix_export']['version'] = '8.0';
 
+		if (array_key_exists('maps', $data['zabbix_export'])) {
+			$data['zabbix_export']['maps'] = self::convertMaps($data['zabbix_export']['maps']);
+		}
+
 		return $data;
 	}
+
+	private static function convertMaps(array $maps): array {
+		$advanced_status = [
+			CXmlConstantValue::SHOW_LABEL_ADVANCED_ON => CXmlConstantName::SHOW_LABEL_ADVANCED_ON,
+			CXmlConstantValue::SHOW_LABEL_ADVANCED_OFF => CXmlConstantName::SHOW_LABEL_ADVANCED_OFF
+		];
+
+		$element_labels = [
+			CXmlConstantValue::SHOW_MAP_LABEL_TYPE_LABEL  => CXmlConstantName::SHOW_MAP_LABEL_TYPE_LABEL,
+			CXmlConstantValue::SHOW_MAP_LABEL_TYPE_IP  => CXmlConstantName::SHOW_MAP_LABEL_TYPE_IP,
+			CXmlConstantValue::SHOW_MAP_LABEL_TYPE_NAME  => CXmlConstantName::SHOW_MAP_LABEL_TYPE_NAME,
+			CXmlConstantValue::SHOW_MAP_LABEL_TYPE_STATUS  => CXmlConstantName::SHOW_MAP_LABEL_TYPE_STATUS,
+			CXmlConstantValue::SHOW_MAP_LABEL_TYPE_NOTHING  => CXmlConstantName::SHOW_MAP_LABEL_TYPE_NOTHING,
+			CXmlConstantValue::SHOW_MAP_LABEL_TYPE_CUSTOM  => CXmlConstantName::SHOW_MAP_LABEL_TYPE_CUSTOM
+		];
+
+		foreach ($maps as &$map) {
+			$map['label_format'] = $advanced_status[$map['label_format']];
+
+			$map['label_type_host'] = $element_labels[$map['label_type_host']];
+			$map['label_type_hostgroup'] = $element_labels[$map['label_type_hostgroup']];
+			$map['label_type_trigger'] = $element_labels[$map['label_type_trigger']];
+			$map['label_type_map'] = $element_labels[$map['label_type_map']];
+			$map['label_type_image'] = $element_labels[$map['label_type_image']];
+		}
+		unset($map);
+
+		return $maps;
+	}
 }
diff --git a/ui/include/classes/import/validators/C80XmlValidator.php b/ui/include/classes/import/validators/C80XmlValidator.php
index 15768e14392..c06a653a489 100644
--- a/ui/include/classes/import/validators/C80XmlValidator.php
+++ b/ui/include/classes/import/validators/C80XmlValidator.php
@@ -581,6 +581,15 @@ class C80XmlValidator extends CXmlValidatorGeneral {
 		CXmlConstantValue::DASHED_LINE => CXmlConstantName::DASHED_LINE
 	];
 
+	private array $MAP_ELEMENT_LABEL = [
+		CXmlConstantValue::SHOW_MAP_LABEL_TYPE_LABEL  => CXmlConstantName::SHOW_MAP_LABEL_TYPE_LABEL,
+		CXmlConstantValue::SHOW_MAP_LABEL_TYPE_IP  => CXmlConstantName::SHOW_MAP_LABEL_TYPE_IP,
+		CXmlConstantValue::SHOW_MAP_LABEL_TYPE_NAME  => CXmlConstantName::SHOW_MAP_LABEL_TYPE_NAME,
+		CXmlConstantValue::SHOW_MAP_LABEL_TYPE_STATUS  => CXmlConstantName::SHOW_MAP_LABEL_TYPE_STATUS,
+		CXmlConstantValue::SHOW_MAP_LABEL_TYPE_NOTHING  => CXmlConstantName::SHOW_MAP_LABEL_TYPE_NOTHING,
+		CXmlConstantValue::SHOW_MAP_LABEL_TYPE_CUSTOM  => CXmlConstantName::SHOW_MAP_LABEL_TYPE_CUSTOM
+	];
+
 	/**
 	 * Get validation rules schema.
 	 *
@@ -3162,50 +3171,98 @@ class C80XmlValidator extends CXmlValidatorGeneral {
 			]],
 			'maps' =>					['type' => XML_INDEXED_ARRAY, 'prefix' => 'map', 'rules' => [
 				'map' =>					['type' => XML_ARRAY, 'rules' => [
-					'name' =>					['type' => XML_STRING | XML_REQUIRED],
-					'width' =>					['type' => XML_STRING | XML_REQUIRED],
-					'height' =>					['type' => XML_STRING | XML_REQUIRED],
-					'label_type' =>				['type' => XML_STRING | XML_REQUIRED],
-					'label_location' =>			['type' => XML_STRING | XML_REQUIRED],
-					'show_element_label' =>		['type' => XML_STRING, 'type' => XML_STRING, 'default' => CXmlConstantValue::SHOW_LABEL_ALWAYS, 'in' => [CXmlConstantValue::SHOW_LABEL_AUTO_HIDE => CXmlConstantName::SHOW_LABEL_AUTO_HIDE, CXmlConstantValue::SHOW_LABEL_ALWAYS => CXmlConstantName::SHOW_LABEL_ALWAYS]],
-					'show_link_label' =>		['type' => XML_STRING, 'type' => XML_STRING, 'default' => CXmlConstantValue::SHOW_LABEL_ALWAYS, 'in' => [CXmlConstantValue::SHOW_LABEL_AUTO_HIDE => CXmlConstantName::SHOW_LABEL_AUTO_HIDE, CXmlConstantValue::SHOW_LABEL_ALWAYS => CXmlConstantName::SHOW_LABEL_ALWAYS]],
-					'highlight' =>				['type' => XML_STRING | XML_REQUIRED],
-					'expandproblem' =>			['type' => XML_STRING | XML_REQUIRED],
-					'markelements' =>			['type' => XML_STRING | XML_REQUIRED],
-					'show_unack' =>				['type' => XML_STRING | XML_REQUIRED],
-					'severity_min' =>			['type' => XML_STRING | XML_REQUIRED],
-					'show_suppressed' =>		['type' => XML_STRING | XML_REQUIRED],
-					'grid_size' =>				['type' => XML_STRING | XML_REQUIRED],
-					'grid_show' =>				['type' => XML_STRING | XML_REQUIRED],
-					'grid_align' =>				['type' => XML_STRING | XML_REQUIRED],
-					'label_format' =>			['type' => XML_STRING | XML_REQUIRED],
-					'label_type_host' =>		['type' => XML_STRING | XML_REQUIRED],
-					'label_type_hostgroup' =>	['type' => XML_STRING | XML_REQUIRED],
-					'label_type_trigger' =>		['type' => XML_STRING | XML_REQUIRED],
-					'label_type_map' =>			['type' => XML_STRING | XML_REQUIRED],
-					'label_type_image' =>		['type' => XML_STRING | XML_REQUIRED],
-					'label_string_host' =>		['type' => XML_STRING | XML_REQUIRED],
-					'label_string_hostgroup' =>	['type' => XML_STRING | XML_REQUIRED],
-					'label_string_trigger' =>	['type' => XML_STRING | XML_REQUIRED],
-					'label_string_map' =>		['type' => XML_STRING | XML_REQUIRED],
-					'label_string_image' =>		['type' => XML_STRING | XML_REQUIRED],
-					'expand_macros' =>			['type' => XML_STRING | XML_REQUIRED],
-					'background' =>				['type' => XML_ARRAY | XML_REQUIRED, 'rules' => [
-						'name' =>					['type' => XML_STRING]
+					'name' =>						['type' => XML_STRING | XML_REQUIRED],
+					'width' =>						['type' => XML_STRING | XML_REQUIRED],
+					'height' =>						['type' => XML_STRING | XML_REQUIRED],
+					'label_location' =>				['type' => XML_STRING | XML_REQUIRED],
+					'show_element_label' =>			['type' => XML_STRING, 'default' => CXmlConstantValue::SHOW_LABEL_ALWAYS, 'in' => [CXmlConstantValue::SHOW_LABEL_AUTO_HIDE => CXmlConstantName::SHOW_LABEL_AUTO_HIDE, CXmlConstantValue::SHOW_LABEL_ALWAYS => CXmlConstantName::SHOW_LABEL_ALWAYS]],
+					'show_link_label' =>			['type' => XML_STRING, 'default' => CXmlConstantValue::SHOW_LABEL_ALWAYS, 'in' => [CXmlConstantValue::SHOW_LABEL_AUTO_HIDE => CXmlConstantName::SHOW_LABEL_AUTO_HIDE, CXmlConstantValue::SHOW_LABEL_ALWAYS => CXmlConstantName::SHOW_LABEL_ALWAYS]],
+					'highlight' =>					['type' => XML_STRING | XML_REQUIRED],
+					'expandproblem' =>				['type' => XML_STRING | XML_REQUIRED],
+					'markelements' =>				['type' => XML_STRING | XML_REQUIRED],
+					'show_unack' =>					['type' => XML_STRING | XML_REQUIRED],
+					'severity_min' =>				['type' => XML_STRING | XML_REQUIRED],
+					'show_suppressed' =>			['type' => XML_STRING | XML_REQUIRED],
+					'grid_size' =>					['type' => XML_STRING | XML_REQUIRED],
+					'grid_show' =>					['type' => XML_STRING | XML_REQUIRED],
+					'grid_align' =>					['type' => XML_STRING | XML_REQUIRED],
+					'label_format' =>				['type' => XML_STRING, 'default' => CXmlConstantValue::SHOW_LABEL_ADVANCED_OFF, 'in' => [CXmlConstantValue::SHOW_LABEL_ADVANCED_OFF => CXmlConstantName::SHOW_LABEL_ADVANCED_OFF, CXmlConstantValue::SHOW_LABEL_ADVANCED_ON => CXmlConstantName::SHOW_LABEL_ADVANCED_ON]],
+					'label_type' =>					['type' => XML_MULTIPLE, 'rules' => [
+														['if' => ['tag' => 'label_format', 'in' => [CXmlConstantValue::SHOW_LABEL_ADVANCED_OFF => CXmlConstantName::SHOW_LABEL_ADVANCED_OFF]], 'type' => XML_STRING, 'in' => $this->MAP_ELEMENT_LABEL],
+														['else' => true, 'type' => XML_IGNORE_TAG]
 					]],
-					'background_scale' =>		['type' => XML_STRING, 'default' => CXmlConstantValue::MAP_BACKGROUND_SCALE_COVER, 'in' => [CXmlConstantValue::MAP_BACKGROUND_SCALE_NONE => CXmlConstantName::MAP_BACKGROUND_SCALE_NONE, CXmlConstantValue::MAP_BACKGROUND_SCALE_COVER => CXmlConstantName::MAP_BACKGROUND_SCALE_COVER]],
-					'iconmap' =>				['type' => XML_ARRAY | XML_REQUIRED, 'rules' => [
-						'name' =>					['type' => XML_STRING]
+					'label_type_host' =>			['type' => XML_MULTIPLE, 'rules' => [
+														['if' => ['tag' => 'label_format', 'in' => [CXmlConstantValue::SHOW_LABEL_ADVANCED_ON => CXmlConstantName::SHOW_LABEL_ADVANCED_ON]], 'type' => XML_STRING, 'in' => $this->MAP_ELEMENT_LABEL],
+														['else' => true, 'type' => XML_IGNORE_TAG]
 					]],
-					'urls' =>					['type' => XML_INDEXED_ARRAY | XML_REQUIRED, 'prefix' => 'url', 'rules' => [
-						'url' =>					['type' => XML_ARRAY, 'rules' => [
-							'name' =>					['type' => XML_STRING | XML_REQUIRED],
-							'url' =>					['type' => XML_STRING | XML_REQUIRED],
-							'elementtype' =>			['type' => XML_STRING | XML_REQUIRED]
+					'label_string_host' =>			['type' => XML_MULTIPLE, 'rules' => [
+														['if' => ['tag' => 'label_format', 'in' => [CXmlConstantValue::SHOW_LABEL_ADVANCED_ON => CXmlConstantName::SHOW_LABEL_ADVANCED_ON]], 'type' => XML_MULTIPLE, 'rules' => [
+															['if' => ['tag' => 'label_type_host', 'in' => [CXmlConstantValue::SHOW_MAP_LABEL_TYPE_CUSTOM  => CXmlConstantName::SHOW_MAP_LABEL_TYPE_CUSTOM]], 'type' => XML_STRING, 'default' => ''],
+															['else' => true, 'type' => XML_IGNORE_TAG]
+														]],
+														['else' => true, 'type' => XML_IGNORE_TAG]
+					]],
+					'label_type_hostgroup' =>		['type' => XML_MULTIPLE, 'rules' => [
+														['if' => ['tag' => 'label_format', 'in' => [CXmlConstantValue::SHOW_LABEL_ADVANCED_ON => CXmlConstantName::SHOW_LABEL_ADVANCED_ON]], 'type' => XML_STRING, 'in' => $this->MAP_ELEMENT_LABEL],
+														['else' => true, 'type' => XML_IGNORE_TAG]
+					]],
+					'label_string_hostgroup' =>		['type' => XML_MULTIPLE, 'rules' => [
+														['if' => ['tag' => 'label_format', 'in' => [CXmlConstantValue::SHOW_LABEL_ADVANCED_ON => CXmlConstantName::SHOW_LABEL_ADVANCED_ON]], 'type' => XML_MULTIPLE, 'rules' => [
+															['if' => ['tag' => 'label_type_hostgroup', 'in' => [CXmlConstantValue::SHOW_MAP_LABEL_TYPE_CUSTOM  => CXmlConstantName::SHOW_MAP_LABEL_TYPE_CUSTOM]], 'type' => XML_STRING, 'default' => ''],
+															['else' => true, 'type' => XML_IGNORE_TAG]
+														]],
+														['else' => true, 'type' => XML_IGNORE_TAG]
+					]],
+					'label_type_trigger' =>			['type' => XML_MULTIPLE, 'rules' => [
+														['if' => ['tag' => 'label_format', 'in' => [CXmlConstantValue::SHOW_LABEL_ADVANCED_ON => CXmlConstantName::SHOW_LABEL_ADVANCED_ON]], 'type' => XML_STRING, 'in' => $this->MAP_ELEMENT_LABEL],
+														['else' => true, 'type' => XML_IGNORE_TAG]
+					]],
+					'label_string_trigger' => 		['type' => XML_MULTIPLE, 'rules' => [
+														['if' => ['tag' => 'label_format', 'in' => [CXmlConstantValue::SHOW_LABEL_ADVANCED_ON => CXmlConstantName::SHOW_LABEL_ADVANCED_ON]], 'type' => XML_MULTIPLE, 'rules' => [
+															['if' => ['tag' => 'label_type_trigger', 'in' => [CXmlConstantValue::SHOW_MAP_LABEL_TYPE_CUSTOM  => CXmlConstantName::SHOW_MAP_LABEL_TYPE_CUSTOM]], 'type' => XML_STRING, 'default' => ''],
+															['else' => true, 'type' => XML_IGNORE_TAG]
+														]],
+														['else' => true, 'type' => XML_IGNORE_TAG]
+					]],
+					'label_type_map' =>				['type' => XML_MULTIPLE, 'rules' => [
+														['if' => ['tag' => 'label_format', 'in' => [CXmlConstantValue::SHOW_LABEL_ADVANCED_ON => CXmlConstantName::SHOW_LABEL_ADVANCED_ON]], 'type' => XML_STRING, 'in' => $this->MAP_ELEMENT_LABEL],
+														['else' => true, 'type' => XML_IGNORE_TAG]
+					]],
+					'label_string_map' =>			['type' => XML_MULTIPLE, 'rules' => [
+														['if' => ['tag' => 'label_format', 'in' => [CXmlConstantValue::SHOW_LABEL_ADVANCED_ON => CXmlConstantName::SHOW_LABEL_ADVANCED_ON]], 'type' => XML_MULTIPLE, 'rules' => [
+															['if' => ['tag' => 'label_type_map', 'in' => [CXmlConstantValue::SHOW_MAP_LABEL_TYPE_CUSTOM  => CXmlConstantName::SHOW_MAP_LABEL_TYPE_CUSTOM]], 'type' => XML_STRING, 'default' => ''],
+															['else' => true, 'type' => XML_IGNORE_TAG]
+														]],
+														['else' => true, 'type' => XML_IGNORE_TAG]
+					]],
+					'label_type_image' =>			['type' => XML_MULTIPLE, 'rules' => [
+														['if' => ['tag' => 'label_format', 'in' => [CXmlConstantValue::SHOW_LABEL_ADVANCED_ON => CXmlConstantName::SHOW_LABEL_ADVANCED_ON]], 'type' => XML_STRING, 'in' => $this->MAP_ELEMENT_LABEL],
+														['else' => true, 'type' => XML_IGNORE_TAG]
+					]],
+					'label_string_image' =>			['type' => XML_MULTIPLE, 'rules' => [
+														['if' => ['tag' => 'label_format', 'in' => [CXmlConstantValue::SHOW_LABEL_ADVANCED_ON => CXmlConstantName::SHOW_LABEL_ADVANCED_ON]], 'type' => XML_MULTIPLE, 'rules' => [
+															['if' => ['tag' => 'label_type_image', 'in' => [CXmlConstantValue::SHOW_MAP_LABEL_TYPE_CUSTOM  => CXmlConstantName::SHOW_MAP_LABEL_TYPE_CUSTOM]], 'type' => XML_STRING, 'default' => ''],
+															['else' => true, 'type' => XML_IGNORE_TAG]
+														]],
+														['else' => true, 'type' => XML_IGNORE_TAG]
+					]],
+					'expand_macros' =>				['type' => XML_STRING | XML_REQUIRED],
+					'background' =>					['type' => XML_ARRAY | XML_REQUIRED, 'rules' => [
+						'name' =>						['type' => XML_STRING]
+					]],
+					'background_scale' =>			['type' => XML_STRING, 'default' => CXmlConstantValue::MAP_BACKGROUND_SCALE_COVER, 'in' => [CXmlConstantValue::MAP_BACKGROUND_SCALE_NONE => CXmlConstantName::MAP_BACKGROUND_SCALE_NONE, CXmlConstantValue::MAP_BACKGROUND_SCALE_COVER => CXmlConstantName::MAP_BACKGROUND_SCALE_COVER]],
+					'iconmap' =>					['type' => XML_ARRAY | XML_REQUIRED, 'rules' => [
+						'name' =>						['type' => XML_STRING]
+					]],
+					'urls' =>						['type' => XML_INDEXED_ARRAY | XML_REQUIRED, 'prefix' => 'url', 'rules' => [
+						'url' =>						['type' => XML_ARRAY, 'rules' => [
+							'name' =>						['type' => XML_STRING | XML_REQUIRED],
+							'url' =>						['type' => XML_STRING | XML_REQUIRED],
+							'elementtype' =>				['type' => XML_STRING | XML_REQUIRED]
 						]]
 					]],
-					'selements' =>				['type' => XML_INDEXED_ARRAY | XML_REQUIRED, 'prefix' => 'selement', 'rules' => [
-						'selement' =>				['type' => XML_ARRAY, 'rules' => [
+					'selements' =>					['type' => XML_INDEXED_ARRAY | XML_REQUIRED, 'prefix' => 'selement', 'rules' => [
+						'selement' =>					['type' => XML_ARRAY, 'rules' => [
 							// The tag 'elementtype' should be validated before the 'elements' because it is used in 'ex_required' and 'ex_validate' methods.
 							'elementtype' =>			['type' => XML_STRING | XML_REQUIRED],
 							'elements' =>				['type' => 0, 'default' => [], 'ex_required' => [$this, 'requiredMapElement'], 'ex_validate' => [$this, 'validateMapElements'], 'ex_rules' => [$this, 'getMapElementsExtendedRules']],
@@ -3250,48 +3307,48 @@ class C80XmlValidator extends CXmlValidatorGeneral {
 							'zindex' =>					['type' => XML_STRING | XML_REQUIRED]
 						]]
 					]],
-					'shapes' =>				['type' => XML_INDEXED_ARRAY | XML_REQUIRED, 'prefix' => 'shape', 'rules' => [
-						'shape' =>				['type' => XML_ARRAY, 'rules' => [
-							'type' =>				['type' => XML_STRING | XML_REQUIRED],
-							'x' =>					['type' => XML_STRING | XML_REQUIRED],
-							'y' =>					['type' => XML_STRING | XML_REQUIRED],
-							'width' =>				['type' => XML_STRING | XML_REQUIRED],
-							'height' =>				['type' => XML_STRING | XML_REQUIRED],
-							'text' =>				['type' => XML_STRING | XML_REQUIRED],
-							'font' =>				['type' => XML_STRING | XML_REQUIRED],
-							'font_size' =>			['type' => XML_STRING | XML_REQUIRED],
-							'font_color' =>			['type' => XML_STRING | XML_REQUIRED],
-							'text_halign' =>		['type' => XML_STRING | XML_REQUIRED],
-							'text_valign' =>		['type' => XML_STRING | XML_REQUIRED],
-							'border_type' =>		['type' => XML_STRING | XML_REQUIRED],
-							'border_width' =>		['type' => XML_STRING | XML_REQUIRED],
-							'border_color' =>		['type' => XML_STRING | XML_REQUIRED],
-							'background_color' =>	['type' => XML_STRING | XML_REQUIRED],
-							'zindex' =>				['type' => XML_STRING | XML_REQUIRED]
+					'shapes' =>					['type' => XML_INDEXED_ARRAY | XML_REQUIRED, 'prefix' => 'shape', 'rules' => [
+						'shape' =>					['type' => XML_ARRAY, 'rules' => [
+							'type' =>					['type' => XML_STRING | XML_REQUIRED],
+							'x' =>						['type' => XML_STRING | XML_REQUIRED],
+							'y' =>						['type' => XML_STRING | XML_REQUIRED],
+							'width' =>					['type' => XML_STRING | XML_REQUIRED],
+							'height' =>					['type' => XML_STRING | XML_REQUIRED],
+							'text' =>					['type' => XML_STRING | XML_REQUIRED],
+							'font' =>					['type' => XML_STRING | XML_REQUIRED],
+							'font_size' =>				['type' => XML_STRING | XML_REQUIRED],
+							'font_color' =>				['type' => XML_STRING | XML_REQUIRED],
+							'text_halign' =>			['type' => XML_STRING | XML_REQUIRED],
+							'text_valign' =>			['type' => XML_STRING | XML_REQUIRED],
+							'border_type' =>			['type' => XML_STRING | XML_REQUIRED],
+							'border_width' =>			['type' => XML_STRING | XML_REQUIRED],
+							'border_color' =>			['type' => XML_STRING | XML_REQUIRED],
+							'background_color' =>		['type' => XML_STRING | XML_REQUIRED],
+							'zindex' =>					['type' => XML_STRING | XML_REQUIRED]
 						]]
 					]],
-					'lines' =>				['type' => XML_INDEXED_ARRAY | XML_REQUIRED, 'prefix' => 'line', 'rules' => [
-						'line' =>				['type' => XML_ARRAY, 'rules' => [
-							'x1' =>					['type' => XML_STRING | XML_REQUIRED],
-							'y1' =>					['type' => XML_STRING | XML_REQUIRED],
-							'x2' =>					['type' => XML_STRING | XML_REQUIRED],
-							'y2' =>					['type' => XML_STRING | XML_REQUIRED],
-							'line_type' =>			['type' => XML_STRING | XML_REQUIRED],
-							'line_width' =>			['type' => XML_STRING | XML_REQUIRED],
-							'line_color' =>			['type' => XML_STRING | XML_REQUIRED],
-							'zindex' =>				['type' => XML_STRING | XML_REQUIRED]
+					'lines' =>					['type' => XML_INDEXED_ARRAY | XML_REQUIRED, 'prefix' => 'line', 'rules' => [
+						'line' =>					['type' => XML_ARRAY, 'rules' => [
+							'x1' =>						['type' => XML_STRING | XML_REQUIRED],
+							'y1' =>						['type' => XML_STRING | XML_REQUIRED],
+							'x2' =>						['type' => XML_STRING | XML_REQUIRED],
+							'y2' =>						['type' => XML_STRING | XML_REQUIRED],
+							'line_type' =>				['type' => XML_STRING | XML_REQUIRED],
+							'line_width' =>				['type' => XML_STRING | XML_REQUIRED],
+							'line_color' =>				['type' => XML_STRING | XML_REQUIRED],
+							'zindex' =>					['type' => XML_STRING | XML_REQUIRED]
 						]]
 					]],
-					'links' =>				['type' => XML_INDEXED_ARRAY | XML_REQUIRED, 'prefix' => 'link', 'rules' => [
-						'link' =>				['type' => XML_ARRAY, 'rules' => [
-							'selementid1' =>		['type' => XML_STRING | XML_REQUIRED],
-							'selementid2' =>		['type' => XML_STRING | XML_REQUIRED],
-							'label' =>				['type' => XML_STRING, 'default' => ''],
-							'show_label' =>			['type' => XML_STRING, 'default' => CXmlConstantValue::SHOW_LABEL_DEFAULT, 'in' => [CXmlConstantValue::SHOW_LABEL_DEFAULT => CXmlConstantName::SHOW_LABEL_DEFAULT, CXmlConstantValue::SHOW_LABEL_AUTO_HIDE => CXmlConstantName::SHOW_LABEL_AUTO_HIDE, CXmlConstantValue::SHOW_LABEL_ALWAYS => CXmlConstantName::SHOW_LABEL_ALWAYS]],
-							'drawtype' =>			['type' => XML_STRING, 'default' => CXmlConstantValue::SINGLE_LINE, 'in' => $this->MAP_LINK_DRAWTYPE],
-							'color' =>				['type' => XML_STRING, 'default' => '000000'],
-							'indicator_type' =>		['type' => XML_STRING, 'default' => CXmlConstantValue::INDICATOR_TYPE_STATIC_LINK, 'in' => [CXmlConstantValue::INDICATOR_TYPE_STATIC_LINK => CXmlConstantName::INDICATOR_TYPE_STATIC_LINK, CXmlConstantValue::INDICATOR_TYPE_TRIGGER => CXmlConstantName::INDICATOR_TYPE_TRIGGER, CXmlConstantValue::INDICATOR_TYPE_ITEM_VALUE => CXmlConstantName::INDICATOR_TYPE_ITEM_VALUE]],
-							'linktriggers' =>		['type' => XML_MULTIPLE, 'rules' => [
+					'links' =>					['type' => XML_INDEXED_ARRAY | XML_REQUIRED, 'prefix' => 'link', 'rules' => [
+						'link' =>					['type' => XML_ARRAY, 'rules' => [
+							'selementid1' =>			['type' => XML_STRING | XML_REQUIRED],
+							'selementid2' =>			['type' => XML_STRING | XML_REQUIRED],
+							'label' =>					['type' => XML_STRING, 'default' => ''],
+							'show_label' =>				['type' => XML_STRING, 'default' => CXmlConstantValue::SHOW_LABEL_DEFAULT, 'in' => [CXmlConstantValue::SHOW_LABEL_DEFAULT => CXmlConstantName::SHOW_LABEL_DEFAULT, CXmlConstantValue::SHOW_LABEL_AUTO_HIDE => CXmlConstantName::SHOW_LABEL_AUTO_HIDE, CXmlConstantValue::SHOW_LABEL_ALWAYS => CXmlConstantName::SHOW_LABEL_ALWAYS]],
+							'drawtype' =>				['type' => XML_STRING, 'default' => CXmlConstantValue::SINGLE_LINE, 'in' => $this->MAP_LINK_DRAWTYPE],
+							'color' =>					['type' => XML_STRING, 'default' => '000000'],
+							'indicator_type' =>			['type' => XML_STRING, 'default' => CXmlConstantValue::INDICATOR_TYPE_STATIC_LINK, 'in' => [CXmlConstantValue::INDICATOR_TYPE_STATIC_LINK => CXmlConstantName::INDICATOR_TYPE_STATIC_LINK, CXmlConstantValue::INDICATOR_TYPE_TRIGGER => CXmlConstantName::INDICATOR_TYPE_TRIGGER, CXmlConstantValue::INDICATOR_TYPE_ITEM_VALUE => CXmlConstantName::INDICATOR_TYPE_ITEM_VALUE]],
+							'linktriggers' =>			['type' => XML_MULTIPLE, 'rules' => [
 								['if' => ['tag' => 'indicator_type', 'in' => [CXmlConstantValue::INDICATOR_TYPE_TRIGGER => CXmlConstantName::INDICATOR_TYPE_TRIGGER]], 'type' => XML_INDEXED_ARRAY | XML_REQUIRED, 'prefix' => 'linktrigger', 'rules' => [
 									'linktrigger' =>	['type' => XML_ARRAY, 'rules' => [
 										'drawtype' =>		['type' => XML_STRING, 'default' => CXmlConstantValue::SINGLE_LINE, 'in' => $this->MAP_LINK_DRAWTYPE],
diff --git a/ui/include/classes/xml/CXmlConstantName.php b/ui/include/classes/xml/CXmlConstantName.php
index 7832501826f..52870c4d9d9 100644
--- a/ui/include/classes/xml/CXmlConstantName.php
+++ b/ui/include/classes/xml/CXmlConstantName.php
@@ -399,6 +399,17 @@ class CXmlConstantName {
 	public const SHOW_LABEL_AUTO_HIDE = 'AUTO_HIDE';
 	public const SHOW_LABEL_ALWAYS = 'ALWAYS';
 
+	// Constants for advanced map labels.
+	public const SHOW_LABEL_ADVANCED_OFF = 'OFF';
+	public const SHOW_LABEL_ADVANCED_ON = 'ON';
+
+	public const SHOW_MAP_LABEL_TYPE_LABEL = 'LABEL_TYPE_LABEL';
+	public const SHOW_MAP_LABEL_TYPE_IP = 'LABEL_TYPE_IP';
+	public const SHOW_MAP_LABEL_TYPE_NAME = 'LABEL_TYPE_NAME';
+	public const SHOW_MAP_LABEL_TYPE_STATUS = 'LABEL_TYPE_STATUS';
+	public const SHOW_MAP_LABEL_TYPE_NOTHING = 'LABEL_TYPE_NOTHING';
+	public const SHOW_MAP_LABEL_TYPE_CUSTOM = 'LABEL_TYPE_CUSTOM';
+
 	// Constants for map link indicators.
 	public const INDICATOR_TYPE_STATIC_LINK = 'STATIC_LINK';
 	public const INDICATOR_TYPE_TRIGGER = 'TRIGGER';
diff --git a/ui/include/classes/xml/CXmlConstantValue.php b/ui/include/classes/xml/CXmlConstantValue.php
index dda22f58361..83248c2c5d5 100644
--- a/ui/include/classes/xml/CXmlConstantValue.php
+++ b/ui/include/classes/xml/CXmlConstantValue.php
@@ -418,6 +418,17 @@ class CXmlConstantValue {
 	public const SHOW_LABEL_AUTO_HIDE = MAP_SHOW_LABEL_AUTO_HIDE;
 	public const SHOW_LABEL_ALWAYS = MAP_SHOW_LABEL_ALWAYS;
 
+	// Map advanced labels.
+	public const SHOW_LABEL_ADVANCED_OFF = SYSMAP_LABEL_ADVANCED_OFF;
+	public const SHOW_LABEL_ADVANCED_ON = SYSMAP_LABEL_ADVANCED_ON;
+
+	public const SHOW_MAP_LABEL_TYPE_LABEL = MAP_LABEL_TYPE_LABEL;
+	public const SHOW_MAP_LABEL_TYPE_IP = MAP_LABEL_TYPE_IP;
+	public const SHOW_MAP_LABEL_TYPE_NAME = MAP_LABEL_TYPE_NAME;
+	public const SHOW_MAP_LABEL_TYPE_STATUS = MAP_LABEL_TYPE_STATUS;
+	public const SHOW_MAP_LABEL_TYPE_NOTHING = MAP_LABEL_TYPE_NOTHING;
+	public const SHOW_MAP_LABEL_TYPE_CUSTOM = MAP_LABEL_TYPE_CUSTOM;
+
 	// Map link indicator types.
 	public const INDICATOR_TYPE_STATIC_LINK = MAP_INDICATOR_TYPE_STATIC_LINK;
 	public const INDICATOR_TYPE_TRIGGER = MAP_INDICATOR_TYPE_TRIGGER;
diff --git a/ui/include/maps.inc.php b/ui/include/maps.inc.php
index ce6108b9c1b..62d17cf23b3 100644
--- a/ui/include/maps.inc.php
+++ b/ui/include/maps.inc.php
@@ -1662,3 +1662,63 @@ function checkIfProblemTagsMatches(array $filter_tag, array $tags): bool {
 
 	return false;
 }
+
+/**
+ * Get sanitized map fields of given input.
+ *
+ * @param array $input
+ *
+ * @return array
+ */
+function getSanitizedMapFields(array $input): array {
+	$field_names = [
+		'sysmapid', 'name', 'width', 'height', 'backgroundid', 'label_location', 'label_format', 'highlight',
+		'expandproblem', 'markelements', 'show_unack', 'grid_size', 'grid_show', 'grid_align', 'iconmapid',
+		'expand_macros', 'severity_min', 'private', 'show_suppressed', 'selements', 'shapes', 'lines', 'links',
+		'urls', 'users', 'userGroups', 'userid'
+	];
+
+	$field_names = getConditionalMapFieldNames($field_names, $input);
+
+	return array_intersect_key($input, array_flip($field_names));
+}
+
+/**
+ * Get map field names excluding those that don't match a specific conditions.
+ *
+ * @param array $field_names
+ * @param array $input
+ *
+ * @return array
+ */
+function getConditionalMapFieldNames(array $field_names, array $input): array {
+	if ($input['label_format'] == SYSMAP_LABEL_ADVANCED_OFF) {
+		$field_names[] = 'label_type';
+
+		return $field_names;
+	}
+
+	$custom_labels = [
+		'label_type_host' => 'label_string_host',
+		'label_type_hostgroup' => 'label_string_hostgroup',
+		'label_type_trigger' => 'label_string_trigger',
+		'label_type_map' => 'label_string_map',
+		'label_type_image' => 'label_string_image'
+	];
+
+	$field_names = array_merge($field_names, [
+		'label_type_host',
+		'label_type_hostgroup',
+		'label_type_trigger',
+		'label_type_map',
+		'label_type_image'
+	]);
+
+	foreach ($custom_labels as $conditional_field => $dependent_field) {
+		if ($input[$conditional_field] == MAP_LABEL_TYPE_CUSTOM) {
+			$field_names[] = $dependent_field;
+		}
+	}
+
+	return $field_names;
+}
diff --git a/ui/include/views/monitoring.sysmap.edit.php b/ui/include/views/monitoring.sysmap.edit.php
index a21fb82020d..c3b96620729 100644
--- a/ui/include/views/monitoring.sysmap.edit.php
+++ b/ui/include/views/monitoring.sysmap.edit.php
@@ -178,6 +178,7 @@ $map_tab
 	->addRow(null,
 		(new CTextArea('label_string_hostgroup', $data['sysmap']['label_string_hostgroup']))
 			->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH)
+			->setAttribute('maxlength', DB::getFieldLength('sysmaps', 'label_string_hostgroup'))
 			->disableSpellcheck()
 	);
 
@@ -193,6 +194,7 @@ $map_tab
 	->addRow(null,
 		(new CTextArea('label_string_host', $data['sysmap']['label_string_host']))
 			->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH)
+			->setAttribute('maxlength', DB::getFieldLength('sysmaps', 'label_string_host'))
 			->disableSpellcheck()
 	);
 
@@ -208,6 +210,7 @@ $map_tab
 	->addRow(null,
 		(new CTextArea('label_string_trigger', $data['sysmap']['label_string_trigger']))
 			->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH)
+			->setAttribute('maxlength', DB::getFieldLength('sysmaps', 'label_string_trigger'))
 			->disableSpellcheck()
 	);
 
@@ -223,6 +226,7 @@ $map_tab
 	->addRow(null,
 		(new CTextArea('label_string_map', $data['sysmap']['label_string_map']))
 			->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH)
+			->setAttribute('maxlength', DB::getFieldLength('sysmaps', 'label_string_map'))
 			->disableSpellcheck()
 	);
 
@@ -238,6 +242,7 @@ $map_tab
 	->addRow(null,
 		(new CTextArea('label_string_image', $data['sysmap']['label_string_image']))
 			->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH)
+			->setAttribute('maxlength', DB::getFieldLength('sysmaps', 'label_string_image'))
 			->disableSpellcheck()
 	);
 
diff --git a/ui/sysmaps.php b/ui/sysmaps.php
index 536f0722022..e5168a4c87c 100644
--- a/ui/sysmaps.php
+++ b/ui/sysmaps.php
@@ -184,7 +184,7 @@ if (hasRequest('add') || hasRequest('update')) {
 			}
 		}
 
-		$result = API::Map()->update($map);
+		$result = API::Map()->update(getSanitizedMapFields($map));
 
 		$messageSuccess = _('Network map updated');
 		$messageFailed = _('Cannot update network map');
@@ -216,7 +216,7 @@ if (hasRequest('add') || hasRequest('update')) {
 			}
 		}
 
-		$result = API::Map()->create($map);
+		$result = API::Map()->create(getSanitizedMapFields($map));
 
 		$messageSuccess = _('Network map added');
 		$messageFailed = _('Cannot add network map');
