2013-05-21 36 views
0

有沒有什麼方法可以禁用地名,道路名稱等,以免在Microsoft.Phone.Maps.Controls.Map控件上顯示?在Windows Phone 8中禁用標籤地圖控件

我在Bing底圖上方顯示了一個自定義TileSource,但標籤仍然在自定義切片源的頂部顯示。

理想情況下,我想關閉Bing基本地圖並將其替換爲我自己的地圖,但在此控件無法實現的情況下。所以我正在使用下一個最好的方法。

在此先感謝您的任何想法!

回答

0

即使它被標記爲折舊,我已經使用WP7 Microsoft.Phone.Controls.Maps.Map,因爲它具有我需要的功能。我已經在UserControl中封裝了控件和功能,所以一旦新的Microsoft.Phone.Maps.Controls.Map控件捕捉了功能,就很容易換掉。

/// <summary> 
/// Sets TileSource as the exclusive MapTileLayer 
/// </summary> 
private void RefreshTileSource() 
{ 
    for (var i = Map.Children.Count - 1; i >= 0; i--) 
    { 
     MapTileLayer tileLayer = Map.Children[i] as MapTileLayer; 
     if (tileLayer != null) 
     { 
      Map.Children.RemoveAt(i); 
     } 
    } 

    // Tiles 
    MapTileLayer layer = new MapTileLayer(); 
    layer.TileSources.Add(ViewModel.TileSource); 
    Map.Children.Add(layer); 

    // Constrain map to area with custom tiles 
    MapMode mode = new MapMode(); 
    mode.SetZoomRange(ViewModel.TileSource.ZoomRange); 
    if (ViewModel.MapBounds.North > ViewModel.MapBounds.South) 
     mode.LatitudeRange = new Range<double>(ViewModel.MapBounds.South, ViewModel.MapBounds.North); 
    else 
     mode.LatitudeRange = new Range<double>(ViewModel.MapBounds.North, ViewModel.MapBounds.South); 
    if (ViewModel.MapBounds.West > ViewModel.MapBounds.East) 
     mode.LongitudeRange = new Range<double>(ViewModel.MapBounds.East, ViewModel.MapBounds.West); 
    else 
     mode.LongitudeRange = new Range<double>(ViewModel.MapBounds.West, ViewModel.MapBounds.East); 
    Map.Mode = mode; 
}