WEB开发网
开发学院图形图像Flash Microsoft Virtual Earth Silverlight Map Contro... 阅读

Microsoft Virtual Earth Silverlight Map Control (CTP)快速上手

 2009-03-29 11:59:04 来源:WEB开发网   
核心提示: 如果你F5运行它的话,你已经可以看到Virtual Earth地图呈现在你的Silverlight项目里了,Microsoft Virtual Earth Silverlight Map Control (CTP)快速上手(3),我们还要做更多,第四步:拖入一些简单的控件

如果你F5运行它的话,你已经可以看到Virtual Earth地图呈现在你的Silverlight项目里了。我们还要做更多。

第四步:拖入一些简单的控件。

Microsoft Virtual Earth Silverlight Map Control (CTP)快速上手 

 

<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>

上一页  1 2 3 4  下一页

Tags:Microsoft Virtual Earth

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接