Cities 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.

City Properties

List<City> cities

List of all cities in the globe.

City cityHighlighted { get; }

City currently under the pointer.

int cityHighlightedIndex { get; }

Index of the highlighted city.

int cityLastClicked { get; }

Index of the last clicked city.

bool showCities { get; set; }

Show or hide city markers.

bool enableCityHighlight { get; set; }

Enable highlighting cities on hover.

float citiesSize { get; set; }

City marker size.

Color citiesColor { get; set; }

Default city marker color.

MARKER_TYPE citiesMarkerType { get; set; }

City marker type: circle, projected circle, or quad.

float citiesBrightness { get; set; }

City marker brightness multiplier.

GameObject citySpot { get; set; }

Custom prefab for normal cities.

GameObject citySpotCapitalCountry { get; set; }

Custom prefab for country capitals.

GameObject citySpotCapitalRegion { get; set; }

Custom prefab for region/state capitals.

Query Methods

bool GetCityIndex(Ray ray, out int cityIndex, int countryIndex = -1)

Gets the city hit by a ray. Optionally filter to a specific country.

Navigation

CallbackHandler FlyToCity(int cityIndex)

Navigates to a city using default duration and zoom. Returns a CallbackHandler.

CallbackHandler FlyToCity(int cityIndex, float duration, float zoomLevel)

Navigates to a city with specified duration and zoom.

CallbackHandler FlyToCity(int cityIndex, float duration, float zoomLevel, float bounceIntensity)

Navigates to a city with bounce effect.

CallbackHandler FlyToCity(string cityName)

Navigates to a city by name.

CallbackHandler FlyToCity(string countryName, string cityName)

Navigates to a city, specifying the country for disambiguation.

CallbackHandler FlyToCity(City city)

Navigates to a City object.

Constants

const int CITY_CLASS_FILTER_REGION_CAPITAL_CITY = 2

Filter for region/state capitals.

const int CITY_CLASS_FILTER_COUNTRY_CAPITAL_CITY = 4

Filter for country capitals.

Was this page helpful?