TileSource Class
Retrieves the URI for a tile based on its zoom level and tile position.
Namespace: Microsoft.Maps.MapControl.WPF
Assembly: Microsoft.Maps.MapControl.WPF (in Microsoft.Maps.MapControl.WPF.dll)
Inheritance Hierarchy
System.Object
Microsoft.Maps.MapControl.WPF.TileSource
Syntax
public class TileSource : INotifyPropertyChanged
public ref class TileSource : INotifyPropertyChanged
type TileSource =
class
interface INotifyPropertyChanged
end
Public Class TileSource
Implements INotifyPropertyChanged
Constructors
Name | Description | |
---|---|---|
TileSource() | Initializes a new instance of the TileSource class. |
|
TileSource(String) | Initializes a new instance of the TileSource class. |
Properties
Name | Description | |
---|---|---|
UriFormat | Gets or sets the format used to create the URI. |
|
Visibility | Gets or sets the visibility of the tile. |
Methods
Name | Description | |
---|---|---|
Equals(Object) | (Inherited from Object.) |
|
Finalize() | (Inherited from Object.) |
|
GetHashCode() | (Inherited from Object.) |
|
GetSubdomain(QuadKey) | Retrieves the sub-domain for the tile identified by the specified quad key. |
|
GetType() | (Inherited from Object.) |
|
GetUri(Int32, Int32, Int32) | Retrieves the URI for the tile specified by the given x, y coordinates and zoom level. |
|
MemberwiseClone() | (Inherited from Object.) |
|
OnPropertyChanged(String) | Enables the ability to provide custom handling when a property of the tile source changes. |
|
SetSubdomains(String[][]) | Sets a matrix that represents sub-domains. |
|
ToString() | (Inherited from Object.) |
Fields
Name | Description | |
---|---|---|
QuadKeyUriFragment | Specifies the piece of the URI that is the quad key. |
|
SubdomainUriFragment | Specifies the piece of the URI that is the sub-domain. |
|
UriSchemeUriFragment | Specifies the pieces of the URI that specify the URI scheme. |
Events
Name | Description | |
---|---|---|
PropertyChanged | Occurs when a property of the tile source changes. |
Examples
This sample code uses the TileSource class to create a map tile layer and adds the map layer to the map. For more information and the complete sample, see Adding Tile Overlays to the Map.
private void AddTileOverlay()
{
// Create a new map layer to add the tile overlay to.
tileLayer = new MapTileLayer();
// The source of the overlay.
TileSource tileSource = new TileSource();
tileSource.UriFormat = "{UriScheme}://ecn.t0.tiles.virtualearth.net/tiles/r{quadkey}.jpeg?g=129&mkt=en-us&shading=hill&stl=H";
// Add the tile overlay to the map layer
tileLayer.TileSource=tileSource;
// Add the map layer to the map
if (!MapTileOverlay.Children.Contains(tileLayer))
{
MapTileOverlay.Children.Add(tileLayer);
}
tileLayer.Opacity = tileOpacity;
}
Private Sub AddTileOverlay()
' Creates a new map layer to add the tile overlay to.
tileLayer = New MapTileLayer()
' The source of the overlay.
Dim tileSource As New TileSource()
tileSource.UriFormat = "{UriScheme}://ecn.t0.tiles.virtualearth.net/tiles/r{quadkey}.jpeg?g=129&mkt=en-us&shading=hill&stl=H"
' Adds the tile overlay to the map layer
tileLayer.TileSource = tileSource
' Adds the map layer to the map
If Not MapTileOverlay.Children.Contains(tileLayer) Then
MapTileOverlay.Children.Add(tileLayer)
End If
tileLayer.Opacity = tileOpacity
End Sub
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also
Microsoft.Maps.MapControl.WPF Namespace
Return to top