MessageBox.Show(args.FeatureSet.Features.Count().ToString()); foreach (Graphic selectedGraphic in args.FeatureSet.Features) { selectedGraphic.Symbol = LayoutRoot.Resources["DefaultLineSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol; graphicsLayer.Graphics.Add(selectedGraphic); }
ArcGIS Server 10 returns max 1000 records while querying, ArcGIS Server 9.3.1 and pre version returns 500.
This can be changed by modifying the service configuration file which is under <arcgis server install folder>/server/user directory. Change the <MaxRecordCount> tag, then restart your service.
Also can be done in Parameters tab in service properties dialog in AGS 10.
One thing you should pay attention to is that graphicslayer will get really stuck when adding more than about 2000 graphics in it. you should always use graphics cluster to display.
Hey Zhifang, thank you for the advice. I can see that adding 1000 results is already slow the performance. So based on your advice I am thinking to use the graphicscluster to display the query results (I mean more than 1000). Could you share some sample codes or some clues on how to implement this? I really don't know how to do step the first step...Thank you very much!
<esri:SimpleLineSymbol x:Key="MediumLineSymbol" Color="Red" Width="4" />
Hey Zhifang, thanks very much! Actually I am using Silverlight API. I checked the sample and also modified my codes. It is so amazing 😄
I think the cluster method is pretty useful for street layer, zipcode point layer or similar things, especially when the spatial query should return a large number of results which need to be displayed on the graphicslayer later.
In my codes, since I need to display the streets, I change the 'MediumMarkerSymbol' to 'MediumLineSymbol'<esri:SimpleLineSymbol x:Key="MediumLineSymbol" Color="Red" Width="4" />
I didn't change the FlareCluster part which I think is so cool 😛
But since the query results will be displayed on a datagrid and now the datagrid can only display 1000 results (and the graphicslayer only shows these 1000 results), if I want to display more than 1000 results, I must modify the service configuration file as you suggested, right? And since I am using the graphics cluster method, modifying the service configuration file won't slow down the performance right?