Earth & Map API
advanced scriptingWorld Map Strategy Kit · Scripting Support (C#)
WMSK (namespace WorldMapStrategyKit)
Earth API
Methods for earth/map manipulation and coordinate conversion.
Properties
enum EARTH_STYLEGets or sets the e a r t h_ s t y l e.
class EarthStyleExtensionsGets or sets the earth style extensions.
bool showEarthToggle Earth visibility.
EARTH_STYLE earthStyleEarth map style.
bool blurOnZoomGets or sets the blur on zoom.
Color earthColorColor for Earth (for SolidColor style)
bool earthBumpEnabledGets or sets the earth bump enabled.
float earthBumpAmountGets or sets the earth bump amount.
Texture2D earthBumpMapTextureGets or sets the earth bump map texture.
Texture2D earthTextureTexture for Earth background
Vector2 earthTextureScaleEarth texture scale
Vector2 earthTextureOffsetEarth texture offset
Material earthMaterialGets the currently active Earth material.
bool showWaterGets or sets the show water.
Texture2D scenicWaterMaskTexture of the water mask for path finding purposes.
Color waterColorDefines the base water color used in Scenic Plus style.
float waterLevelWater level for the Scenic Plus styles.
float waterFoamThresholdFoam threshold (amount) for the Scenic Plus styles.
float waterFoamIntensityFoam intensity effect..
Coordinate Conversion
Vector2 LatLonToMap(float latitude, float longitude)Converts geographic coordinates (latitude, longitude) to 2D map coordinates.
Vector2 Map2DToLatLon(Vector2 mapPosition)Converts 2D map coordinates to geographic coordinates (returns x=latitude, y=longitude).
Vector3 LatLonToSpherePoint(float latitude, float longitude)Converts latitude/longitude to a 3D point on the sphere surface (for 3D globe mode).
Distance & Bearing
float GetDistance(Vector2 mapPos1, Vector2 mapPos2)Returns the distance between two map positions (in map units).
float GetDistanceInKm(float lat1, float lon1, float lat2, float lon2)Returns the great-circle distance between two geographic coordinates in kilometers.
float GetBearing(Vector2 mapPos1, Vector2 mapPos2)Returns the bearing (direction) from one map position to another in degrees (0-360).
Map Properties
Vector2 earthInvertedMode { get; set; }Flips the map horizontally and/or vertically.
bool wrapHorizontally { get; set; }Enables horizontal wrapping (allows infinite scrolling left/right).
Cursor & Position
Vector2 cursorLocation { get; }The current cursor position in 2D map coordinates.
Vector2 cursorLatLon { get; }The current cursor position as geographic coordinates (x=latitude, y=longitude).
bool GetMouseMapPosition(out Vector2 mapPosition)Returns the map position under the mouse cursor. Returns false if the mouse is not over the map.
Additional Methods
bool isScenicPlus(this EARTH_STYLE earthStyle)isScenicPlus method.
int numTextures(this EARTH_STYLE earthStyle)numTextures method.
bool supportsBumpMap(this EARTH_STYLE earthStyle)supportsBumpMap method.
void ResetEarthStyle()Reloads Earth style and clears any customization
void SetEarthTexture(Texture2D texture)Texture for Earth background. This method ensures the texture is reassigned even if it's the same texture.
void SetEarthWaterMask(Texture2D texture)Sets the texture of the water mask.
bool ContainsWater(Vector2 position)Returns true if specified position is on water.
bool ContainsWater(Vector2 position, float boxSize, out Vector2 waterPosition)Returns true if specified area with center at "position" contains water. Box size. Exact position where water was found.
float GetAltitude(Vector2 position)Returns the heightmap value at a given position
Suggest an improvement
Help us improve this documentation page.