[comment]: # ({df556223-df556223})
# map.update

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

[comment]: # ({b8844e81-821c3f80})
### Description

`object map.update(object/array maps)`

This method allows to update existing maps.

::: noteclassic
This method is available to users of any type. Permissions
to call the method can be revoked in user role settings. See [User
roles](/manual/web_interface/frontend_sections/users/user_roles)
for more information.
:::

[comment]: # ({/b8844e81-821c3f80})

[comment]: # ({a3b4ed68-7a706637})
### Parameters

`(object/array)` Map properties to be updated.

The `mapid` property must be defined for each map, all other properties
are optional. Only the passed properties will be updated, all others
will remain unchanged.

Additionally to the [standard map properties](object#map), the method
accepts the following parameters.

|Parameter|[Type](/manual/api/reference_commentary#data-types)|Description|
|--|--|------|
|links|array|[Map links](/manual/api/reference/map/object#map-link) to replace the existing links.|
|selements|array|[Map elements](/manual/api/reference/map/object#map-element) to replace the existing elements.|
|urls|array|[Map URLs](/manual/api/reference/map/object#map-url) to replace the existing URLs.|
|users|array|[Map user](/manual/api/reference/map/object#map-user) shares to replace the existing elements.|
|userGroups|array|[Map user group](/manual/api/reference/map/object#map-user-group) shares to replace the existing elements.|
|shapes|array|[Map shapes](/manual/api/reference/map/object#map-shapes) to replace the existing shapes.|
|lines|array|[Map lines](/manual/api/reference/map/object#map-lines) to replace the existing lines.|

::: notetip
To create map links between new map elements you'll need
to set an element's `selementid` to an arbitrary value and then use this
value to reference this element in the links `selementid1` or
`selementid2` properties. When the element is created, this value will
be replaced with the correct ID generated by Zabbix. [See example for
map.create.](create#create-a-host-map)
:::

[comment]: # ({/a3b4ed68-7a706637})

[comment]: # ({f1256f7a-f1256f7a})
### Return values

`(object)` Returns an object containing the IDs of the updated maps
under the `sysmapids` property.

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

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

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

[comment]: # ({b0f05028-6df0be65})
#### Resize a map

Change the size of the map to 1200x1200 pixels.

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

```json
{
    "jsonrpc": "2.0",
    "method": "map.update",
    "params": {
        "sysmapid": "8",
        "width": 1200,
        "height": 1200
    },
    "id": 1
}
```

Response:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "sysmapids": [
            "8"
        ]
    },
    "id": 1
}
```

[comment]: # ({/b0f05028-6df0be65})

[comment]: # ({d4443aed-76eb7f1c})
#### Change map owner

Available only for admins and super admins.

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

```json
{
    "jsonrpc": "2.0",
    "method": "map.update",
    "params": {
        "sysmapid": "9",
        "userid": "1"
    },
    "id": 1
}
```

Response:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "sysmapids": [
            "9"
        ]
    },
    "id": 1
}
```

[comment]: # ({/d4443aed-76eb7f1c})

[comment]: # ({7694e802-6c6205f1})
### See also

-   [Map element](object#map-element)
-   [Map link](object#map-link)
-   [Map URL](object#map-url)
-   [Map user](object#map-user)
-   [Map user group](object#map-user-group)
-   [Map shapes](object#map-shapes)
-   [Map lines](object#map-lines)

[comment]: # ({/7694e802-6c6205f1})

[comment]: # ({2f149f32-2f149f32})
### Source

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

[comment]: # ({/2f149f32-2f149f32})
