Source
* @param array $areas Areas representing array containing host group element IDs and dimension
<?php
/*
** Zabbix
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
class CMapHelper {
/**
* Get map data with resolved element / link states.
*
* @param array $sysmapids Map IDs.
* @param array $options Options used to retrieve actions.
* @param int $options['severity_min'] Minimum severity.
* @param int $options['unique_id']
*
* @return array
*/
public static function get($sysmapids, array $options = []) {
$maps = API::Map()->get([
'output' => ['sysmapid', 'name', 'width', 'height', 'backgroundid', 'label_type', 'label_location',
'highlight', 'expandproblem', 'markelements', 'show_unack', 'label_format', 'label_type_host',
'label_type_hostgroup', 'label_type_trigger', 'label_type_map', 'label_type_image', 'label_string_host',
'label_string_hostgroup', 'label_string_trigger', 'label_string_map', 'label_string_image', 'iconmapid',
'severity_min', 'show_suppressed'
],
'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'
],
'selectLines' => ['sysmap_shapeid', 'x1', 'x2', 'y1', 'y2', 'line_type', 'line_width', 'line_color',
'zindex'
],
'selectSelements' => ['selementid', 'elements', 'elementtype', 'iconid_off', 'iconid_on', 'label',
'label_location', 'x', 'y', 'iconid_disabled', 'iconid_maintenance', 'elementsubtype', 'areatype',
'width', 'height', 'viewtype', 'use_iconmap', 'permission', 'evaltype', 'tags'
],
'selectLinks' => ['linkid', 'selementid1', 'selementid2', 'drawtype', 'color', 'label', 'linktriggers',
'permission'
],
'sysmapids' => $sysmapids,
'preservekeys' => true
]);
$map = reset($maps);
$theme = getUserGraphTheme();
if (!$map) {