Tile System API

advanced scripting

World Map Strategy Kit · Scripting Support (C#)

Class: WMSK (namespace WorldMapStrategyKit)

Tiles API

Methods for working with the tile system (online map tile layers).

Properties

bool showTiles { get; set; }

Enable or disable the tile layer.

string tileServer { get; set; }

URL template for the tile server (e.g., OpenStreetMap, Mapbox). Use {x}, {y}, {z} placeholders.

int tileMaxZoomLevel { get; set; }

Maximum zoom level for tile loading (default 15).

int tileMaxConcurrentDownloads { get; set; }

Maximum number of simultaneous tile downloads.

enum OFFLINE_TILES_SOURCE_TYPE

Gets or sets the o f f l i n e_ t i l e s_ s o u r c e_ t y p e.

int tileMaxTileLoadsPerFrame

Gets or sets the maximum number of tile loads per frame.

bool tileTransparentLayer

Blends tiles with background imagery. Disabled for performance purposes (when disabled, tiles will use an opaque shader which renders faster)

float tileMaxAlpha

Gets or sets the tile max alpha (transparency). Reduce to force transparent layers when tiles are opaque.

bool tileEnableLocalCache

Enables or disables local cache for tile storage.

long tileMaxLocalCacheSize

Gets or sets the size of the local cache in Mb.

int tileQueueLength

Gets number of tiles pending load

int tileConcurrentLoads

Gets current active tile downloads

int tileCurrentZoomLevel

Gets current tile zoom level

int tileWebDownloads

Gets number of total tiles downloaded from web

int tileResourceDownloads

Gets number of total tiles downloaded from the application Resources folder

long tileWebDownloadsTotalSize

Gets total size in byte sof tiles downloaded from web

int tileCacheLoads

Gets number of total tiles downloaded from local cache

long tileCacheLoadsTotalSize

Gets total size in byte sof tiles downloaded from local cache

bool tileUseSecureConnection

Use https instead of simple http for secure connection to default servers.

string tileServerCustomUrl

Gets or sets the tile server Url. Only used whtn Tile Server is set to Custom.

float tileResolutionFactor

Gets or sets the tile resolution factor.

string tileServerCopyrightNotice

Returns the credits or copyright message required to be displayed with the active tile server. Returns null if credit not required.

string tileLastError

Returns last logged error

DateTime tileLastErrorDate

Returns last logged error date & time

string tileServerAPIKey

Returns current tile server API key

string tileServerClientId

Returns current tile server client id used by some providers

string tileServerLayerTypes

Returns current tile server layer types used by some providers

string tileServerTimeOffset

Returns current tile server time offset used by some providers

bool tileDebugErrors

Enables/disables error dump to console or log file.

bool tilePreloadTiles

Tries to load all first zoom level of tiles at start so map shows complete from the beginning

long tileCurrentCacheUsage

Returns the current disk usage of the tile cache in bytes.

float tileKeepAlive

Time that an inactive tile remains in memory before being destroyed

bool tileEnableOfflineTiles

Enables or disables loading tiles from application resources.

OFFLINE_TILES_SOURCE_TYPE tileOfflineTilesSourceType

Specifies the type of source for the offline tiles (Resources, File System or Streaming Assets Path)

bool tileOfflineTilesOnly

If enabled, only tiles from Resources path will be loaded

string tileResourcePathBase

Returns path for the application resource path where tiles can be stored using the tile downloader

int tileLinesMaxZoomLevel

Gets or sets the maximum zoom level on which frontiers and other lines can be drawn over the map

Texture2D tileResourceFallbackTexture

Texture for a tile which is not found in Resources path and tileOfflineTilesOnly is enabled

bool tileRestrictToArea

Enables area restriction

Vector4 tileMinMaxLatLon

Minimum / maximum latitude/longitude allowed for fetching tiles. Only applies if tileRestrictToArea is enabled.

Methods

void ReloadTiles()

Reloads the tile layer (useful after changing tile server or zoom level).

void ClearTileCache()

Clears the local tile cache, forcing fresh downloads.

void PurgeTileCache()

PurgeTileCache method.

void FlyToTile(int x, int y, int zoomLevel)

Navigates to a given tile

void FlyToTile(int x, int y, int zoomLevel, float duration)

Navigates to a given tile

Was this page helpful?