ArcGIS Runtime采用了新的渲染引擎,新的渲染引擎使得我们在浏览和显示地图的时候非常快,该功能是因为ArcGIS Runtime的Map对象有一个显示加速的属性,如下图:
将UseAcceleratedDisplay属性设置为true之后可以让显示的速度加快。所有的动态地图服务和切片地图服务,该功能都支持,如果让Map的所有图层都加速显示,只要按下面的设置就行:
<esri:Mapx:Name="_map" UseAcceleratedDisplay="True">
<esri:ArcGISTiledMapServiceLayer ID="World Topo Map"
Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"/>
<esri:GraphicsLayer ID="Fire Trucks" />
</esri:Map>
一个Map中可能有多个图层,但是我们可以设置让一些特定的图层启用该功能,代码如下:
<esri:Mapx:Name="_map">
<esri:AcceleratedDisplayLayers>
<esri:ArcGISTiledMapServiceLayer ID="World Topo Map"
Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"/>
<esri:GraphicsLayer ID="Fire Trucks" />
</esri:AcceleratedDisplayLayers>
<esri:GraphicsLayer ID="Census Data">
<esri:GraphicsLayer.Clusterer>
<esri:FlareClusterer />
</esri:GraphicsLayer.Clusterer>
</esri:GraphicsLayer>
</esri:Map>
ArcGIS Runtime有很高的性能,这种性能使得我们可以在Map上显示成千上万个点,并且在拖动的时候很流畅,下图为10000个动画符号的效果:
点符号代码如下:
<esri:MarkerSymbol x:Key="ResonateMarkerSymbol">
<esri:MarkerSymbol.ControlTemplate>
<ControlTemplate>
<Canvas>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal">
<Storyboard RepeatBehavior="Forever">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Offset)" Storyboard.TargetName="ellipse">
<EasingDoubleKeyFrame KeyTime="0" Value="0.372"/>
<EasingDoubleKeyFrame KeyTime="0:0:00.5" Value="0.453"/>
<EasingDoubleKeyFrame KeyTime="0:0:01" Value="0.704"/>
<EasingDoubleKeyFrame KeyTime="0:0:01.5" Value="0.968"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[4].(GradientStop.Offset)" Storyboard.TargetName="ellipse">
<EasingDoubleKeyFrame KeyTime="0:0:00.5" Value="0.58"/>
<EasingDoubleKeyFrame KeyTime="0:0:01" Value="0.784"/>
<EasingDoubleKeyFrame KeyTime="0:0:01.5" Value="0.992"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimation BeginTime="0"
Storyboard.TargetName="ellipse" Storyboard.TargetProperty="(UIElement.Opacity)"
From="1" To="0" Duration="0:0:01.5" />
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Ellipse x:Name="ellipse" Height="70" StrokeThickness="3" Width="70"
Canvas.Left="-35" Canvas.Top="-35">
<Ellipse.Fill>
<RadialGradientBrush>
<GradientStop Color="#FFC82727"/>
<GradientStop Color="#FFE2E296" Offset="0.255"/>
<GradientStop Color="#FFE2E296" Offset="0.115"/>
<GradientStop Color="#FFE2E296" Offset="0.381"/>
<GradientStop Color="#00F3EBE9" Offset="0.667"/>
</RadialGradientBrush>
</Ellipse.Fill>
</Ellipse>
</Canvas>
</ControlTemplate>
</esri:MarkerSymbol.ControlTemplate>
</esri:MarkerSymbol>