ArcGIS API for Silverlight 查询点闪烁显示

ArcGIS API for Silverlight 查询点闪烁显示,第1张

概述主要样式如下代码段内所示:<esri:MarkerSymbol x:Name="DefaultMarkerSymbol"> ....</esri:MarkerSymbol> ...xmlns:esri="http://schemas.esri.com/arcgis/client/2009"...<Grid.Resources> <esri:MarkerSymbol x:

主要样式如下代码段内所示:<esri:MarkerSymbol x:name="DefaultMarkerSymbol"> ....</esri:MarkerSymbol>


...xmlns:esri="http://schemas.esri.com/arcgis/clIEnt/2009"...<GrID.Resources>     <esri:MarkerSymbol x:name="DefaultMarkerSymbol">                <esri:MarkerSymbol.ControlTemplate>                    <ControlTemplate>                        <Canvas>                            <vsm:visualstatemanager.VisualStateGroups>                                <vsm:VisualStateGroup x:name="CommonStates">                                    <vsm:VisualState x:name="normal">                                        <Storyboard RepeatBehavior="Forever">                                            <DoubleAnimation BeginTime="00:00:00" Storyboard.Targetname="ellipse" Storyboard.TargetProperty="(UIElement.Rendertransform).(Scaletransform.ScaleX)" From="1" To="10" Duration="00:00:01" />                                            <DoubleAnimation BeginTime="0:0:0" Storyboard.Targetname="ellipse" Storyboard.TargetProperty="(UIElement.Rendertransform).(Scaletransform.ScaleY)" From="1" To="10" Duration="00:00:01" />                                            <DoubleAnimation BeginTime="00:00:00" Storyboard.Targetname="ellipse" Storyboard.TargetProperty="(UIElement.Opacity)" From="1" To="0" Duration="00:00:01" />                                        </Storyboard>                                    </vsm:VisualState>                                </vsm:VisualStateGroup>                            </vsm:visualstatemanager.VisualStateGroups>                            <Ellipse Height="10" WIDth="10" Canvas.left="-5" Canvas.top="-5" RendertransformOrigin="0.5,0.5" x:name="ellipse" IsHitTestVisible="False">                                <Ellipse.Rendertransform>                                    <Scaletransform />                                </Ellipse.Rendertransform>                                <Ellipse.Fill>                                    <RadialGradIEntBrush>                                        <GradIEntStop color="#00FF0000" />                                        <GradIEntStop color="#FFFF0000" Offset="0.25" />                                        <GradIEntStop color="#00FF0000" Offset="0.5" />                                        <GradIEntStop color="#FFFF0000" Offset="0.75" />                                        <GradIEntStop color="#00FF0000" Offset="1" />                                    </RadialGradIEntBrush>                                </Ellipse.Fill>                            </Ellipse>                            <Ellipse Height="10" WIDth="10" Canvas.left="-5" Canvas.top="-5" Fill="#FFFF0000" x:name="ellipse1" />                        </Canvas>                    </ControlTemplate>                </esri:MarkerSymbol.ControlTemplate>            </esri:MarkerSymbol></GrID.Resources>private voID UserControl_Loaded(object sender,RoutedEventArgs e){     queryTask queryTask = new queryTask("http://192.168.2.5/arcgis/rest/services/AnHuIDynamic/MapServer/0");     queryTask.ExecuteCompleted += queryTask_ExecuteCompleted;     queryTask.Failed += queryTask_Failed;     ESRI.ArcGIS.ClIEnt.Tasks.query query = new ESRI.ArcGIS.ClIEnt.Tasks.query();     query.ReturnGeometry = true;     query.Text = conditions;     query.OutSpatialReference = myMap.SpatialReference;     query.OutFIElds.Add("name");     queryTask.ExecuteAsync(query);      } private voID queryTask_ExecuteCompleted(object sender,ESRI.ArcGIS.ClIEnt.Tasks.queryEventArgs args){     Featureset featureset = args.Featureset;           Graphicslayer graphicslayer = myMap.Layers["MyGraphicslayer"] as Graphicslayer;    graphicslayer.Cleargraphics();    if (featureset != null && featureset.Features.Count > 0)    {        Graphic selectedFeature = featureset.Features[0];       // Highlight selected feature       selectedFeature.Symbol = LayoutRoot.Resources["DefaultMarkerSymbol"] as ESRI.ArcGIS.ClIEnt.Symbols.Symbol;       graphicslayer.Graphics.Add(selectedFeature);       // Zoom to selected feature (define expand percentage)       ESRI.ArcGIS.ClIEnt.Geometry.Envelope selectedFeatureExtent = selectedFeature.Geometry.Extent;       double expandPercentage = 30;      double wIDthExpand = selectedFeatureExtent.WIDth * (expandPercentage / 100);       double heightExpand = selectedFeatureExtent.Height * (expandPercentage / 100);       ESRI.ArcGIS.ClIEnt.Geometry.Envelope displayExtent = new ESRI.ArcGIS.ClIEnt.Geometry.Envelope(       selectedFeatureExtent.XMin - (wIDthExpand / 2),selectedFeatureExtent.YMin - (heightExpand / 2),selectedFeatureExtent.XMax + (wIDthExpand / 2),selectedFeatureExtent.YMax + (heightExpand / 2));       myMap.ZoomTo(displayExtent);     }}private voID queryTask_Failed(object sender,TaskFailedEventArgs args){    MessageBox.Show("query Failed: " + args.Error);}效果如下图:

总结

以上是内存溢出为你收集整理的ArcGIS API for Silverlight 查询闪烁显示全部内容,希望文章能够帮你解决ArcGIS API for Silverlight 查询点闪烁显示所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1069352.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-26
下一篇 2022-05-26

发表评论

登录后才能评论

评论列表(0条)

保存