# New-HTMLMap

Creates a new HTML map with specified settings. Review available syntax, parameters, pipeline guidance, and reference details in PSWriteHTML API Reference.

Project

PSWriteHTML

Generate HTML reports, dashboards, and emails from PowerShell without writing HTML, CSS, or JavaScript.

[View on GitHub](https://github.com/EvotecIT/PSWriteHTML) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteHTML/releases/tag/v1.41.0) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteHTML/1.40.0)

Stars **1,025**

Forks **114**

Open issues 

PowerShell Gallery downloads **7,576,901**

Release **v1.45.0**

Language: PowerShell Updated: 2026-11-19

Command 

**Module**

`PSWriteHTML`

Creates a new HTML map with specified settings.

## Syntax

```
New-HTMLMap
[[-AnchorName] <String>]
[[-AreaTitle] <String>]
[[-FillColor] <String>]
[-Map] <Poland|Usa_States|World_Countries|European_Union>
[[-MapSettings] <ScriptBlock>]
[[-PlotTitle] <String>]
[-ShowAreaLegend]
[-ShowPlotLegend]
[[-StrokeColor] <String>]
[[-StrokeWidth] <Nullable`1>]
[<CommonParameters>]
```

[#](#method-new-htmlmap-string-string-string-string-scriptblock-string-switchparameter-switchparameter-string-nullable)

Parameter set: `All Parameter Sets`

## Description

This function creates a new HTML map with customizable settings such as map type, legend options, colors, and titles.

## Examples

### Example 1

```powershell
New-HTMLMap -Map 'World_Countries' -AnchorName 'Map1' -ShowAreaLegend -AreaTitle 'Country Population' -PlotTitle 'Population Density' -FillColor 'blue' -StrokeColor 'black' -StrokeWidth 2
```

Creates a new HTML map displaying world countries with area legend showing country population and plot legend showing population density. The map areas are filled with blue color, have black borders, and a border width of 2.

### Example 2

```powershell
$CustomSettings = {
    # Custom map settings here
}
New-HTMLMap -Map 'Usa_States' -AnchorName 'Map2' -ShowPlotLegend -PlotTitle 'Economic Data' -FillColor 'green' -StrokeColor 'gray' -StrokeWidth 1 -MapSettings $CustomSettings
```

Creates a new HTML map displaying USA states with plot legend showing economic data. The map areas are filled with green color, have gray borders, and a border width of 1. Custom map settings are applied using the script block $CustomSettings.

## Parameters

**-AnchorName String optionalposition: 2**

Specifies the name of the HTML anchor element where the map will be rendered.

**-AreaTitle String optionalposition: 3**

Specifies the title for the area legend.

**-FillColor String optionalposition: 5aliases: SliceColor**

Specifies the color to fill the map areas.

**-Map String requiredposition: 1**

Specifies the type of map to be displayed. Valid values are 'Poland', 'Usa_States', 'World_Countries', or 'European_Union'.

Possible values: `Poland`, `Usa_States`, `World_Countries`, `European_Union`

**-MapSettings ScriptBlock optionalposition: 0**

A script block containing custom map settings to be applied.

**-PlotTitle String optionalposition: 4**

Specifies the title for the plot legend.

**-ShowAreaLegend SwitchParameter optional**

Switch parameter to indicate whether to display the area legend on the map.

**-ShowPlotLegend SwitchParameter optional**

Switch parameter to indicate whether to display the plot legend on the map.

**-StrokeColor String optionalposition: 6**

Specifies the color of the map area borders.

**-StrokeWidth Nullable<T> optionalposition: 7**

Specifies the width of the map area borders.

## Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see [about_CommonParameters](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:0B6500A43C03DB724CB2C6246EE4D7A641F3DFE9CC66872F85BD78380455A7A2 -->
