Project

PSWriteHTML

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

Stars 1,019
Forks 115
Open issues 54
PowerShell Gallery downloads 7,576,901
Release v1.41.0
Language: PowerShell Updated: 2026-10-03
Command

New-HTMLMap

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

Authored help example

EXAMPLE 1

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

$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`1 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.