> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/powershell-universal/powershell-commands/new-udmap.md).

# New-UDMap

### Synopsis

Interactive maps for displaying markers, lines, and polygons.

### Syntax

```powershell
New-UDMap [[-Id] <String>] [[-Longitude] <Single>] [[-Latitude] <Single>] [[-Zoom] <Int32>] [[-Height] <String>] [[-Width] <String>] [-Content] <Endpoint> [[-ZoomControlPosition] <String>] [[-ScaleControlPosition] <String>] [-Animate] [[-MaxZoom] <Int32>] [<CommonParameters>]
```

### Description

Interactive maps for displaying markers, lines, and polygons.

### Parameters

#### -Id

The ID of the component. It defaults to a random GUID.

```
Required?                    false
Position?                    1
Default value                ([Guid]::NewGuid())
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Longitude

The default longitude of the map.

```
Required?                    false
Position?                    2
Default value                0
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Latitude

The default latitude of the map.

```
Required?                    false
Position?                    3
Default value                0
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Zoom

The default zoom level of the map.

```
Required?                    false
Position?                    4
Default value                0
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Height

The height of the map.

```
Required?                    false
Position?                    5
Default value                500px
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Width

The width of the map.

```
Required?                    false
Position?                    6
Default value                100%
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Content

The script block to call to get the map data.

```
Required?                    true
Position?                    7
Default value
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -ZoomControlPosition

The zoom control position. Valid values are topright, topleft, bottomright, bottomleft.

```
Required?                    false
Position?                    8
Default value                topright
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -ScaleControlPosition

The scale control position. Valid values are topright, topleft, bottomright, bottomleft, hide.

```
Required?                    false
Position?                    9
Default value                bottomleft
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false

    -Animate [<SwitchParameter>]
        Animate the map when it is loaded.

Required?                    false
Position?                    named
Default value                False
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -MaxZoom

The maximum zoom level of the map.

```
Required?                    false
Position?                    10
Default value                18
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false

    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer, PipelineVariable, and OutVariable. For more information, see
        about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
```

### Outputs

\-------------------------- EXAMPLE 1 --------------------------

```
PS >New-UDMap -Content {
PS >     New-UDMapRasterLayer -TileServer 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'
PS > } -Latitude 43.52107 -Longitude -114.31644 -Zoom 13 -Height '25vh' -Id 'map1'

Basic map|This basic map defines a simple base layer using the wmflabs.org tile server. You can use your own custom tile server by specifying a URL. The map is position over Hailey, Idaho.




-------------------------- EXAMPLE 2 --------------------------

PS >New-UDMap -Content {
PS >    New-UDMapLayerControl -Content {
PS >         New-UDMapBaseLayer -Name 'Color' -Content {
PS >             New-UDMapRasterLayer -TileServer 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'
PS >         } -Checked
PS >         New-UDMapOverlay -Name 'Marker' -Content {
PS >             New-UDMapMarker -Latitude 51.505 -Longitude -0.09
PS >         } -Checked
PS >         New-UDMapOverlay -Name 'Marker 2' -Content {
PS >             New-UDMapMarker -Latitude 51.555 -Longitude -0.00
PS >         } -Checked
PS >     }
PS > } -Latitude 51.505 -Longitude -0.09 -Zoom 13 -Height '25vh' -Id 'map2'

Layer Control|You can enable the layer control by using the New-UDMapLayerControl cmdlet. This map defines several layers with components that you can toggle on and off. You can only have one base layer selected as a time. Map overlay layers can toggle on and off.




-------------------------- EXAMPLE 3 --------------------------

PS >New-UDMap -Content {
PS >    New-UDMapRasterLayer -TileServer 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'
PS >    New-UDMapMarker -Latitude "51.105" -Longitude "-0.09" -Popup (
PS >       New-UDMapPopup -Content {
PS >          New-UDAlert -Text "Hello"
PS >       } -MinWidth 200
PS >    )
PS > } -Latitude 51.505 -Longitude -0.09 -Zoom 13 -Height '25vh' -Id 'map3'

Markers with Popup|You can add markers to the map by using the New-UDMapMarker cmdlet.




-------------------------- EXAMPLE 4 --------------------------

PS >New-UDMap -Content {
PS >    New-UDMapRasterLayer -TileServer 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'
PS >    New-UDMapVectorLayer -Circle -Radius 1000 -Latitude 51.505 -Longitude -0.09 -Color 'red' -FillColor 'blue' -FillOpacity 0.5
PS > } -Latitude 51.505 -Longitude -0.09 -Zoom 13 -Height '25vh' -Id 'map4'

Vectors|You can add vectors to the map by using the New-UDMapVectorLayer cmdlet.
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.devolutions.net/powershell-universal/powershell-commands/new-udmap.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
