# ChartMapDefinition

Describes reusable map geometry that can be rendered with different map visual styles.

 Class  

`ChartForgeX.Core`

**Namespace**

`ChartForgeX.Core`

**Assembly**

`ChartForgeX`

**Source**

[ChartMapDefinition.cs:53](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/ChartMapDefinition.cs#L53)

**Modifiers**

sealed

Describes reusable map geometry that can be rendered with different map visual styles.

## Inheritance

- object
- ChartMapDefinition

## Usage

 Explore 22 API references to this type 

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 15

- Method [ChartMapCatalog.All](/api/chartforgex-core-chartmapcatalog/#method-all)
- Method [ChartMapCatalog.FromAssetDirectory](/api/chartforgex-core-chartmapcatalog/#method-fromassetdirectory-string-string)
- Method [ChartMapCatalog.FromGeoJson](/api/chartforgex-core-chartmapcatalog/#method-fromgeojson-string-string)
- Method [ChartMapCatalog.FromGeoJsonFile](/api/chartforgex-core-chartmapcatalog/#method-fromgeojsonfile-string-string)
- Method [ChartMapCatalog.Get](/api/chartforgex-core-chartmapcatalog/#method-get-string)
- Method [ChartMapCatalog.Load](/api/chartforgex-core-chartmapcatalog/#method-load-string-string)
- Method [ChartMapCatalogEntry.FromAssetDirectory](/api/chartforgex-core-chartmapcatalogentry/#method-fromassetdirectory-string-action-chartforgex-core-chartmapgeojsonoptions)
- Method [ChartMapCatalogEntry.FromGeoJson](/api/chartforgex-core-chartmapcatalogentry/#method-fromgeojson-string)
- Method [ChartMapCatalogEntry.FromGeoJsonFile](/api/chartforgex-core-chartmapcatalogentry/#method-fromgeojsonfile-string-action-chartforgex-core-chartmapgeojsonoptions)
- Method [ChartMapDefinition.FromGeoJson](/api/chartforgex-core-chartmapdefinition/#method-fromgeojson-string-string-string-chartforgex-core-chartmapgeojsonoptions)
- Method [ChartMapDefinition.WithGeographicProjection](/api/chartforgex-core-chartmapdefinition/#method-withgeographicprojection-chartforgex-core-chartmapgeojsonprojection)
- Method [ChartMapDefinition.WithPolygonViewport](/api/chartforgex-core-chartmapdefinition/#method-withpolygonviewport-chartforgex-core-chartmapviewport)
- Method [ChartMapGeoJson.ToMapDefinition](/api/chartforgex-core-chartmapgeojson/#method-tomapdefinition-string-string-string-chartforgex-core-chartmapgeojsonoptions)
- Property [ChartMapLayer.Definition](/api/chartforgex-core-chartmaplayer/#property-definition)
- Property [ChartSeries.RegionMapDefinition](/api/chartforgex-core-chartseries/#property-regionmapdefinition)

### Accepted by parameters 7

- Method [Chart.AddMapBaseLayer](/api/chartforgex-core-chart/#method-addmapbaselayer-chartforgex-core-chartmapdefinition-chartforgex-primitives-chartcolor-nullable-chartforgex-primitives-chartcolor-double) parameter `definition`
- Method [Chart.AddMapBoundaryLayer](/api/chartforgex-core-chart/#method-addmapboundarylayer-chartforgex-core-chartmapdefinition-chartforgex-primitives-chartcolor-double-nullable-chartforgex-primitives-chartcolor) parameter `definition`
- Method [Chart.AddRegionHeatmap](/api/chartforgex-core-chart/#method-addregionheatmap-string-chartforgex-core-chartmapdefinition-collections-generic-ienumerable-chartforgex-core-chartregionmapitem-chartforgex-core-chartcolorscale-nullable-chartforgex-core-chartseriesid) parameter `definition`
- Method [Chart.AddRegionMap](/api/chartforgex-core-chart/#method-addregionmap-string-chartforgex-core-chartmapdefinition-collections-generic-ienumerable-chartforgex-core-chartregionmapitem-nullable-chartforgex-primitives-chartcolor-nullable-chartforgex-core-chartseriesid) parameter `definition`
- Method [ChartMapCatalog.TryGet](/api/chartforgex-core-chartmapcatalog/#method-tryget-string-chartforgex-core-chartmapdefinition) parameter `definition`
- Constructor [ChartMapLayer.ChartMapLayer](/api/chartforgex-core-chartmaplayer/#constructor-ctor-chartforgex-core-chartmapdefinition-nullable-chartforgex-primitives-chartcolor-nullable-chartforgex-primitives-chartcolor-double-string) parameter `definition`
- Method [ChartSeries.CreateRegionMap](/api/chartforgex-core-chartseries/#method-createregionmap-chartforgex-core-chartseriesid-string-chartforgex-core-chartmapdefinition-collections-generic-ienumerable-chartforgex-core-chartregionmapitem-nullable-chartforgex-primitives-chartcolor) parameter `definition`

 Filter members   

    Show inherited   

 

## Constructors

 ChartMapDefinition 2 overloads 

 `public ChartMapDefinition(string id, string name, double width, double height, IEnumerable<ChartMapRegion> regions)` [#](#constructor-ctor-string-string-double-double-collections-generic-ienumerable-chartforgex-core-chartmapregion) 

[ChartMapDefinition.cs:53](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/ChartMapDefinition.cs#L53)

Initializes a new instance of the [ChartMapDefinition](/api/chartforgex-core-chartmapdefinition/) class with bounds starting at zero.

Parameters

**id string required**

The stable map identifier.

**name string required**

The display name.

**width double required**

The map coordinate width.

**height double required**

The map coordinate height.

**regions System.Collections.Generic.IEnumerable<ChartForgeX.Core.ChartMapRegion> required**

The drawable regions.

 `public ChartMapDefinition(string id, string name, ChartRect bounds, IEnumerable<ChartMapRegion> regions)` [#](#constructor-ctor-string-string-chartforgex-primitives-chartrect-collections-generic-ienumerable-chartforgex-core-chartmapregion) 

[ChartMapDefinition.cs:63](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/ChartMapDefinition.cs#L63)

Initializes a new instance of the [ChartMapDefinition](/api/chartforgex-core-chartmapdefinition/) class.

Parameters

**id string required**

The stable map identifier.

**name string required**

The display name.

**bounds ChartForgeX.Primitives.ChartRect required**

The coordinate bounds occupied by the map paths.

**regions System.Collections.Generic.IEnumerable<ChartForgeX.Core.ChartMapRegion> required**

The drawable regions.

## Methods

 `public static ChartMapDefinition FromGeoJson(string id, string name, string geoJson, ChartMapGeoJsonOptions? options = null)` [#](#method-fromgeojson-string-string-string-chartforgex-core-chartmapgeojsonoptions) 

[ChartMapDefinition.cs:100](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/ChartMapDefinition.cs#L100)

Creates a map definition from a GeoJSON FeatureCollection or Feature.

Parameters

**id string required**

The stable map identifier.

**name string required**

The display name.

**geoJson string required**

The GeoJSON document.

**options ChartForgeX.Core.ChartMapGeoJsonOptions? = null optional**

Optional import settings.

Returns

 `ChartMapDefinition` A reusable map definition. 

 `public bool TryResolveRegion(string region, out string code)` [#](#method-tryresolveregion-string-string) 

[ChartMapDefinition.cs:128](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/ChartMapDefinition.cs#L128)

Resolves a caller-provided region code or alias to the canonical region code.

Parameters

**region string required**

The code, name, or alias to resolve.

**code string required**

The canonical region code.

Returns

 `bool` true when the region can be resolved; otherwise false. 

 `public ChartMapDefinition WithGeographicProjection(ChartMapGeoJsonProjection projection)` [#](#method-withgeographicprojection-chartforgex-core-chartmapgeojsonprojection) 

[ChartMapDefinition.cs:106](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/ChartMapDefinition.cs#L106)

Returns an independent definition declaring the geographic projection already used by its paths.

Parameters

**projection ChartForgeX.Core.ChartMapGeoJsonProjection required**

The transform already applied to longitude/latitude positions. This declaration does not transform existing paths.

Returns

 `ChartMapDefinition` A new immutable definition suitable for composition with geographic points, routes and equally projected geometry. 

 `public ChartMapDefinition WithPolygonViewport(ChartMapViewport viewport)` [#](#method-withpolygonviewport-chartforgex-core-chartmapviewport) 

[ChartMapDefinition.cs:116](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/ChartMapDefinition.cs#L116)

Returns a detached declaration of the antimeridian window already used to prepare the paths.

Parameters

**viewport ChartForgeX.Core.ChartMapViewport required**

A seam-crossing window matching the declared projection.

Returns

 `ChartMapDefinition` An independent definition. This method declares existing source geometry; it does not transform or clip paths. 

## Inherited Methods

 `public virtual bool Equals(object? obj)` [#](#method-equals-object) 

Inherited from object

Parameters

**obj object? required**

Returns

 `bool` 

 `public virtual int GetHashCode()` [#](#method-gethashcode) 

Inherited from object

Returns

 `int` 

 `public Type GetType()` [#](#method-gettype) 

Inherited from object

Returns

 `Type` 

 `public virtual string? ToString()` [#](#method-tostring) 

Inherited from object

Returns

 `string?` 

## Properties

 `public string Id { get; }` [#](#property-id) 

[ChartMapDefinition.cs:20](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/ChartMapDefinition.cs#L20)

Gets the stable map identifier.

 `public string Name { get; }` [#](#property-name) 

[ChartMapDefinition.cs:25](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/ChartMapDefinition.cs#L25)

Gets the display name of the map.

 `public ChartRect Bounds { get; }` [#](#property-bounds) 

[ChartMapDefinition.cs:30](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/ChartMapDefinition.cs#L30)

Gets the coordinate bounds occupied by the map paths.

 `public ChartMapGeoJsonProjection? GeographicProjection { get; private set; }` [#](#property-geographicprojection) 

[ChartMapDefinition.cs:33](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/ChartMapDefinition.cs#L33)

Gets the geographic projection already applied to the paths, or null for arbitrary source coordinates.

 `public ChartMapViewport? PolygonViewport { get; private set; }` [#](#property-polygonviewport) 

[ChartMapDefinition.cs:37](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/ChartMapDefinition.cs#L37)

Gets the explicit antimeridian source-window declaration of already unwrapped polygon paths, or null for ordinary geometry.

 `public IReadOnlyList<ChartMapRegion> Regions { get; }` [#](#property-regions) 

[ChartMapDefinition.cs:42](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/ChartMapDefinition.cs#L42)

Gets the drawable regions.

<!-- PowerForge markdown artifact sha256:85D590D81D75496156C733C0E3E4D951D2AB7A14EA0A9A8B396B5CCCA28C03A9 -->
