Class
TiledMapSource

Map source which provides tiles for the MultiScaleImage.

Definition

Constructors

TiledMapSource(int, int, int, int)

Initializes a new instance of the TiledMapSource class.

Declaration

cs-api-definition
[SuppressMessage("Microsoft.Usage", "CA2233:OperationsShouldNotOverflow", MessageId = "maxZoomLevel+1")]
protected TiledMapSource(int minZoomLevel, int maxZoomLevel, int tileWidth, int tileHeight)

Parameters

minZoomLevel

int

Min zoom level.

maxZoomLevel

int

Max zoom level.

tileWidth

int

Width of the tile.

tileHeight

int

Height of the tile.

Fields

OpacityProperty

Identifies the Opacity Opacity dependency property.

Declaration

cs-api-definition
public static readonly DependencyProperty OpacityProperty

Field Value

DependencyProperty

Properties

CacheStorage

Gets or sets the CacheStorage property.

Declaration

cs-api-definition
public ICacheStorage CacheStorage { get; set; }

Property Value

ICacheStorage

Implements IMapSource.CacheStorage

Culture

Gets or sets culture.

Declaration

cs-api-definition
public CultureInfo Culture { get; set; }

Property Value

CultureInfo

Implements IMapSource.Culture

IsTileCachingEnabled

Gets or sets the IsTileCachingEnabled property.

Declaration

cs-api-definition
public bool IsTileCachingEnabled { get; set; }

Property Value

bool

Implements IMapSource.IsTileCachingEnabled

MaxZoomLevel

Gets maximum zoom level.

Declaration

cs-api-definition
protected int MaxZoomLevel { get; }

Property Value

int

MinZoomLevel

Gets minimal zoom level.

Declaration

cs-api-definition
protected int MinZoomLevel { get; }

Property Value

int

Opacity

Gets or sets the opacity factor.

Declaration

cs-api-definition
public double Opacity { get; set; }

Property Value

double

Implements IMapSource.Opacity

UniqueId

Gets unique identifier of the map source.

Declaration

cs-api-definition
public string UniqueId { get; protected set; }

Property Value

string

Implements IMapSource.UniqueId

Methods

CacheTile(int, int, int, Uri, DateTime, byte[])

The MultiScaleImage control calls this method to possible caching tiles by provider.

Declaration

cs-api-definition
public override void CacheTile(int tileLevel, int tilePositionX, int tilePositionY, Uri uri, DateTime expires, byte[] tileBody)

Parameters

tileLevel

int

The MSI tile Level.

tilePositionX

int

The number of tiles from the left (0 based) for this tile level.

tilePositionY

int

The number of tiles from the top (0 based) for this tile level.

uri

Uri

Uri.

expires

DateTime

DateTime of expires.

tileBody

byte[]

Tile body.

Overrides MultiScaleTileSource.CacheTile(int, int, int, Uri, DateTime, byte[])

ConvertTileToZoomLevel(int)

Converts a tile level to a zoom level.

Declaration

cs-api-definition
protected virtual int ConvertTileToZoomLevel(int tileLevelDetail)

Parameters

tileLevelDetail

int

The tile level (2^n = pixel width).

Returns

int

The zoom level.

ConvertZoomToTileLevel(int)

Converts a zoom level to a tile level.

Declaration

cs-api-definition
protected virtual int ConvertZoomToTileLevel(int zoomLevel)

Parameters

zoomLevel

int

The zoom level.

Returns

int

The tile level.

GetCachedTile(int, int, int)

Gets the image URI.

Declaration

cs-api-definition
protected virtual Stream GetCachedTile(int tileLevel, int tilePositionX, int tilePositionY)

Parameters

tileLevel

int

Tile level.

tilePositionX

int

Tile X.

tilePositionY

int

Tile Y.

Returns

Stream

URI of image.

GetCachedTileAsync(int, int, int, Action<byte[]>)

Requests the cached tile.

Declaration

cs-api-definition
protected override void GetCachedTileAsync(int tileLevel, int tilePositionX, int tilePositionY, Action<byte[]> callback)

Parameters

