HtmlForgeX

API Reference

Class

JsVectorMap

Namespace HtmlForgeX
Assembly HtmlForgeX
Base Element

jsVectorMap component with typed options and a Settings sub‑builder. Loads the core library plus a separate per‑map dataset only when used.

Inheritance

Constructors

public JsVectorMap(JsVectorMapName map = WorldMerc) #

Create a new vector map.

Parameters

map HtmlForgeX.JsVectorMapName = WorldMerc optionalposition: 0

Methods

public JsVectorMap AddLine(String fromMarkerName, String toMarkerName) #
Returns: JsVectorMap

Adds a connection line between two markers referenced by their names.

Parameters

fromMarkerName System.String requiredposition: 0
toMarkerName System.String requiredposition: 1
AddMarker 7 overloads
public JsVectorMap AddMarker(Double latitude, Double longitude, String name = null) #
Returns: JsVectorMap

Adds a geographic marker.

Parameters

latitude System.Double requiredposition: 0
longitude System.Double requiredposition: 1
name System.String = null optionalposition: 2
public JsVectorMap AddMarker(Double latitude, Double longitude, String name, RGBColor color) #
Returns: JsVectorMap

Adds a geographic marker with a Tabler color fill.

Parameters

latitude System.Double requiredposition: 0
longitude System.Double requiredposition: 1
name System.String requiredposition: 2
color HtmlForgeX.TablerColor requiredposition: 3
AddMarker(System.Double latitude, System.Double longitude, System.String name, HtmlForgeX.RGBColor color) #

Adds a geographic marker with a custom RGB color fill.

Parameters

latitude System.Double required
longitude System.Double required
name System.String required
color HtmlForgeX.RGBColor required
public JsVectorMap AddMarker(Double latitude, Double longitude, String name, String categoryKey) #
Returns: JsVectorMap

Adds a marker and assigns it to a category key used for marker series.

Parameters

latitude System.Double requiredposition: 0
longitude System.Double requiredposition: 1
name System.String requiredposition: 2
categoryKey System.String requiredposition: 3
public JsVectorMap AddMarker(Double latitude, Double longitude, String name, RGBColor color, String categoryKey) #
Returns: JsVectorMap

Adds a marker with Tabler color and category key, auto-wiring series and legend.

Parameters

latitude System.Double requiredposition: 0
longitude System.Double requiredposition: 1
name System.String requiredposition: 2
color HtmlForgeX.TablerColor requiredposition: 3
categoryKey System.String requiredposition: 4
AddMarker(System.Double latitude, System.Double longitude, System.String name, HtmlForgeX.RGBColor color, System.String categoryKey) #

Adds a marker with RGB color and category key, auto-wiring series and legend.

Parameters

latitude System.Double required
longitude System.Double required
name System.String required
color HtmlForgeX.RGBColor required
categoryKey System.String required
public JsVectorMap AddMarker(Double latitude, Double longitude, String name, String colorHex, String categoryKey) #
Returns: JsVectorMap

Adds a marker with hex color and category key, auto-wiring series and legend.

Parameters

latitude System.Double requiredposition: 0
longitude System.Double requiredposition: 1
name System.String requiredposition: 2
colorHex System.String requiredposition: 3
categoryKey System.String requiredposition: 4
public JsVectorMap AddMarkerHex(Double latitude, Double longitude, String name, String colorHex) #
Returns: JsVectorMap
EditorBrowsable(2)

Adds a geographic marker with a custom hex color (e.g., "#FF0000").

Parameters

latitude System.Double requiredposition: 0
longitude System.Double requiredposition: 1
name System.String requiredposition: 2
colorHex System.String requiredposition: 3
public JsVectorMap ColorRegions(IDictionary<String, Int32> regionLevels, Nullable<TablerColor> baseColor = null, Double minAlpha = 0.1, Double maxAlpha = 1) #
Returns: JsVectorMap

Simplified region coloring: provide region levels (1..10) and a base Tabler color; the scale is generated automatically.

Parameters

