MapTileSource MapTileSource MapTileSource MapTileSource Class

Definition

Represents a source of tiles to overlay on the MapControl.

public : class MapTileSource : DependencyObject
struct winrt::Windows::UI::Xaml::Controls::Maps::MapTileSource : DependencyObject
public class MapTileSource : DependencyObject
Public Class MapTileSource Inherits DependencyObject
Inheritance
MapTileSourceMapTileSourceMapTileSourceMapTileSource
Attributes

Windows 10 requirements

Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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() MapTileSource() MapTileSource() MapTileSource()

Initializes a new instance of the MapTileSource class.

MapTileSource(MapTileDataSource) MapTileSource(MapTileDataSource) MapTileSource(MapTileDataSource) MapTileSource(MapTileDataSource)

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

MapTileSource(MapTileDataSource, MapZoomLevelRange) MapTileSource(MapTileDataSource, MapZoomLevelRange) MapTileSource(MapTileDataSource, MapZoomLevelRange) MapTileSource(MapTileDataSource, MapZoomLevelRange)

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

MapTileSource(MapTileDataSource, MapZoomLevelRange, GeoboundingBox) MapTileSource(MapTileDataSource, MapZoomLevelRange, GeoboundingBox) MapTileSource(MapTileDataSource, MapZoomLevelRange, GeoboundingBox) 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, GeoboundingBox, Int32) MapTileSource(MapTileDataSource, MapZoomLevelRange, GeoboundingBox, Int32) MapTileSource(MapTileDataSource, MapZoomLevelRange, GeoboundingBox, Int32) 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.

Properties

AllowOverstretch AllowOverstretch AllowOverstretch AllowOverstretch

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

AllowOverstretchProperty AllowOverstretchProperty AllowOverstretchProperty AllowOverstretchProperty

Identifies the AllowOverstretch dependency property.

AnimationState AnimationState AnimationState AnimationState

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

AnimationStateProperty AnimationStateProperty AnimationStateProperty AnimationStateProperty

Identifies the AnimationState dependency property.

AutoPlay AutoPlay AutoPlay 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 AutoPlayProperty AutoPlayProperty AutoPlayProperty

Identifies the AutoPlay dependency property.

Bounds Bounds Bounds Bounds

Gets or sets the rectangular area to contain the tiles.

BoundsProperty BoundsProperty BoundsProperty BoundsProperty

Identifies the Bounds dependency property.

DataSource DataSource DataSource DataSource

Gets or sets the data source for the tiles.

DataSourceProperty DataSourceProperty DataSourceProperty DataSourceProperty

Identifies the DataSource dependency property.

Dispatcher Dispatcher Dispatcher 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 FrameCount FrameCount FrameCount

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

FrameCountProperty FrameCountProperty FrameCountProperty FrameCountProperty

Identifies the FrameCount dependency property.

FrameDuration FrameDuration FrameDuration FrameDuration

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

FrameDurationProperty FrameDurationProperty FrameDurationProperty FrameDurationProperty

Identifies the FrameDuration dependency property.

IsFadingEnabled IsFadingEnabled IsFadingEnabled IsFadingEnabled

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

IsFadingEnabledProperty IsFadingEnabledProperty IsFadingEnabledProperty IsFadingEnabledProperty

Identifies the IsFadingEnabled dependency property.

IsRetryEnabled IsRetryEnabled IsRetryEnabled IsRetryEnabled

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

IsRetryEnabledProperty IsRetryEnabledProperty IsRetryEnabledProperty IsRetryEnabledProperty

Identifies the IsRetryEnabled dependency property.

IsTransparencyEnabled IsTransparencyEnabled IsTransparencyEnabled IsTransparencyEnabled

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

IsTransparencyEnabledProperty IsTransparencyEnabledProperty IsTransparencyEnabledProperty IsTransparencyEnabledProperty

Identifies the IsTransparencyEnabled dependency property.

Layer Layer Layer Layer

Gets or sets the layer that contains the tiles.

LayerProperty LayerProperty LayerProperty LayerProperty

Identifies the Layer dependency property.

TilePixelSize TilePixelSize TilePixelSize TilePixelSize

Gets or sets the size of the tiles in pixels.

TilePixelSizeProperty TilePixelSizeProperty TilePixelSizeProperty TilePixelSizeProperty

Identifies the TilePixelSize dependency property.

Visible Visible Visible Visible

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

VisibleProperty VisibleProperty VisibleProperty VisibleProperty

Identifies the Visible dependency property.

ZIndex ZIndex ZIndex ZIndex

Gets or sets the z-index of the tiles.

ZIndexProperty ZIndexProperty ZIndexProperty ZIndexProperty

Identifies the ZIndex dependency property.

ZoomLevelRange ZoomLevelRange ZoomLevelRange 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 ZoomLevelRangeProperty ZoomLevelRangeProperty ZoomLevelRangeProperty

Identifies the ZoomLevelRange dependency property.

Methods

ClearValue(DependencyProperty) ClearValue(DependencyProperty) ClearValue(DependencyProperty) ClearValue(DependencyProperty)

Clears the local value of a dependency property.

(Inherited from DependencyObject)
GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty) 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) GetValue(DependencyProperty) GetValue(DependencyProperty) GetValue(DependencyProperty)

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

(Inherited from DependencyObject)
Pause() Pause() Pause() Pause()

Pauses the animation at the current frame.

Play() Play() Play() Play()

Plays the animation from the current frame.

ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty)

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

(Inherited from DependencyObject)
RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback) RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback) RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback) 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) SetValue(DependencyProperty,Object) SetValue(DependencyProperty,Object) SetValue(DependencyProperty,Object)

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

(Inherited from DependencyObject)
Stop() Stop() Stop() Stop()

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

UnregisterPropertyChangedCallback(DependencyProperty,Int64) UnregisterPropertyChangedCallback(DependencyProperty,Int64) UnregisterPropertyChangedCallback(DependencyProperty,Int64) UnregisterPropertyChangedCallback(DependencyProperty,Int64)

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

(Inherited from DependencyObject)

See also