【问题标题】:Trying to add images (tiles) to a map尝试将图像(图块)添加到地图
【发布时间】:2015-06-14 04:19:53
【问题描述】:

项目结构图: http://i.imgur.com/yHdZxA2.png

我很确定是我的链接不起作用。 我试过了:

"ms-appx:/TileImages/{0}/{1}/{2}", "ms-appx:///TileImages/{0}/{1}/{2}", "ms-appx:///Local/TileImages/{0}/{1}/{2}", "ms-appdata:///Local/TileImages/{0}/{1}/{2}", 

但似乎没有任何效果。

但是当我尝试另一个链接“http://tiles.kartat.kapsi.fi/peruskartta/{0}/{1}/{2}”时它可以工作。

namespace BingMapsWindowsStoreApp
{

public sealed partial class MainPage: Page
{
private string MyLink = "ms-appx:/TileImages/{0}/{1}/{2}.png";
public MainPage()
{

this.InitializeComponent();
}
protected async override void OnNavigatedTo(NavigationEventArgs e)
{
MapTileLayer layer = new MapTileLayer();
layer.GetTileUri += layer_GetTileUri;
this.myMap.TileLayers.Add(layer);
}
private async void layer_GetTileUri(object sender, GetTileUriEventArgs e)
{
e.Uri = this.CreateTileUri(e);
}
private Uri CreateTileUri(GetTileUriEventArgs e)
{
return new Uri(string.Format(MyLink, e.LevelOfDetail, e.X, e.Y));
}
}
}

【问题讨论】:

    标签: c# visual-studio-2013 windows-store-apps windows-8.1 bing


    【解决方案1】:

    Bing 地图中的 MapTileLayer 类旨在仅访问在线托管的地图图块。

    【讨论】:

      猜你喜欢
      • 2012-02-20
      • 1970-01-01
      • 2014-09-15
      • 2013-01-28
      • 2012-01-20
      • 1970-01-01
      • 1970-01-01
      • 2020-10-03
      • 1970-01-01
      相关资源
      最近更新 更多