<esri:Map x:Name="MyMap" WrapAround="True"> <esri:Map.Extent> <esri:Envelope XMin="-15000000" YMin="2000000" XMax="-7000000" YMax="8000000"> <esri:Envelope.SpatialReference> <esri:SpatialReference WKID="102100"/> </esri:Envelope.SpatialReference> </esri:Envelope> </esri:Map.Extent> ......
<UserControl x:Class="Retrospective.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:esri="clr-namespace:ESRI.ArcGIS.Client;assembly=ESRI.ArcGIS.Client" xmlns:Toolkit="clr-namespace:ESRI.ArcGIS.Client.Toolkit;assembly=ESRI.ArcGIS.Client.Toolkit" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400"> <Grid x:Name="LayoutRoot" Background="White"> <esri:Map x:Name="MyMap" TimeExtent="{Binding ElementName=MyTimeSlider, Path=Value}"> <esri:ArcGISTiledMapServiceLayer Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer" /> <esri:FeatureLayer ID="vbLayer" Url="http://vmxp/ArcGIS/rest/services/vbgis/MapServer/0" UpdateCompleted="FeatureLayer_UpdateCompleted"/> </esri:Map> <Grid HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="50,10,50,10" > <Rectangle Fill="#77919191" Stroke="Gray" RadiusX="10" RadiusY="10" Margin="0,0,0,5" > <Rectangle.Effect> <DropShadowEffect/> </Rectangle.Effect> </Rectangle> <Border Background="#FFFFFFFF" BorderBrush="DarkGray" CornerRadius="5" Margin="10,10,10,15" HorizontalAlignment="Center" VerticalAlignment="Top" > <StackPanel Margin="5"> <TextBlock Text="VBs" FontSize="16" HorizontalAlignment="Center"/> <Grid> <TextBlock Text="{Binding ElementName=MyMap, Path=Layers[vbLayer].TimeExtent.Start, Mode=OneWay}" HorizontalAlignment="Left" /> <TextBlock Text="{Binding ElementName=MyMap, Path=Layers[vbLayer].TimeExtent.End, Mode=OneWay}" HorizontalAlignment="Right" /> </Grid> <Toolkit:TimeSlider x:Name="MyTimeSlider" Loop="True" PlaySpeed="0:0:0.15" TimeMode="TimeExtent" MinimumValue="{Binding ElementName=MyMap, Path=Layers[vbLayer].TimeExtent.Start, Mode=OneWay}" MaximumValue="{Binding ElementName=MyMap, Path=Layers[vbLayer].TimeExtent.End, Mode=OneWay}" Value="2000/08/04 01:00:00 UTC,2000/08/07 01:00:00 UTC" Height="20" /> </StackPanel> </Border> </Grid> </Grid> </UserControl>
namespace Retrospective { public partial class MainPage : UserControl { public MainPage() { InitializeComponent(); MouseRightButtonDown += new MouseButtonEventHandler(MainPage_MouseRightButtonDown); } void MainPage_MouseRightButtonDown(object sender, MouseButtonEventArgs e) { // (MyMap.Layers["vbLayer"] as FeatureLayer).Update(); // (MyMap.Layers["vbLayer"] as FeatureLayer).Refresh(); FeatureLayer featureLayer = (MyMap.Layers["vbLayer"] as FeatureLayer); } private void FeatureLayer_UpdateCompleted(object sender, EventArgs e) { TimeExtent extent = new TimeExtent(MyTimeSlider.MinimumValue, MyTimeSlider.MaximumValue); MyTimeSlider.Intervals = TimeSlider.CreateTimeStopsByTimeInterval(extent, new TimeSpan(0, 0, 10, 0, 0)); MyTimeSlider.Value = new TimeExtent(MyTimeSlider.MinimumValue, MyTimeSlider.MinimumValue.AddMinutes(20)); } } }
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.