Microsoft Virtual Earth Silverlight Map Control (CTP)快速上手
2009-03-29 11:59:04 来源:WEB开发网如果你F5运行它的话,你已经可以看到Virtual Earth地图呈现在你的Silverlight项目里了。我们还要做更多。
第四步:拖入一些简单的控件。
<UserControl x:Class="SLLiveEarthControl.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:VirtualEarth="clr-namespace:Microsoft.VirtualEarth.MapControl;assembly=Microsoft.VirtualEarth.MapControl"
Width="700" Height="500">
<Grid x:Name="LayoutRoot" Background="White">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="40" />
<RowDefinition Height="40" />
</Grid.RowDefinitions>
<VirtualEarth:Map x:Name="viewMap" Mode="AerialWithLabels" Grid.Column="0" Grid.Row="0" Grid.RowSpan="3" Padding="5"
View="29.544,106.518,0.0000 14.0000 0.0000" MouseDoubleClick="MapWithImages_MouseDoubleClick" />
<StackPanel Orientation="Horizontal" Opacity="0.7" Grid.Column="0" Grid.Row="1" HorizontalAlignment="Center">
<Button x:Name="btnNorthAmerica" Click="ChangeMapView_Click" Tag="39.89341,116.33235,0.0000 14.0000 0.0000"
Margin="5" Height="20" >
<TextBlock>北京</TextBlock>
</Button>
<Button x:Name="btnChengdu" Click="ChangeMapView_Click" Tag="30.67,104.074,0.0000 14.0000 0.0000" Margin="5" Height="20" >
<TextBlock>成都</TextBlock>
</Button>
<Button x:Name="btnShanghai" Click="ChangeMapView_Click" Tag="31.10,121.411,0.0000 13.0000 0.0000" Margin="5" Height="20" >
<TextBlock>上海</TextBlock>
</Button>
<Button x:Name="btnVancouver" Click="ChangeMapView_Click" Tag="29.544,106.518,0.0000 14.0000 0.0000" Margin="5" Height="20" >
<TextBlock>重庆</TextBlock>
</Button>
</StackPanel>
<StackPanel Orientation="Horizontal" Opacity="0.9" Grid.Column="0" Grid.Row="2" HorizontalAlignment="Center">
<TextBlock Text="双击地图可以添加图钉。 更改经纬度后可点击Fly to换位置. " Padding="5" Foreground="Red" Width="178" TextWrapping="Wrap"/>
<TextBlock Text="Latitude: " Padding="12" Foreground="Red" />
<TextBox x:Name="txtLatitude" Text="" Height="20" />
<TextBlock Text="Longitude: " Padding="12" Foreground="Red" />
<TextBox x:Name="txtLongitude" Text="" Height="20" />
<Button x:Name="btnFlyto" Click="btnFlyto_Click" Foreground="Red" Margin="5" Height="20" >
<TextBlock>Fly to</TextBlock>
</Button>
</StackPanel>
</Grid>
</UserControl>
- ››Microsoft Outlook 2010 邮箱客户端中常用邮件设置...
- ››Microsoft Office2007Open XML 格式的术语表
- ››Microsoft PowerPoint 2010介绍
- ››Microsoft ReportViewer(微软报表)项目中的应用...
- ››Microsoft APP-V 4.5使用经验之序列化工具
- ››Microsoft Access 2010的十大优势详解
- ››VirtualBox虚拟机安装CentOS系统
- ››Microsoft数据访问技术简介
- ››Microsoft My Phone for Windows Mobile 6+ 新版发...
- ››Microsoft Security Essentials 1.0.1959.0
- ››Microsoft Office Access 2007年中选项组控件中您...
- ››Microsoft Office Communications Server 2007 R2...
更多精彩
赞助商链接