Online Maps  v3
OnlineMapsTile Class Referenceabstract

This class of buffer tile image.
Please do not use it if you do not know what you're doing.
Perform all operations with the map through other classes. More...

Inheritance diagram for OnlineMapsTile:
OnlineMapsRasterTile OnlineMapsVectorTile

Public Member Functions

 OnlineMapsTile (int x, int y, int zoom, OnlineMaps map, bool isMapTile=true)
 Constructor More...
 
void Block (object blocker)
 Blocks the tile from disposing. More...
 
void Dispose ()
 Dispose of tile. More...
 
Rect GetRect ()
 Gets rect of the tile. More...
 
bool InScreen (OnlineMapsVector2d tl, OnlineMapsVector2d br)
 Checks whether the tile at the specified coordinates. More...
 
void LoadFromWWW (OnlineMapsWWW www)
 Load a tile from a WWW object More...
 
void MarkError ()
 Mark that the tile has an error More...
 
void MarkLoaded ()
 Marks the tile loaded. More...
 
void SetParent (OnlineMapsTile tile)
 Set parent tile More...
 
void Unblock (object blocker)
 Remove an object that prevents the tile from disposing. More...
 

Public Attributes

Action< OnlineMapsTileOnDisposed
 This event is called when the tile is disposed. More...
 
OnlineMapsVector2d bottomRight
 The coordinates of the bottom-right corner of the tile. More...
 
bool cacheChecked
 This flag indicates whether the cache is checked for a tile. More...
 
bool drawingChanged
 Drawing elements have been changed. Used for drawing as overlay. More...
 
Vector2 globalPosition
 The coordinates of the center point of the tile. More...
 
bool hasColors
 Tile loaded or there are parent tile colors More...
 
bool isMapTile
 Is map tile? More...
 
ulong key
 The unique tile key. More...
 
Texture2D overlayBackTexture
 Texture, which is used in the back overlay. More...
 
float overlayBackAlpha = 1
 Back overlay transparency (0-1). More...
 
Texture2D overlayFrontTexture
 Texture, which is used in the front overlay. More...
 
float overlayFrontAlpha = 1
 Front overlay transparency (0-1). More...
 
OnlineMapsTile parent
 Reference to parent tile. More...
 
OnlineMapsTileStatus status = OnlineMapsTileStatus.none
 Status of tile. More...
 
Texture2D texture
 Texture of tile. More...
 
OnlineMapsVector2d topLeft
 The coordinates of the top-left corner of the tile. More...
 
bool used = true
 Tile used by map More...
 
OnlineMapsWWW www
 Instance of the texture loader. More...
 
readonly int x
 Tile X. More...
 
readonly int y
 Tile Y. More...
 
readonly int zoom
 Tile zoom. More...
 

Static Public Attributes

static Action OnAllTilesLoaded
 The event that occurs when all tiles are loaded. More...
 
static Func< OnlineMapsTile, string > OnGetResourcesPath
 The event, which allows you to control the path of tile in Resources. More...
 
static Func< OnlineMapsTile, string, string > OnReplaceURLToken
 The event which allows to intercept the replacement tokens in the url.
Return the value, or null - if you do not want to modify the value. More...
 
static Func< OnlineMapsTile, string, string > OnReplaceTrafficURLToken
 The event which allows to intercept the replacement tokens in the traffic url.
Return the value, or null - if you do not want to modify the value. More...
 
static Action< OnlineMapsTileOnTileDownloaded
 The event, which occurs after a successful download of the tile. More...
 
static Action< OnlineMapsTileOnTileError
 The event, which occurs when a download error is occurred. More...
 
static Action< OnlineMapsTileOnTrafficDownloaded
 The event, which occurs after a successful download of the traffic texture. More...
 
static float tryAgainAfterSec = 10
 Try again in X seconds if a download error occurred. Use 0 to repeat immediately, or -1 to not repeat at all. More...
 

Properties

object? this[string key] [get, set]
 Gets / sets custom fields value by key More...
 
Dictionary< string, object > customFields [get]
 Gets customFields dictionary More...
 
string resourcesPath [get]
 Path in Resources, from where the tile will be loaded. More...
 
bool isBlocked [get]
 The tile is blocked? More...
 
abstract string url [get]
 URL from which will be downloaded texture. More...
 

Detailed Description

This class of buffer tile image.
Please do not use it if you do not know what you're doing.
Perform all operations with the map through other classes.

Constructor & Destructor Documentation

◆ OnlineMapsTile()

OnlineMapsTile.OnlineMapsTile ( int  x,
int  y,
int  zoom,
OnlineMaps  map,
bool  isMapTile = true 
)

Constructor

Parameters
xTile X
yTile Y
zoomTile zoom
mapReference to the map
isMapTileShould this tile be displayed on the map?

Member Function Documentation

◆ Block()

void OnlineMapsTile.Block ( object  blocker)

Blocks the tile from disposing.

Parameters
blockerThe object that prohibited the disposing.

◆ Dispose()

void OnlineMapsTile.Dispose ( )

Dispose of tile.

◆ GetRect()

Rect OnlineMapsTile.GetRect ( )

Gets rect of the tile.

Returns
Rect of the tile.

◆ InScreen()

bool OnlineMapsTile.InScreen ( OnlineMapsVector2d  tl,
OnlineMapsVector2d  br 
)

