Share via


MapTileSource Class

Definition

Represents a source of tiles to overlay on the MapControl.

/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class MapTileSource : DependencyObject
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public class MapTileSource : DependencyObject
Public Class MapTileSource
Inherits DependencyObject
Inheritance
Object IInspectable DependencyObject MapTileSource
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Examples

This example overlays tiles from a fictitious web service on the map.

// Create the bounding box in which the tiles are displayed.
// This example represents North America.
var northWestCorner =
               new BasicGeoposition() { Latitude = 48.38544, Longitude = -124.667360 };
var southEastCorner =
               new BasicGeoposition() { Latitude = 25.26954, Longitude = -80.30182 };
var boundingBox = new GeoboundingBox(northWestCorner, southEastCorner);

// Create an HTTP data source.
// This example retrieves tiles from a fictitious web service.
var myHttpDataSource = new HttpMapTileDataSource(
    "http://www.<web service name>.com/z={zoomlevel}&x={x}&y={y}");

// Create a tile source and add it to the Map control.
var myTileSource = new MapTileSource(myHttpDataSource);
myTileSource.Bounds = boundingBox;

myMap.TileSources.Add(myTileSource);

This other example animates tiles from a fictitious web service on the map. The code creates a MapTileSource with the AutoPlay property explicitly set to true.

// Create an HTTP data source.
// This example retrieves tiles from a fictitious web service.
var myHttpDataSource = new HttpMapTileDataSource(
    "http://www.<web service name>.com/{x}/{y}/{zoomlevel}/{frame}.png");

// Create a tile source and add it to the Map control.
var myTileSource = new MapTileSource(myHttpDataSource);
myTileSource.AutoPlay = true;
myTileSource.FrameCount = 8;
myTileSource.FrameDuration = TimeSpan.FromSeconds(1);

myMap.TileSources.Add(myTileSource);

Remarks

Tiles can also be animated on the MapControl using a MapTileSource.

Version history

Windows version SDK version Value added
1809 17763 AnimationState
1809 17763 AutoPlay
1809 17763 FrameCount
1809 17763 FrameDuration
1809 17763 Pause
1809 17763 Play
1809 17763 Stop

Constructors

MapTileSource()

Initializes a new instance of the MapTileSource class.

MapTileSource(MapTileDataSource, MapZoomLevelRange, GeoboundingBox, Int32)

Initializes a new instance of the MapTileSource class with the specified data source, zoom level range, bounding rectangle, and tile size.

MapTileSource(MapTileDataSource, MapZoomLevelRange, GeoboundingBox)

Initializes a new instance of the MapTileSource class with the specified data source, zoom level range, and bounding rectangle.

MapTileSource(MapTileDataSource, MapZoomLevelRange)

Initializes a new instance of the MapTileSource class with the specified data source and zoom level range.

MapTileSource(MapTileDataSource)

Initializes a new instance of the MapTileSource class with the specified data source.

Properties

AllowOverstretch

Gets or sets a value that specifies whether to stretch the current tile while a higher-resolution tile is being downloaded.

AllowOverstretchProperty

Identifies the AllowOverstretch dependency property.

AnimationState

Gets the animation state of this MapTileSource to be displayed in the MapControl.

AnimationStateProperty

Identifies the AnimationState dependency property.

AutoPlay

Gets or sets a value that indicates whether map tiles will begin playback automatically when this MapTileSource gets added to the TileSources property of the MapControl.

AutoPlayProperty

Identifies the AutoPlay dependency property.

Bounds

Gets or sets the rectangular area to contain the tiles.

BoundsProperty

Identifies the Bounds dependency property.

DataSource

Gets or sets the data source for the tiles.

DataSourceProperty

Identifies the DataSource dependency property.

Dispatcher

Gets the CoreDispatcher that this object is associated with. The CoreDispatcher represents a facility that can access the DependencyObject on the UI thread even if the code is initiated by a non-UI thread.

(Inherited from DependencyObject)
FrameCount

Gets or sets the number of frames in the animation of this MapTileSource.

FrameCountProperty

Identifies the FrameCount dependency property.

FrameDuration

Gets or sets the time duration of each frame in the animation of this MapTileSource.

FrameDurationProperty

Identifies the FrameDuration dependency property.

IsFadingEnabled

Gets or sets a value that indicates whether fading is enabled for the tiles.

IsFadingEnabledProperty

Identifies the IsFadingEnabled dependency property.

IsRetryEnabled

Gets or sets a value that indicates whether retry is enabled for the tiles.

IsRetryEnabledProperty

Identifies the IsRetryEnabled dependency property.

IsTransparencyEnabled

Gets or sets a value that indicates whether transparency is enabled for the tiles.

IsTransparencyEnabledProperty

Identifies the IsTransparencyEnabled dependency property.

Layer

Gets or sets the layer that contains the tiles.

LayerProperty

Identifies the Layer dependency property.

TilePixelSize

Gets or sets the size of the tiles in pixels.

TilePixelSizeProperty

Identifies the TilePixelSize dependency property.

Visible

Gets or sets a value that indicates whether the MapTileSource is visible.

VisibleProperty

Identifies the Visible dependency property.

ZIndex

Gets or sets the z-index of the tiles.

ZIndexProperty

Identifies the ZIndex dependency property.

ZoomLevelRange

Gets or sets the minimum and maximum zoom level of the tiles. Tiles are only visible when the ZoomLevel of the MapControl is within the ZoomLevelRange.

ZoomLevelRangeProperty

Identifies the ZoomLevelRange dependency property.

Methods

ClearValue(DependencyProperty)

Clears the local value of a dependency property.

(Inherited from DependencyObject)
GetAnimationBaseValue(DependencyProperty)

Returns any base value established for a dependency property, which would apply in cases where an animation is not active.

(Inherited from DependencyObject)
GetValue(DependencyProperty)

Returns the current effective value of a dependency property from a DependencyObject.

(Inherited from DependencyObject)
Pause()

Pauses the animation at the current frame.

Play()

Plays the animation from the current frame.

ReadLocalValue(DependencyProperty)

Returns the local value of a dependency property, if a local value is set.

(Inherited from DependencyObject)
RegisterPropertyChangedCallback(DependencyProperty, DependencyPropertyChangedCallback)

Registers a notification function for listening to changes to a specific DependencyProperty on this DependencyObject instance.

(Inherited from DependencyObject)
SetValue(DependencyProperty, Object)

Sets the local value of a dependency property on a DependencyObject.

(Inherited from DependencyObject)
Stop()

Stops and resets the animation to be played from the beginning.

UnregisterPropertyChangedCallback(DependencyProperty, Int64)

Cancels a change notification that was previously registered by calling RegisterPropertyChangedCallback.

(Inherited from DependencyObject)

Applies to

See also