regionLevels System.Collections.Generic.IDictionary{System.String,System.Int32} requiredposition: 0
baseColor System.Nullable{HtmlForgeX.TablerColor} = null optionalposition: 1
minAlpha System.Double = 0.1 optionalposition: 2
maxAlpha System.Double = 1 optionalposition: 3
public JsVectorMap ColorRegionsWithPalette(IDictionary<String, Int32> regionLevels, IList<String> paletteHex) #
Returns: JsVectorMap

Simplified region coloring using a discrete palette of colors.

Parameters

regionLevels System.Collections.Generic.IDictionary{System.String,System.Int32} requiredposition: 0
paletteHex System.Collections.Generic.IList{System.String} requiredposition: 1
public JsVectorMap ConfigureLineStyle(Nullable<TablerColor> color = null, RGBColor customColor = null, Nullable<Double> width = null, Nullable<Boolean> dashed = null, Nullable<Boolean> animation = null, Nullable<Double> curvature = null) #
Returns: JsVectorMap

Configures line style using typed colors.

Parameters

color System.Nullable{HtmlForgeX.TablerColor} = null optionalposition: 0
customColor HtmlForgeX.RGBColor = null optionalposition: 1
width System.Nullable{System.Double} = null optionalposition: 2
dashed System.Nullable{System.Boolean} = null optionalposition: 3
animation System.Nullable{System.Boolean} = null optionalposition: 4
curvature System.Nullable{System.Double} = null optionalposition: 5
public JsVectorMap MarkerLegend(String title = null, Nullable<Boolean> vertical = null) #
Returns: JsVectorMap

Sets a legend for the implicit marker series (created by AddMarker with category).

Parameters

title System.String = null optionalposition: 0
vertical System.Nullable{System.Boolean} = null optionalposition: 1
public JsVectorMap Markers(Action<JsVectorMapMarkerSettings> configure) #
Returns: JsVectorMap

Configures marker series (categories/palette/legend) in a fluent way.

Parameters

configure System.Action{HtmlForgeX.JsVectorMapMarkerSettings} requiredposition: 0
RegisterLibraries() #

Registers required libraries and the selected map data file.

SetBackground(System.String arg1) #

Sets background color.

Parameters

arg1 System.String required
SetDraggable(System.Boolean arg1) #

Enable/disable dragging.

Parameters

arg1 System.Boolean required
SetHeight(System.String arg1) #

Sets a fixed height for the map container.

Parameters

arg1 System.String required
public JsVectorMap SetMarkerSeries(Dictionary<Int32, String> values, Dictionary<String, String> scale = null, String attribute = "fill", String legendTitle = null, Nullable<Boolean> legendVertical = null) #
Returns: JsVectorMap

Defines a series for marker coloring keyed by marker index. Supports legend.

Parameters

values System.Collections.Generic.Dictionary{System.Int32,System.String} requiredposition: 0
scale System.Collections.Generic.Dictionary{System.String,System.String} = null optionalposition: 1
attribute System.String = "fill" optionalposition: 2
legendTitle System.String = null optionalposition: 3
legendVertical System.Nullable{System.Boolean} = null optionalposition: 4
public JsVectorMap SetMarkerSeriesByName(Dictionary<String, String> valuesByName, Dictionary<String, String> scale = null, String attribute = "fill", String legendTitle = null, Nullable<Boolean> legendVertical = null) #
Returns: JsVectorMap

Defines a marker series keyed by marker names; names map to indices automatically.

Parameters

valuesByName System.Collections.Generic.Dictionary{System.String,System.String} requiredposition: 0
scale System.Collections.Generic.Dictionary{System.String,System.String} = null optionalposition: 1
attribute System.String = "fill" optionalposition: 2
legendTitle System.String = null optionalposition: 3
legendVertical System.Nullable{System.Boolean} = null optionalposition: 4
SetMarkerStyle(System.Nullable{System.Double} arg1, System.String arg2, System.String arg3, System.Nullable{System.Double} arg4, System.Nullable{System.Double} arg5) #

Sets default marker style.

Parameters

