Mount Points API

advanced scripting

World Map Globe Edition · Scripting Support (C#)

map.mountPoints: return a List<MountPoint> of all mount points records.

map.GetMountPointNearPoint: returns the nearest mount point to a location on the sphere.

map.GetMountPoints: returns a list of mount points, optionally filtered by country, province or region.

map.GetVisibleMountPoints: returns a list of mount points that are “visible” on the screen.

A MountPoint object can be created using the Map Editor or scripting. The MountPoint constructor takes the name, the country and province indices, the local position on the sphere and optionally a type:

WorldMapGlobe map = WorldMapGlobe.instance;
Vector3 position = Conversion.GetSpherePointFromLatLon(40.4f, -3.7f);
MountPoint mp = new MountPoint("Airport", countryIndex, provinceIndex, position, 1);
mp.attrib["Capacity"] = 10;
map.mountPoints.Add(mp);

The MountPoint class contains the following data:

  • name (string): user defined mount point name (optional)

  • type (int): user defined integer that can be used to distinguish mount point types (optional)

  • countryIndex: the country to which the mount point belongs to.

  • provinceIndex: same but with province.

  • localPosition: a Vector3 with the local position of the mount point on the sphere.

  • latlon: a Vector2 that contains the latitude/longitude of the mount point.

  • attrib: a JSONObject used to store any kind of additional data, for example mp.attrib["Mineral"] = "Uranium".

Was this page helpful?