Select to view content in your preferred language

Modify Rendering With Code Sample

459
4
05-05-2014 09:32 PM
HushamHassan
Occasional Contributor
I am trying to play with Rendering With Code Sample this, using my Parcel layer.  I just changed few line of code
Where = "Shape_Area > 700",
                    OutSpatialReference = MyMap.SpatialReference,
                    ReturnGeometry = true
                };
                query.OutFields.Add("*");

                QueryTask queryTask =
                    new QueryTask("http://localhost:6080/arcgis/rest/services/pub/parcel5/MapServer");


and
ThematicItemList.Add(new ThematicItem() { Name = "cert_land_", Description = "land ", CalcField = "" });
            //ThematicItemList.Add(new ThematicItem() { Name = "POP07_SQMI", Description = "2007 Pop per Sq Mi", CalcField = "" });
            //ThematicItemList.Add(new ThematicItem() { Name = "MALES", Description = "%Males", CalcField = "POP2007" });
            //ThematicItemList.Add(new ThematicItem() { Name = "FEMALES", Description = "%Females", CalcField = "POP2007" });
            //ThematicItemList.Add(new ThematicItem() { Name = "MED_AGE", Description = "Median age", CalcField = "" });
            ThematicItemList.Add(new ThematicItem() { Name = "Shape_Area", Description = "Total area", CalcField = "" });


Its not working and no result on the map and even I am not getting any error..  is it some thing related to spatial reference or my feature.  compete Code attached with xaml
the sample is confused and there is no any step by step to get thing clear for  newbies.

Many thanks
0 Kudos
4 Replies
AsserSwelam1
Occasional Contributor
Hi Hamad,

Comparing your code to the sample to find the changes.

Here is one of the difference

In the sample the query will be performed on the 6th layer in the map service with index 5:

QueryTask queryTask =
new QueryTask("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/5");

I found that you write the QueryTask URL without defining the feature layer you want to query.

QueryTask queryTask =
new QueryTask("http://localhost:6080/arcgis/rest/services/pub/parcel5/MapServer");

Try to add the index of the layer you are querying.

Thanks,
Asser
0 Kudos
HushamHassan
Occasional Contributor
Hi,
No its just a typo in the post,  I have the Correct Url in my solution,  but still is not working..

Regards
0 Kudos
HushamHassan
Occasional Contributor
Hello,
I did modify my code and its working but not the way I want.  I am getting partial render to my Parcel features(see attached pic & Code)
what is the maximum features I can render (limit)? is there any documentation for this example.

I am working now with SL Api 3.2 and SL.5

Regards
0 Kudos
DominiqueBroux
Esri Frequent Contributor
It might be due to the max records returned by a map service query.

The default limit is 500 for ArcGIS Server 9.3.1 and 1000 for ArcGIS Server 10. This limit can be changed at the server size.
From SL30.0 and ArcGIS Server 10.1, the API exposes this limit: FeatureLayer.LayerInfo.MaxRecordCount so we can programmatically know if you reach the limit or not.
0 Kudos