Windows phone 7 WP8 Emulator未显示映射的内容
我正在开发一个WindowsPhone8应用程序,我在xaml页面上放置了一个map控件,在emulator中运行时,只有一个蓝色的方形框显示在map的位置 输出屏幕: MainPage.xamlWindows phone 7 WP8 Emulator未显示映射的内容,windows-phone-7,windows-phone-8,windows-phone,windows-phone-7.1,windows-phone-8-emulator,Windows Phone 7,Windows Phone 8,Windows Phone,Windows Phone 7.1,Windows Phone 8 Emulator,我正在开发一个WindowsPhone8应用程序,我在xaml页面上放置了一个map控件,在emulator中运行时,只有一个蓝色的方形框显示在map的位置 输出屏幕: MainPage.xaml <phone:PhoneApplicationPage xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/20
<phone:PhoneApplicationPage
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:maps="clr-namespace:Microsoft.Phone.Maps.Controls;assembly=Microsoft.Phone.Maps"
x:Class="MapTestApp.MainPage"
mc:Ignorable="d"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
shell:SystemTray.IsVisible="False">
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!--TitlePanel contains the name of the application and page title-->
<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
<TextBlock Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}" Margin="12,0"/>
<TextBlock Text="Bing Map" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
</StackPanel>
<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<maps:Map />
</Grid>
</Grid>
</phone:PhoneApplicationPage>
您还没有添加功能 转到WMAppManifest-功能并检查: ID\U CAP\U位置
ID\u CAP\u MAP您的代码是正确的。这可能是因为模拟器没有网络连接。您可以通过打开模拟器上的web浏览器并导航到页面来检查模拟器的网络连接 如果您的模拟器没有网络连接,可能是因为不同的原因。您可能会发现以下有关MSDM的文档非常有用: 我已经在一个有网络连接的真实设备上尝试了你的代码,它似乎工作正常。这就是我所看到的:
尝试设置地图缩放级别,可能会显示海洋
如果您已授予Internet访问能力和定位能力,还应检查清单。看起来它向您展示了海洋。你能缩小或滚动地图吗?我已将zoomlevel设置为3,因此在该zoomlevel上我认为没有海洋。我尝试过滚动,但没有发现地图有任何变化。所以我不能说它在滚动。@Antonizikov为什么我在地图上添加了图钉来检查它是否在滚动,我发现图钉在滚动时在移动,但是在蓝色背景上。您可以从xaml中删除
,因为您没有使用它,并且在代码中创建了另一个实例。我不认为这是它不起作用的原因,只是想评论一下。我已经检查了它们的功能。但是没有发现任何更改。您正在使用WP7或WP8应用程序吗?它是WP8.0应用程序。我的模拟器上正在打开网页,因此我的模拟器上没有网络问题,
public MainPage()
{
InitializeComponent();
Map MyMap = new Map();
MyMap.Center = new GeoCoordinate(47.6097, -122.3331);
MyMap.ZoomLevel = 3;
MyMap.LandmarksEnabled = true;
MyMap.PedestrianFeaturesEnabled = true;
MyMap.CartographicMode = MapCartographicMode.Aerial;
ContentPanel.Children.Add(MyMap);
}