Checks whether the tile at the specified coordinates.

Parameters
tlCoordinates of top-left corner.
brCoordinates of bottom-right corner.
Returns
True - if the tile at the specified coordinates, False - if not.

◆ LoadFromWWW()

void OnlineMapsTile.LoadFromWWW ( OnlineMapsWWW  www)

Load a tile from a WWW object

Parameters
wwwWWW object

◆ MarkError()

void OnlineMapsTile.MarkError ( )

Mark that the tile has an error

◆ MarkLoaded()

void OnlineMapsTile.MarkLoaded ( )

Marks the tile loaded.

◆ SetParent()

void OnlineMapsTile.SetParent ( OnlineMapsTile  tile)

Set parent tile

Parameters
tile

◆ Unblock()

void OnlineMapsTile.Unblock ( object  blocker)

Remove an object that prevents the tile from disposing.

Parameters
blockerThe object that prohibited the disposing.

Member Data Documentation

◆ bottomRight

OnlineMapsVector2d OnlineMapsTile.bottomRight

The coordinates of the bottom-right corner of the tile.

◆ cacheChecked

bool OnlineMapsTile.cacheChecked

This flag indicates whether the cache is checked for a tile.

◆ drawingChanged

bool OnlineMapsTile.drawingChanged

Drawing elements have been changed. Used for drawing as overlay.

◆ globalPosition

Vector2 OnlineMapsTile.globalPosition

The coordinates of the center point of the tile.

◆ hasColors

bool OnlineMapsTile.hasColors

Tile loaded or there are parent tile colors

◆ isMapTile

bool OnlineMapsTile.isMapTile

Is map tile?

◆ key

ulong OnlineMapsTile.key

The unique tile key.

◆ OnAllTilesLoaded

Action OnlineMapsTile.OnAllTilesLoaded
static

The event that occurs when all tiles are loaded.

◆ OnDisposed

Action<OnlineMapsTile> OnlineMapsTile.OnDisposed

This event is called when the tile is disposed.

◆ OnGetResourcesPath

Func<OnlineMapsTile, string> OnlineMapsTile.OnGetResourcesPath
static

The event, which allows you to control the path of tile in Resources.

◆ OnReplaceTrafficURLToken

Func<OnlineMapsTile, string, string> OnlineMapsTile.OnReplaceTrafficURLToken
static

The event which allows to intercept the replacement tokens in the traffic url.
Return the value, or null - if you do not want to modify the value.

◆ OnReplaceURLToken

Func<OnlineMapsTile, string, string> OnlineMapsTile.OnReplaceURLToken
static

The event which allows to intercept the replacement tokens in the url.
Return the value, or null - if you do not want to modify the value.

◆ OnTileDownloaded

Action<OnlineMapsTile> OnlineMapsTile.OnTileDownloaded
static

The event, which occurs after a successful download of the tile.

◆ OnTileError

Action<OnlineMapsTile> OnlineMapsTile.OnTileError
static

The event, which occurs when a download error is occurred.

◆ OnTrafficDownloaded

Action<OnlineMapsTile> OnlineMapsTile.OnTrafficDownloaded
static

The event, which occurs after a successful download of the traffic texture.

◆ overlayBackAlpha

float OnlineMapsTile.overlayBackAlpha = 1

Back overlay transparency (0-1).

◆ overlayBackTexture

Texture2D OnlineMapsTile.overlayBackTexture

Texture, which is used in the back overlay.

◆ overlayFrontAlpha

float OnlineMapsTile.overlayFrontAlpha = 1

Front overlay transparency (0-1).

◆ overlayFrontTexture

Texture2D OnlineMapsTile.overlayFrontTexture

Texture, which is used in the front overlay.

◆ parent

OnlineMapsTile OnlineMapsTile.parent

Reference to parent tile.

◆ status

OnlineMapsTileStatus OnlineMapsTile.status = OnlineMapsTileStatus.none

Status of tile.

◆ texture

Texture2D OnlineMapsTile.texture

Texture of tile.

◆ topLeft

OnlineMapsVector2d OnlineMapsTile.topLeft

The coordinates of the top-left corner of the tile.

◆ tryAgainAfterSec

float OnlineMapsTile.tryAgainAfterSec = 10
static

Try again in X seconds if a download error occurred. Use 0 to repeat immediately, or -1 to not repeat at all.

◆ used

bool OnlineMapsTile.used = true

Tile used by map

◆ www

OnlineMapsWWW OnlineMapsTile.www

Instance of the texture loader.

◆ x

readonly int OnlineMapsTile.x

Tile X.

◆ y

readonly int OnlineMapsTile.y

Tile Y.

◆ zoom

readonly int OnlineMapsTile.zoom

Tile zoom.

Property Documentation

◆ customFields

Dictionary<string, object> OnlineMapsTile.customFields
get

Gets customFields dictionary

◆ isBlocked

bool OnlineMapsTile.isBlocked
get

The tile is blocked?

◆ resourcesPath

string OnlineMapsTile.resourcesPath
get

Path in Resources, from where the tile will be loaded.

◆ this[string key]

object? OnlineMapsTile.this[string key]
getset

Gets / sets custom fields value by key

Parameters
keyCustom field key
Returns
Custom field value

◆ url

abstract string OnlineMapsTile.url
get

URL from which will be downloaded texture.