我使用Bing地图Task.It是顺风顺水。
这是XAML代码。
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
</Grid.RowDefinitions>
<StackPanel x:Name="stkhead" Grid.Row="0">
<TextBlock Text="Bing Map and Location Service" HorizontalAlignment="Center"></TextBlock>
</StackPanel>
<StackPanel x:Name="stkInfo" Grid.Row="1">
<TextBlock x:Name="tblcurpos" Text="Current Position :-" Width="150" HorizontalAlignment="Left"/>
<TextBlock x:Name="tblcurpos1" Text="" Width="120" HorizontalAlignment="Center" Margin="0,-25,0,0"/>
</StackPanel>
<StackPanel x:Name="stkmap" Grid.Row="2">
</StackPanel>
<StackPanel x:Name="stksearch" Grid.Row="3">
<TextBlock x:Name="tblsearch" Text="Search"></TextBlock>
<TextBox x:Name="txtsearch" Width="380" Margin="0,-38,0,0" Text=""></TextBox>
<Button Name="btnsearch" Content="Search" Height="75" Width="195" Tap="btnsearch_Tap_1"></Button>
</StackPanel>
</Grid>
下面是C#代码。
public MainPage()
{
InitializeComponent();
FindMe();
}
private void Bingtask()
{
BingMapsTask bingMap = new BingMapsTask();
bingMap.SearchTerm = txtsearch.Text;
bingMap.ZoomLevel = 10;
bingMap.Show();
}
private void FindMe()
{
tblcurpos1.Text = "Not Found";
}
private void btnsearch_Tap_1(object sender, System.Windows.Input.GestureEventArgs e)
{
Bingtask();
}
感谢您的inpur,我很抱歉,我的问题可能一直有点模糊。我的意思是游戏地图中的地图,而不是世界地图:)我很抱歉,代码看起来不错。 – JTIM