> 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/es/comandos-de-powershell/new-udmap.md).

# New-UDMap

New-UDMap crea un componente de mapa interactivo en PowerShell Universal para mostrar marcadores, líneas y polígonos con zoom, centro y controles configurables.

### Resumen

Mapas interactivos para mostrar marcadores, líneas y polígonos.

### Sintaxis

```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>]
```

### Descripción

Mapas interactivos para mostrar marcadores, líneas y polígonos.

### Parámetros

#### -Id

El ID del componente. De forma predeterminada, es un GUID aleatorio.

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

#### -Longitude

La longitud predeterminada del mapa.

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

#### -Latitude

La latitud predeterminada del mapa.

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

#### -Zoom

El nivel de zoom predeterminado del mapa.

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

#### -Height

La altura del mapa.

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

#### -Width

La anchura del mapa.

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

#### -Content

El bloque de script que se llama para obtener los datos del mapa.

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

#### -ZoomControlPosition

La posición del control de zoom. Los valores válidos son topright, topleft, bottomright, bottomleft.

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

#### -ScaleControlPosition

La posición del control de escala. Los valores válidos son topright, topleft, bottomright, bottomleft, hide.

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

#### -Animate

Anima el mapa cuando se carga.

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

#### -MaxZoom

El nivel de zoom máximo del mapa.

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

#### Parámetros comunes

Este cmdlet admite los parámetros comunes: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable y OutVariable. Para obtener más información, consulte [about\_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

### Salidas

### Ejemplos

#### Ejemplo 1: mapa básico

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

Este mapa básico define una capa base sencilla utilizando el servidor de teselas wmflabs.org. Puede utilizar su propio servidor de teselas personalizado especificando una URL. El mapa está posicionado sobre Hailey, Idaho.

#### Ejemplo 2: control de capas

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

Puede habilitar el control de capas mediante el cmdlet New-UDMapLayerControl. Este mapa define varias capas con componentes que puede activar y desactivar. Solo puede tener una capa base seleccionada a la vez. Las capas de superposición del mapa se pueden activar y desactivar.

#### Ejemplo 3: marcadores con ventana emergente

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

Puede añadir marcadores al mapa mediante el cmdlet New-UDMapMarker.

#### Ejemplo 4: vectores

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

Puede añadir vectores al mapa mediante el cmdlet New-UDMapVectorLayer.


---

# 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/es/comandos-de-powershell/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.
