Provinces API

advanced scripting

World Map Globe Edition · Scripting Support (C#)

Class: All members on this page belong to WorldMapGlobe (namespace WPM). Access via WorldMapGlobe.instance.

Province Properties

Province[] provinces

Array of all provinces/states.

Province provinceHighlighted { get; }

Province under the pointer (or null).

int provinceHighlightedIndex { get; }

Index of the highlighted province.

int provinceLastClicked { get; }

Index of the last clicked province.

bool showProvinces { get; set; }

Show or hide province borders.

bool enableProvinceHighlight { get; set; }

Enable province highlighting on hover.

bool drawAllProvinces { get; set; }

Draw all province borders at any zoom level (not just when zoomed in).

Color provinceColor { get; set; }

Province highlight color.

bool enableProvinceEnclaves { get; set; }

Include province enclaves in data.

Query Methods

bool GetProvinceIndex(int countryIndex, Ray ray, out int provinceIndex, out int regionIndex)

Gets the province and region at a ray intersection within a specific country.

bool GetProvinceUnderSpherePosition(int countryIndex, Vector3 spherePoint, out int provinceIndex, out int provinceRegionIndex)

Returns the province at a sphere point within a country.

Manipulation Methods

bool ProvinceAdd(Province province)

Adds a new province.

bool ProvinceRename(int countryIndex, string oldName, string newName)

Renames a province.

bool ProvinceMerge(int provinceIndex, int sourceProvinceIndex, bool redraw)

Merges two provinces into one.

bool ProvincesMerge(List<Province> provinces, bool redraw)

Merges multiple provinces into one.

bool ProvinceTransferCell(int provinceIndex, int cellIndex, bool redraw)

Transfers a hex grid cell to a province.

bool ProvinceTransferProvinceRegion(int provinceIndex, Region sourceProvinceRegion, bool redraw)

Transfers a region from one province to another.

bool CountryAddProvinces(int countryIndex, List<Province> provinces, bool mergeRegions = true)

Adds provinces to a country.

bool CountrySetProvinces(int countryIndex, List<Province> provinces, bool mergeRegions = true)

Replaces all provinces of a country.

bool CountryRemoveProvinces(int countryIndex, List<Province> provinces, bool mergeRegions = true)

Removes provinces from a country.

bool CountryDeleteProvinces(int countryIndex)

Deletes all provinces of a country.

bool DrawProvince(int countryIndex, bool includeNeighbors, bool forceRefresh)

Draws province borders for a specific country.

Surface & Visual Effects

bool ToggleProvinceSurface(int provinceIndex, bool visible, Color color)

Toggles a colored overlay on a province. Also accepts country name + province name.

bool ToggleProvinceSurface(Province province, bool visible, Color color)

Toggles surface using a Province object.

CallbackHandler FlyToProvince(int provinceIndex, float duration, float zoomLevel)

Smoothly navigates to a province. Also accepts a province name. Returns a CallbackHandler for chaining.

CallbackHandler FlyToProvince(int provinceIndex, float duration, float zoomLevel, float bounceIntensity)

Navigates to province with bounce effect.

Was this page helpful?