skip to Main Content

Regions and Provinces Related

Region related (common to countries and provinces)

map.GetRegionSurfaceGameObject(region): returns the cached surface of the colored region, either it belongs to a country or a province (if not colored, this function will return null).

map.GetRegionColor(region): returns the current color of a region or transparent if not colored ( transparent = Color(0,0,0,0) ).

map.GetRegionOverlap(region, includeProvinces): returns a list of overlapping regions with a given region optionally including provinces regions.

map.RegionErase (region, eraseColor): erases/paints the texture portion occupied by the region with a given color.

map.RegionSetCustomElevation (List<region>, elevation): sets a custom elevation for the given regions. Works only with viewport mode.

map.RegionRemoveCustomElevation (List<region>, elevation): clears any previous custom elevation for the given regions. Works only with viewport mode.

map.RegionRemoveAllCustomElevation (): removes any custom elevation assigned to any region. Works only with viewport mode.

map.RegionGenerateExtrudeGameObject (name, region, amount, …): creates a new extruded region and position it on top of original region.

Province related

map.provinces: return a List<Province> of all provinces/states records.

map.provinceHighlighted: returns the province/state object in the provinces list under the mouse cursor (or null if none).

map.provinceHighlightedIndex: returns the province/state index in the provinces list under the mouse cursor (or null if none).

map.provinceRegionHighlighted: returns the highlighted region of the province/state (or null).

map.provinceRegionHighlightedIndex: returns the index of the region highlighted for the regions field of province object).

map.provinceLastClicked: returns the last province clicked by the user.

map.provinceRegionLastClicked: returns the last province’s region clicked by the user.

map.provinceRegionHighlightedShape: returns the shape (gameobject) of the currently highlighted region.

map.showProvinces: show/hide provinces when mouse enters a country. Same than inspector property.

map.provincesFillColor: color for the highlight of provinces.

map.enableProvinceHighlight: whether provinces will be highlighted when the pointer pass over them.

map.highlightAllProvinceRegions: whether all regions of active province should be highlighted or just the one under the pointer (some provinces can have more than one land region).

map.provincesColor: color for provinces/states color.

map.GetProvinceIndex(name): returns the index of the province in the array. Please note that there some provinces with same name. You may want to use GetProvinceIndex(country, name) instead.

map.GetProvinceIndex(country, name): returns the index of the province inside the province array of the country object.

map.GetProvinceIndex (Vector2 localPosition): returns de province index that contains given local position.

map.GetProvince(index): returns the province object by its index. Equals to map.provinces[index].

map.GetProvince(provinceName, countryName): returns the province object by its name for the country given or null if not found.

map.GetProvinceCenter(int provinceIndex): returns the geographic center of all province regions.

map.GetProvinceCentroid(int provinceIndex): returns the geographic center of the biggest region of the province (this will always fall inside the polygon).

map.GetProvinceNames(groupByCountry): returns an array with the province names, optionally grouped by country.

map.GetVisibleProvinces (): returns a list of provinces that are visible on the screen.

map.GetVisibleProvincesInWindowRect (): returns a list of provinces that are inside the window rectangle (optional rect constraint set in the inspector or using windowRect).

map.RenameProvince(oldName, newName): allows to change the province’s name. Use this method instead of changing the name field of the province object.

map.DrawProvinces(name, includeNeighbours, forceRefresh): draws borders for the province specified. Optionally can add the neighbouts province’s borders. ForceRefresh is used internally – usually pass false.

map.HideProvinces(): hides the provinces borders.

map.BlinkProvince(province, color1, color2, duration, speed): makes the province specified toggle between color1 and color2 for duration in seconds and at speed rate.

map.FlyToProvince(name): start navigation at navigationTime speed to specified province. The list of provinces names can be obtained through the provinces property.

map.FlyToProvince (index): same but specifying the province index in the provinces list.

map.ToggleProvinceSurface(name, visible, color): colorize one province with color provided or hide its surface (if visible = false).

map.ToggleProvinceSurface(index, visible, color): same but passing the index of the country instead of the name.

map.HideProvinceSurface(countryIndex): un-colorize / hide specified province.

map.HideProvinceSurfaces: un-colorize / hide all colorized provinces (cancels ToggleProvinceSurface).

map.ProvinceCreate(name, countryIndex): created a new province for a given country. Name must be unique!

map.ProvinceAdd(province): adds a new province object created with “New Province(…)” instead of Country Create.

map.ProvinceRename(country, oldName, newName): renames an existing province.

map.ProvinceNeighbours(provinceIndex): returns the list of province neighbours.

map.ProvinceNeighboursOfMainRegion(provinceIndex): same but taking into account only the main region of the province (just in case the province could have more than one land region).

map.GetProvinceRegionSurfaceGameObject(provinceIndex, regionIndex): returns the cached surface of the colored province (if not colored, this function will return null).

map.ProvinceNeighboursOfCurrentRegion(): same but taking into account the currently highlighted province.

map.ProvinceToCountry(province, newCountryName): creates a new country based on an existing province. The province is extracted from the original country.

map.ProvinceTransferProvinceRegion (provinceIndex, provinceRegion, redraw): province region is absorbed by the given province. Redraw parameter optionally redraws frontiers to reflect the new country perimeters.

map.ProvinceTransferCell (provinceIndex, cellIndex, redraw): cell is absorbed by the given province. Redraw parameter optionally redraws frontiers to reflect the new province perimeters.

map.ProvinceRemoveCell (provinceIndex, cellIndex, redraw): cell is removed from target province. Redraw parameter optionally redraws frontiers to reflect the new province perimeter.

map.ProvinceDelete (provinceIndex): remove specified province.

map.provinceAttributeFile: name of the resource jSON file storing attributes for countries.

map.GetProvinceGeoData(): returns a string with all provinces frontiers and data.

map.SetProvinceGeoData(): loads provinces frontiers and data from a string.

map.GetProvincesAttributes(prettyPrint): returns a JSON-formatted string with all attributes

for all provinces.

map.GetProvincesAttributes(countries, prettyPrint): same but for a list of provinces.

map.SetProvincesAttributes(jSON): sets the attributes of a list of provinces contained in the JSON-formatted string.

map.GetProvinceCoastalPoints(provinceIndex): returns a list of map position where the coast of a province is.

map.GetProvinceBorderPoints(provinceIndex, regionIndex, worldSpace): returns a list of points of the given province region. Optionally in world space.

map.GetProvinceBorderPoints(provinceIndex1, provinceindex2): returns a list of map position where two given provinces share borders.

map.GetProvinceZoomExtents(index): gets the required zoom level to show a custom province within screen borders (including all its regions! If some regions are far away, it might not zoom properly since entire or large part of the world must be visible!).

map.GetProvinceRegionZoomExtents(index): gets the required zoom level to show a custom province within screen borders.

map.GetRegionSurfaceGameObject(Region region): returns the cached surface of the colored region, either it belongs to a country or a province (if not colored, this function will return null).

map.GetRegionSurfaceColor(Region region): returns the current color of a region or transparent if not colored ( transparent = Color(0,0,0,0) ).

Back To Top