主要样式如下代码段内所示:<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 查询点闪烁显示所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)