Online Maps v3
Loading...
Searching...
No Matches
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.
 
void Block (object blocker)
 Blocks the tile from disposing.
 
void Dispose ()
 Dispose of tile.
 
Rect GetRect ()
 Gets rect of the tile.
 
bool InScreen (OnlineMapsVector2d tl, OnlineMapsVector2d br)
 Checks whether the tile at the specified coordinates.
 
void LoadFromWWW (OnlineMapsWWW www)
 Load a tile from a WWW object.
 
void MarkError ()
 Mark that the tile has an error.
 
void MarkLoaded ()
 Marks the tile loaded.
 
void SetParent (OnlineMapsTile tile)
 Set parent tile.
 
void Unblock (object blocker)
 Remove an object that prevents the tile from disposing.
 

Public Attributes

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

Static Public Attributes

static Action OnAllTilesLoaded
 The event that occurs when all tiles are loaded.
 
static Func< OnlineMapsTile, string > OnGetResourcesPath
 The event, which allows you to control the path of tile in Resources.
 
static Func< OnlineMapsTile, string > OnGetStreamingAssetsPath
 The event, which allows you to control the path of tile in Streaming Assets.
 
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.
 
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.
 
static Action< OnlineMapsTileOnTileDownloaded
 The event, which occurs after a successful download of the tile.
 
static Action< OnlineMapsTileOnTileError
 The event, which occurs when a download error is occurred.
 
static Action< OnlineMapsTileOnTrafficDownloaded
 The event, which occurs after a successful download of the traffic texture.
 
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.
 
static int countDownloadsAttempts = 3
 Number of attempts to download a tile.
 

Properties

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

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.

◆ 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

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

Property Documentation

◆ this[string key]

object OnlineMapsTile.this[string key]
getset

Gets / sets custom fields value by key.

Parameters
keyCustom field key
Returns
Custom field value