tileLevel

int

Level of the tile.

tilePositionX

int

X-matrix coordinate of the tile.

tilePositionY

int

Y-matrix coordinate of the tile.

callback

Action<byte[]>

Callback which should be called to return tile if it is available or null.

Overrides MultiScaleTileSource.GetCachedTileAsync(int, int, int, Action<byte[]>)

GetCachedTileName(int, int, int)

Generates cache tile name.

Declaration

cs-api-definition
protected virtual string GetCachedTileName(int tileLevel, int tilePositionX, int tilePositionY)

Parameters

tileLevel

int

Tile level.

tilePositionX

int

Tile X.

tilePositionY

int

Tile Y.

Returns

string

Cache tile name.

GetTile(int, int, int)

Gets the image URI.

Declaration

cs-api-definition
protected virtual Uri GetTile(int tileLevel, int tilePositionX, int tilePositionY)

Parameters

tileLevel

int

Tile level.

tilePositionX

int

Tile X.

tilePositionY

int

Tile Y.

Returns

Uri

URI of image.

GetTileLayers(int, int, int, IList<object>)

The MultiScaleImage control calls this method to get the URI's for the base layer and all Overlays.

Declaration

cs-api-definition
protected override void GetTileLayers(int tileLevel, int tilePositionX, int tilePositionY, IList<object> tileImageLayerSources)

Parameters

tileLevel

int

The MSI tile Level.

tilePositionX

int

The number of tiles from the left (zero based) for this tile level.

tilePositionY

int

The number of tiles from the top (zero based) for this tile level.

tileImageLayerSources

IList<object>

A reference to the object to add the layer and Overlay's URI's too.

Overrides MultiScaleTileSource.GetTileLayers(int, int, int, IList<object>)

Initialize()

Initialize map source.

Declaration

cs-api-definition
public virtual void Initialize()

Implements IMapSource.Initialize()

InvalidateNullTiles()

Invalidate tiles which have not been loaded yet.

Declaration

cs-api-definition
protected void InvalidateNullTiles()

IsLevelSupported(int)

Indicates whether specified tile level is supported.

Declaration

cs-api-definition
public virtual bool IsLevelSupported(int level)

Parameters

level

int

Tile level.

Returns

bool

true if tile level is supported. false otherwise.

Implements IMapSource.IsLevelSupported(int)

IsValidCacheUri(int, int, int, Uri)

Validates loaded uri to tile position. Should be overridden if the provider loads the same tile from different http addresses.

Declaration

cs-api-definition
protected virtual bool IsValidCacheUri(int tileLevel, int tilePositionX, int tilePositionY, Uri uri)

Parameters

tileLevel

int

The MSI tile Level.

tilePositionX

int

The number of tiles from the left (0 based) for this tile level.

tilePositionY

int

The number of tiles from the top (0 based) for this tile level.

uri

Uri

Uri.

Returns

bool

True if the loaded uri is valid.

IsValidTileLevel(int)

Does the supplied tile Level fall within the range of valid levels.

Declaration

cs-api-definition
protected virtual bool IsValidTileLevel(int tileLevel)

Parameters

tileLevel

int

The proposed level.

Returns

bool

True if it is valid else false.

RaiseInitializationFaulted(string, Exception)

Raise InitializeCompleted event.

Declaration

cs-api-definition
protected void RaiseInitializationFaulted(string uniqueId, Exception error)

Parameters

uniqueId

string

Unique identifier of the map source.

error

Exception

Initialization error.

RaiseInitializeCompleted()

Raise InitializeCompleted event.

Declaration

cs-api-definition
protected void RaiseInitializeCompleted()

Events

InitializationFaulted

Occurs when initialization of the map source is faulted.

Declaration

cs-api-definition
public event EventHandler<InitializationFaultEventArgs> InitializationFaulted

Event Value

EventHandler<InitializationFaultEventArgs>

InitializeCompleted

Occurs when initialization of the map source is completed.

Declaration

cs-api-definition
public event EventHandler InitializeCompleted

Event Value

EventHandler

Implements IMapSource.InitializeCompleted