skip to Main Content

Country object fields name of the country.

country.hidden: makes the country invisible on the map.

country.continent: name of the continent to which the country belongs to.

country.fips10_4, iso_a2, iso_a3, iso_n3: standardized codes of the country.

country.regions: list of physical regions. Each region contains a list of frontier points.

country.mainRegionIndex: the index of the biggest region in the regions list.

country.allowShowProvinces: if set to false, province borders won’t be shown when pointer is over the country (requires ShowProvinces = true).

country.localPosition: center of the country on the sphere in local space.

country.centroid: center of the country in lat/lon coordinates (guaranteed to be inside the country polygon).

country.centroidSpherical: center of the country in spherical coordinates (guaranteed to be inside the country polygon).

country.latLonCenter: latitude/longitude of the center of the country.

country.customLabel: overrides the country name with a custom string (just for the label).

country.labelColorOverride: set to true to override the country color just for the label.

country.labelColor: custom color of the country label (needs labelColorOverride = true).

country.labelFontOverride: overrides the default font setting for this country.

country.labelVisible: if country name must be drawn.

country.labelRotation and labelOffset: custom rotation and displacement for this country label.

Country methods and properties

map.countries: return a List<Country> of all countries records.

map.countryHighlighted: returns the Country object for the country under the mouse cursor (or null).

map.countryHighlightedIndex: returns the index of country under the mouse cursor (or null if none).

map.countryRegionHIghlightedIndex: returns the index of the region of currently highlighted country.

map.countryLastClicked: returns the index of last clicked country.

map.countryRegionLastClicked: returns the index of last clicked country region.

map.enableCountryHighlight: set it to true to allow countries to be highlighted when mouse pass over them.

map.fillColor: color for the highlight of countries.

map.showCountryNames: enables/disables country labeling on the map.

map.showOutline: draws a border around countries highlightes or colored.

map.outlineColor: color of the outline.

map.showFrontiers: show/hide country frontiers. Same than inspector property.

map.frontiersDetail: detail level for frontiers. Specify the frontiers catalog to be used.

map.frontiersColor: color for all frontiers.

map.GetCountry(name): given a country name returns the Country object.

map.GetCountry(index): given a country index returns the Country object. Same than map.countries[index].

map.GetCountryIndex(name): returns the index of the country in the collection.

map.GetCountryIndexByFIPS10_4(fips): returns the index of the country in the collection by FIPS code.

map.GetCountryIndexByISO_A2(iso_a2): returns the index of the country in the collection by ISO 2-character code.

map.GetCountryIndexByISO_A3(iso_a3): returns the index of the country in the collection by ISO 3-character code.

map.GetCountryIndexByISO_N3(iso_n3): returns the index of the country in the collection by ISO 3-digit code.

map.GetCountryIndex(localPosition): returns the country that contains a map coordinate.

map.GetCountryNearToPoint(localPosition): returns the country that contains a map coordinate or the country whose center is nearest to the map coordinate.

map.GetCountryUnderSpherePosition(spherePoint, out countryIndex, out countryRegionIndex): returns the index of the country and region located in sphere point provided.

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

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

map.ToggleCountryMainRegionSurface(index, visible, color, Texture2D texture): colorize and apply an optional texture to the main region of a country.

map.ToggleCountryRegionSurface(countryIndex, regionIndex, visible, color): same but only affects one single region of the country (not province/state but geographic region).

map.HideCountrySurface(countryIndex): un-colorize / hide specified country.

map.HideCountryRegionSurface(countryIndex): un-colorize / hide specified region of a country (not province/state but geographic region).

map.HideCountrySurfaces: un-colorize / hide all colorized countries (cancels ToggleCountrySurface).

map.DrawCountryOutline: adds a colored outline to a country.

map.ToggleCountryOutline: toggles on/off country outline or creates the outline if it didn’t exist.

map.CountryNeighbours (int countryIndex): returns a List of Countries which are neighbours of specified country index. Note that a Country can have one or more land regions (separated) which can have different neighbours each. This method returns all neighbours for all land regions of the country.

map.CountryNeighboursOfMainRegion (int countryIndex): returns a list of neighbours of the specified country having into account only the main land region of the country.

map.CountryNeighboursOfCurrentRegion (): returns a list of countries neighbours of currently selected country’s region.

map.GetCountryUnderSpherePosition(spherePoint, out countryIndex, out countryRegionIndex): returns true/false and the index of the country/region of a country under specified sphere position (you can use the calculator component to convert lat/lon to spherePoint).

map.GetCountryRegionSurfaceGameObject(countryIndex, regionIndex): returns the game object corresponding to the colored surface of a given country and region, or null if that country has not been colored yet.

map.GetVisibleCountries: returns a list of visible countries on the screen.

map.CountryTransferCountryRegion: merges one country into another country.

map.CountryTransferProvinceRegion: merges one province into another country.

map.CountryTransferCell: merges one cell into a country.

map.CountrySetProvinces(countryIndex, provinces, mergeRegions, updateCities): updates country frontiers by the result of merging the land regions covered by a list of provinces. The parameter mergeRegions specifies if the resulting region will be one (merge) or many (one per province) and by default is true (merge). The parameter updateCities specifies if the cities should also be linked to the given country (by default is true).

map.CountryAddProvinces: similar to the previous methods but preserves existing country provinces and allows you to pass a list of provinces.

Map.CountryRemoveProvinces: similar to CountrySetProvinces. This method updates the country frontiers by replacing the current provinces of that country by the result of removing a list of given provinces.

map.GetCountryMainRegionZoomExtents: returns the zoom level which makes this country’s main region occupy the entire screen

map.GetCountryRegionZoomExtents: returns the zoom level which makes this country’s region occupy the entire screen.

Back To Top