MapTileSource 類別

定義

代表在 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
繼承
Object IInspectable DependencyObject MapTileSource
屬性

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)

範例

此範例會在地圖上從虛構的 Web 服務重迭圖格。

// 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);

這個其他範例會在地圖上以動畫顯示來自虛構 Web 服務的圖格。 此程式碼會建立 MapTileSource,並將 AutoPlay 屬性明確設定為 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);

備註

您也可以使用 MapTileSource 在 MapControl 上以動畫顯示磚。

版本歷程記錄

Windows 版本 SDK 版本 新增值
1809 17763 AnimationState
1809 17763 自動播放
1809 17763 FrameCount
1809 17763 FrameDuration
1809 17763 暫停
1809 17763 播放
1809 17763 Stop

建構函式

MapTileSource()

初始化 MapTileSource 類別的新實例。

MapTileSource(MapTileDataSource)

使用指定的資料來源,初始化 MapTileSource 類別的新實例。

MapTileSource(MapTileDataSource, MapZoomLevelRange)

使用指定的資料來源和縮放層級範圍,初始化 MapTileSource 類別的新實例。

MapTileSource(MapTileDataSource, MapZoomLevelRange, GeoboundingBox)

使用指定的資料來源、縮放層級範圍和周框,初始化 MapTileSource 類別的新實例。

MapTileSource(MapTileDataSource, MapZoomLevelRange, GeoboundingBox, Int32)

使用指定的資料來源、縮放層級範圍、周框和磚大小,初始化 MapTileSource 類別的新實例。

屬性

AllowOverstretch

取得或設定值,這個值會指定是否要在下載高解析度磚時延展目前的磚。

AllowOverstretchProperty

識別 AllowOverstretch 相依性屬性。

AnimationState

取得要顯示在MapControl中之這個MapTileSource的動畫狀態。

AnimationStateProperty

識別 AnimationState 相依性屬性。

AutoPlay

取得或設定值,這個值表示當這個MapTileSource新增至MapControlTileSources屬性時,地圖底圖是否會自動開始播放。

AutoPlayProperty

識別 AutoPlay 相依性屬性。

Bounds

取得或設定要包含磚的矩形區域。

BoundsProperty

識別 Bounds 相依性屬性。

DataSource

取得或設定圖格的資料來源。

DataSourceProperty

識別 DataSource 相依性屬性。

Dispatcher

取得這個 物件相關聯的 CoreDispatcherCoreDispatcher代表可在 UI 執行緒上存取DependencyObject的功能,即使程式碼是由非 UI 執行緒起始也一樣。

(繼承來源 DependencyObject)
FrameCount

取得或設定這個 MapTileSource動畫中的畫面格數目。

FrameCountProperty

識別 FrameCount 相依性屬性。

FrameDuration

取得或設定這個 MapTileSource動畫中每個畫面格的時間持續時間。

FrameDurationProperty

識別 FrameDuration 相依性屬性。

IsFadingEnabled

取得或設定值,這個值表示是否啟用磚的淡化。

IsFadingEnabledProperty

識別 IsFadingEnabled 相依性屬性。

IsRetryEnabled

取得或設定值,這個值表示是否啟用磚的重試。

IsRetryEnabledProperty

識別 IsRetryEnabled 相依性屬性。

IsTransparencyEnabled

取得或設定值,這個值表示是否啟用磚的透明度。

IsTransparencyEnabledProperty

識別 IsTransparencyEnabled 相依性屬性。

Layer

取得或設定包含圖格的圖層。

LayerProperty

識別 Layer 相依性屬性。

TilePixelSize

取得或設定以圖元為單位的磚大小。

TilePixelSizeProperty

識別 TilePixelSize 相依性屬性。

Visible

取得或設定值,這個值表示是否可見 MapTileSource

VisibleProperty

識別 Visible 相依性屬性。

ZIndex

取得或設定磚的 z 索引。

ZIndexProperty

識別 ZIndex 相依性屬性。

ZoomLevelRange

取得或設定磚的最小和最大縮放層級。 只有在MapControlZoomLevel位於 ZoomLevelRange 內時,才會顯示磚。

ZoomLevelRangeProperty

識別 ZoomLevelRange 相依性屬性。

方法

ClearValue(DependencyProperty)

清除相依性屬性的本機值。

(繼承來源 DependencyObject)
GetAnimationBaseValue(DependencyProperty)

傳回為相依性屬性建立的任何基底值,如果動畫未使用中,則適用此屬性。

(繼承來源 DependencyObject)
GetValue(DependencyProperty)

DependencyObject傳回相依性屬性的目前有效值。

(繼承來源 DependencyObject)
Pause()

暫停目前畫面格的動畫。

Play()

播放目前畫面格中的動畫。

ReadLocalValue(DependencyProperty)

如果已設定本機值,則傳回相依性屬性的本機值。

(繼承來源 DependencyObject)
RegisterPropertyChangedCallback(DependencyProperty, DependencyPropertyChangedCallback)

註冊通知函式,以接聽此DependencyObject實例上特定DependencyProperty的變更。

(繼承來源 DependencyObject)
SetValue(DependencyProperty, Object)

設定 DependencyObject上相依性屬性的本機值。

(繼承來源 DependencyObject)
Stop()

停止並重設要從頭播放的動畫。

UnregisterPropertyChangedCallback(DependencyProperty, Int64)

取消先前透過呼叫 RegisterPropertyChangedCallback註冊的變更通知。

(繼承來源 DependencyObject)

適用於

另請參閱