arg1 System.Nullable{System.Double} required
arg2 System.String required
arg3 System.String required
arg4 System.Nullable{System.Double} required
arg5 System.Nullable{System.Double} required
SetRegionSeries 2 overloads
public JsVectorMap SetRegionSeries(Dictionary<String, String> values, Dictionary<String, String> scale = null, String attribute = "fill") #
Returns: JsVectorMap

Defines a series for region coloring keyed by ISO codes.

Parameters

values System.Collections.Generic.Dictionary{System.String,System.String} requiredposition: 0
scale System.Collections.Generic.Dictionary{System.String,System.String} = null optionalposition: 1
attribute System.String = "fill" optionalposition: 2
public JsVectorMap SetRegionSeries(Dictionary<String, String> values, Dictionary<String, String> scale, String attribute, String legendTitle, Nullable<Boolean> legendVertical) #
Returns: JsVectorMap

Defines a series for region coloring with an optional legend.

Parameters

values System.Collections.Generic.Dictionary{System.String,System.String} requiredposition: 0
scale System.Collections.Generic.Dictionary{System.String,System.String} requiredposition: 1
attribute System.String requiredposition: 2
legendTitle System.String requiredposition: 3
legendVertical System.Nullable{System.Boolean} requiredposition: 4
SetRegionStyle(System.String arg1, System.String arg2, System.Nullable{System.Double} arg3) #

Sets base region style.

Parameters

arg1 System.String required
arg2 System.String required
arg3 System.Nullable{System.Double} required
public JsVectorMap Settings(Action<JsVectorMapSettings> configure) #
Returns: JsVectorMap

Less-common options grouped under a sub‑builder to keep the root tidy.

Parameters

configure System.Action{HtmlForgeX.JsVectorMapSettings} requiredposition: 0
SetZoomButtons(System.Boolean arg1) #

Enable/disable zoom buttons.

Parameters

arg1 System.Boolean required
SetZoomOnScroll(System.Boolean arg1) #

Enable/disable scroll zoom.

Parameters

arg1 System.Boolean required
public JsVectorMap ShowMarkerLabels(Boolean show = true) #
Returns: JsVectorMap

Shows simple marker labels using their name.

Parameters

show System.Boolean = true optionalposition: 0
public JsVectorMap ShowRegionLabels(Boolean show = true) #
Returns: JsVectorMap

Shows simple region labels using their name.

Parameters

show System.Boolean = true optionalposition: 0
public override String ToString() #
Returns: String

Renders the container and inline initialization script.

public JsVectorMap UseCustomMap(String mapId, String datasetUrlOrFileName) #
Returns: JsVectorMap

Uses a custom map id and dataset URL. This is a small escape hatch for datasets not covered by JsVectorMapName.

Parameters

mapId System.String requiredposition: 0
The map id string (e.g., "france").
datasetUrlOrFileName System.String requiredposition: 1
Full URL to the dataset JS, or a file name under the default CDN.
public JsVectorMap UseMap(JsVectorMapName map) #
Returns: JsVectorMap

Selects which map dataset to use.

Parameters

map HtmlForgeX.JsVectorMapName requiredposition: 0

Properties

public String Id { get; } #

Unique id for the map container.

public JsVectorMapOptions Options { get; } #

Initialization options sent to jsVectorMap.

Extension Methods

public static JsVectorMap AddCountryMarkers(JsVectorMap map, IDictionary<String, Double> values, Int32 maxMarkers = 35, Double minRadius = 4, Double maxRadius = 14, Nullable<TablerColor> color = null) #
Returns: JsVectorMap

Adds country markers using ISO2 keys and numeric values (e.g., user counts). Markers are sized proportionally to the maximum value and use a single accent color by default.

Parameters

map HtmlForgeX.JsVectorMap requiredposition: 0
Target map.
values System.Collections.Generic.IDictionary{System.String,System.Double} requiredposition: 1
ISO2 -> value map.
maxMarkers System.Int32 = 35 optionalposition: 2
Maximum number of markers to render (top values).
minRadius System.Double = 4 optionalposition: 3
Minimum marker radius.
maxRadius System.Double = 14 optionalposition: 4
Maximum marker radius.
color System.Nullable{HtmlForgeX.TablerColor} = null optionalposition: 5
Marker fill color.