New to Telerik UI for WPFStart a free 30-day trial

Map source which provides tiles for the MultiScaleImage.

Definition

Constructors

Initializes a new instance of the TiledMapSource class.

C#
protected TiledMapSource(int minZoomLevel, int maxZoomLevel, int tileWidth, int tileHeight)
Parameters:minZoomLevelint

Min zoom level.

maxZoomLevelint

Max zoom level.

tileWidthint

Width of the tile.

tileHeightint

Height of the tile.

Fields

OpacityProperty

DependencyProperty

Identifies the Opacity Opacity dependency property.

C#
public static readonly DependencyProperty OpacityProperty

Properties

Gets or sets the CacheStorage property.

C#
public ICacheStorage CacheStorage { get; set; }

Implements: IMapSource.CacheStorage

Gets or sets culture.

C#
public CultureInfo Culture { get; set; }

Implements: IMapSource.Culture

Gets or sets the IsTileCachingEnabled property.

C#
public bool IsTileCachingEnabled { get; set; }

Implements: IMapSource.IsTileCachingEnabled

Gets maximum zoom level.

C#
protected int MaxZoomLevel { get; }

Gets minimal zoom level.

C#
protected int MinZoomLevel { get; }

Gets or sets the opacity factor.

C#
public double Opacity { get; set; }

Implements: IMapSource.Opacity

Gets unique identifier of the map source.

C#
public string UniqueId { get; protected set; }

Implements: IMapSource.UniqueId

Methods

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

C#
public override void CacheTile(int tileLevel, int tilePositionX, int tilePositionY, Uri uri, DateTime expires, byte[] tileBody)
Parameters:tileLevelint

The MSI tile Level.

tilePositionXint

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

tilePositionYint

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

uriUri

Uri.

expiresDateTime

DateTime of expires.

tileBodybyte[]

Tile body.

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

Converts a tile level to a zoom level.

C#
protected virtual int ConvertTileToZoomLevel(int tileLevelDetail)
Parameters:tileLevelDetailint

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

Returns:

int

The zoom level.

Converts a zoom level to a tile level.

C#
protected virtual int ConvertZoomToTileLevel(int zoomLevel)
Parameters:zoomLevelint

The zoom level.

Returns:

int

The tile level.

Gets the image URI.

C#
protected virtual Stream GetCachedTile(int tileLevel, int tilePositionX, int tilePositionY)
Parameters:tileLevelint

Tile level.

tilePositionXint

Tile X.

tilePositionYint

Tile Y.

Returns:

Stream

URI of image.

Requests the cached tile.

C#
protected override void GetCachedTileAsync(int tileLevel, int tilePositionX, int tilePositionY, Action<byte[]> callback)
Parameters:tileLevelint

Level of the tile.

tilePositionXint

X-matrix coordinate of the tile.

tilePositionYint

Y-matrix coordinate of the tile.

callbackAction<byte[]>

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

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

Generates cache tile name.

C#
protected virtual string GetCachedTileName(int tileLevel, int tilePositionX, int tilePositionY)
Parameters:tileLevelint

Tile level.

tilePositionXint

Tile X.

tilePositionYint

Tile Y.

Returns:

string

Cache tile name.

Gets the image URI.

C#
protected virtual Uri GetTile(int tileLevel, int tilePositionX, int tilePositionY)
Parameters:tileLevelint

Tile level.

tilePositionXint

Tile X.

tilePositionYint

Tile Y.

Returns:

Uri

URI of image.

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

C#
protected override void GetTileLayers(int tileLevel, int tilePositionX, int tilePositionY, IList<object> tileImageLayerSources)
Parameters:tileLevelint

The MSI tile Level.

tilePositionXint

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

tilePositionYint

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

tileImageLayerSourcesIList<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 map source.

C#
public virtual void Initialize()

Implements: IMapSource.Initialize()

Invalidate tiles which have not been loaded yet.

C#
protected void InvalidateNullTiles()

Indicates whether specified tile level is supported.

C#
public virtual bool IsLevelSupported(int level)
Parameters:levelint

Tile level.

Returns:

bool

true if tile level is supported. false otherwise.

Implements: IMapSource.IsLevelSupported(int)

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

C#
protected virtual bool IsValidCacheUri(int tileLevel, int tilePositionX, int tilePositionY, Uri uri)
Parameters:tileLevelint

The MSI tile Level.

tilePositionXint

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

tilePositionYint

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

uriUri

Uri.

Returns:

bool

True if the loaded uri is valid.

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

C#
protected virtual bool IsValidTileLevel(int tileLevel)
Parameters:tileLevelint

The proposed level.

Returns:

bool

True if it is valid else false.

Raise InitializeCompleted event.

C#
protected void RaiseInitializationFaulted(string uniqueId, Exception error)
Parameters:uniqueIdstring

Unique identifier of the map source.

errorException

Initialization error.

Raise InitializeCompleted event.

C#
protected void RaiseInitializeCompleted()

Events

Occurs when initialization of the map source is faulted.

C#
public event EventHandler<InitializationFaultEventArgs> InitializationFaulted

Occurs when initialization of the map source is completed.

C#
public event EventHandler InitializeCompleted

Implements: IMapSource.InitializeCompleted