[comment]: # translation:outdated

[comment]: # ({14e441a9-14e441a9})
# map.get

[comment]: # ({/14e441a9-14e441a9})

[comment]: # ({72489b9c-480bee08})
### Descrizione

`integer/array map.get(object parameters)`

Il metodo consente di recuperare le mappe in base ai parametri specificati.

::: noteclassic
Questo metodo è disponibile per utenti di qualsiasi tipo. Le autorizzazioni
per chiamare il metodo possono essere revocate nelle impostazioni del ruolo utente. Vedere [User
roles](/manual/web_interface/frontend_sections/users/user_roles)
per ulteriori informazioni.
:::

[comment]: # ({/72489b9c-480bee08})

[comment]: # ({eb92de32-c0fdc6dd})
### Parametri

`(object)` Parametri che definiscono l'output desiderato.

Il metodo supporta i seguenti parametri.

|Parametro|[Type](/manual/api/reference_commentary#data-types)|Descrizione|
|--|--|------|
|sysmapids|ID/array|Restituisce solo le mappe con gli ID specificati.|
|userids|ID/array|Restituisce solo le mappe che appartengono agli ID utente specificati.|
|expandUrls|flag|Aggiunge gli URL globali della mappa ai corrispondenti elementi della mappa ed espande le macro in tutti gli URL degli elementi della mappa.|
|selectIconMap|query|Restituisce una proprietà [`iconmap`](/manual/api/reference/iconmap/object) con la mappa di icone utilizzata nella mappa.|
|selectLinks|query|Restituisce una proprietà [`links`](/manual/api/reference/map/object#map-link) con i collegamenti della mappa tra gli elementi.|
|selectSelements|query|Restituisce una proprietà [`selements`](/manual/api/reference/map/object#map-element) con gli elementi della mappa.|
|selectUrls|query|Restituisce una proprietà [`urls`](/manual/api/reference/map/object#map-url) con gli URL della mappa.|
|selectUsers|query|Restituisce una proprietà [`users`](/manual/api/reference/map/object#map-user) con gli utenti con cui la mappa è condivisa.|
|selectUserGroups|query|Restituisce una proprietà [`userGroups`](/manual/api/reference/map/object#map-user-group) con i gruppi di utenti con cui la mappa è condivisa.|
|selectShapes|query|Restituisce una proprietà [`shapes`](/manual/api/reference/map/object#map-shapes) con le forme della mappa.|
|selectLines|query|Restituisce una proprietà [`lines`](/manual/api/reference/map/object#map-lines) con le linee della mappa.|
|sortfield|string/array|Ordina il risultato in base alle proprietà specificate.<br><br>Valori possibili: `name`, `width`, `height`.|
|countOutput|boolean|Questi parametri sono descritti nel [commento di riferimento](/manual/api/reference_commentary#common-get-method-parameters).|
|editable|boolean|^|
|excludeSearch|boolean|^|
|filter|object|^|
|limit|integer|^|
|output|query|^|
|preservekeys|boolean|^|
|search|object|^|
|searchByAny|boolean|^|
|searchWildcardsEnabled|boolean|^|
|sortorder|string/array|^|
|startSearch|boolean|^|

[comment]: # ({/eb92de32-c0fdc6dd})

[comment]: # ({7223bab1-7223bab1})
### Valori restituiti

`(integer/array)` Restituisce o:

- una matrice di oggetti;
- il conteggio degli oggetti recuperati, se il parametro `countOutput` è
    stato usato.

[comment]: # ({/7223bab1-7223bab1})

[comment]: # ({b41637d2-b41637d2})
### Esempi

[comment]: # ({/b41637d2-b41637d2})

[comment]: # ({645c26fb-cb769d11})
#### Recuperare una mappa

Recupera tutti i dati della mappa "3".

[Richiesta](/manual/api#performing-requests):

```json
{
    "jsonrpc": "2.0",
    "method": "map.get",
    "params": {
        "output": "extend",
        "selectSelements": "extend",
        "selectLinks": "extend",
        "selectUsers": "extend",
        "selectUserGroups": "extend",
        "selectShapes": "extend",
        "selectLines": "extend",
        "sysmapids": "3"
    },
    "id": 1
}
```

Risposta:

```json
{
    "jsonrpc": "2.0",
    "result": [
        {
            "selements": [
                {
                    "selementid": "10",
                    "sysmapid": "3",
                    "elementtype": "4",
                    "evaltype": "0",
                    "iconid_off": "1",
                    "iconid_on": "0",
                    "label": "Zabbix server",
                    "label_location": "3",
                    "x": "11",
                    "y": "141",
                    "iconid_disabled": "0",
                    "iconid_maintenance": "0",
                    "elementsubtype": "0",
                    "areatype": "0",
                    "width": "200",
                    "height": "200",
                    "viewtype": "0",
                    "use_iconmap": "1",
                    "show_label": "-1",
                    "zindex":"0",
                    "elements": [],
                    "urls": [],
                    "tags": [
                        {
                            "tag": "service",
                            "value": "mysqld",
                            "operator": "0"
                        }
                    ]
                },
                {
                    "selementid": "11",
                    "sysmapid": "3",
                    "elementtype": "4",
                    "evaltype": "0",
                    "iconid_off": "1",
                    "iconid_on": "0",
                    "label": "Web server",
                    "label_location": "3",
                    "x": "211",
                    "y": "191",
                    "iconid_disabled": "0",
                    "iconid_maintenance": "0",
                    "elementsubtype": "0",
                    "areatype": "0",
                    "width": "200",
                    "height": "200",
                    "viewtype": "0",
                    "use_iconmap": "1",
                    "show_label": "0",
                    "zindex":"0",
                    "elements": [],
                    "urls": [],
                    "tags": []
                },
                {
                    "selementid": "12",
                    "sysmapid": "3",
                    "elementtype": "0",
                    "evaltype": "0",
                    "iconid_off": "185",
                    "iconid_on": "0",
                    "label": "{HOST.NAME}\r\n{HOST.CONN}",
                    "label_location": "0",
                    "x": "111",
                    "y": "61",
                    "iconid_disabled": "0",
                    "iconid_maintenance": "0",
                    "elementsubtype": "0",
                    "areatype": "0",
                    "width": "200",
                    "height": "200",
                    "viewtype": "0",
                    "use_iconmap": "0",
                    "show_label": "1",
                    "zindex":"0",
                    "elements": [
                        {
                            "hostid": "10084"
                        }
                    ],
                    "urls": [],
                    "tags": []
                }
            ],
            "links": [
                {
                    "linkid": "23",
                    "sysmapid": "3",
                    "selementid1": "10",
                    "selementid2": "11",
                    "drawtype": "0",
                    "color": "00CC00",
                    "label": "",
                    "show_label": "1",
                    "indicator_type": "0",
                    "itemid": "0",
                    "linktriggers": [],
                    "thresholds": [],
                    "highlights": []
                }
            ],
            "users": [
                {
                    "sysmapuserid": "1",
                    "userid": "2",
                    "permission": "2"
                }
            ],
            "userGroups": [
                {
                    "sysmapusrgrpid": "1",
                    "usrgrpid": "7",
                    "permission": "2"
                }
            ],
            "shapes":[
                {
                    "sysmap_shapeid":"1",
                    "type":"0",
                    "x":"0",
                    "y":"0",
                    "width":"680",
                    "height":"15",
                    "text":"{MAP.NAME}",
                    "font":"9",
                    "font_size":"11",
                    "font_color":"000000",
                    "text_halign":"0",
                    "text_valign":"0",
                    "border_type":"0",
                    "border_width":"0",
                    "border_color":"000000",
                    "background_color":"",
                    "zindex":"0"
                }
            ],
            "lines":[
                {
                    "sysmap_shapeid":"2",
                    "x1": 30,
                    "y1": 10,
                    "x2": 100,
                    "y2": 50,
                    "line_type": 1,
                    "line_width": 10,
                    "line_color": "009900",
                    "zindex":"1"
                }
            ],
            "sysmapid": "3",
            "name": "Local network",
            "width": "400",
            "height": "400",
            "backgroundid": "0",
            "background_scale": "1",
            "label_type": "2",
            "label_location": "3",
            "show_element_label": "0",
            "show_link_label": "1",
            "highlight": "1",
            "expandproblem": "1",
            "markelements": "0",
            "show_unack": "0",
            "grid_size": "50",
            "grid_show": "1",
            "grid_align": "1",
            "label_format": "0",
            "label_type_host": "2",
            "label_type_hostgroup": "2",
            "label_type_trigger": "2",
            "label_type_map": "2",
            "label_type_image": "2",
            "label_string_host": "",
            "label_string_hostgroup": "",
            "label_string_trigger": "",
            "label_string_map": "",
            "label_string_image": "",
            "iconmapid": "0",
            "expand_macros": "0",
            "severity_min": "0",
            "userid": "1",
            "private": "1",
            "show_suppressed": "1"
        }
    ],
    "id": 1
}
```

[comment]: # ({/645c26fb-cb769d11})

[comment]: # ({07cf6602-4be4cd90})
### Vedi anche

-   [Mappa delle icone](/manual/api/reference/iconmap/object#icon-map)
-   [Elemento della mappa](object#map-element)
-   [Collegamento della mappa](object#map-link)
-   [URL della mappa](object#map-url)
-   [Utente della mappa](object#map-user)
-   [Gruppo di utenti della mappa](object#map-user-group)
-   [Forme della mappa](object#map-shapes)
-   [Linee della mappa](object#map-lines)

[comment]: # ({/07cf6602-4be4cd90})

[comment]: # ({d61644e7-d61644e7})
### Fonte

CMap::get() in *ui/include/classes/api/services/CMap.php*.

[comment]: # ({/d61644e7-d61644e7})
