Rendering some parts of the Featurelayer?

1529
9
Jump to solution
10-27-2013 07:12 PM
yufeizhuang
New Contributor
Hi I'm confused how to render only some parts of a feature layer. Since all the given classbreak rendering samples are rendering the whole feature layer, is there any method to render only a few of the polygons in the feature layer (already have the Object IDs). Thanks in advance!
0 Kudos
1 Solution

Accepted Solutions
JasonZou
Occasional Contributor III
It depends. If you need to query the layer based on the attribute data and/or spatial features, having a graphics layer to render the found features can be one way to go. Otherwise, if you only like to control the feature limit at each map scale level, making query and rendering afterwards would be an overhead. Setting scale dependencies in the map service would be the way I will recommend then.

Again, your business logic will eventually define the best approach you will need.

View solution in original post

0 Kudos
9 Replies
JasonZou
Occasional Contributor III
yufei, you can use renderer to render the whole feature layer, and use featureLayer.setDefinitionExpression(expression) to filter which subset of features will be displayed by their attribute data.
0 Kudos
yufeizhuang
New Contributor
yufei, you can use renderer to render the whole feature layer, and use featureLayer.setDefinitionExpression(expression) to filter which subset of features will be displayed by their attribute data.


Thank you for prompting reply, it's a good idea but the now I have too many polygons in the feature layer(20000+), and I only need to render less than 1000 at one time... Would it be too slow to do that?
0 Kudos
ManojrajTeli
Occasional Contributor II
Hello yufei zhuang,

You can set the server behavior to return only 1000 records.Presuming you are using 10.1/10.2 ArcGIS server you can set property

Maximum Number of Records Returned by Server: 1000 in parameter tab of service.So server will return thousand record you and you can limit the records return by the server. As the number of records return by server increases it slows down the page.

Thanks
Manojraj Teli
0 Kudos
yufeizhuang
New Contributor


You can set the server behavior to return only 1000 records.

Thank you Manojraj. As I know, the server will return maximum 1000 records by default. Is it possible to increase this number and how can I do it?
0 Kudos
ManojrajTeli
Occasional Contributor II
Hello yufei zhuang,


You can increase the record limit on ArcGIS server by changing service properties.You can Increase it upto 13000 records which i have done since normal browser will support that much geometry.
Below are the images which will guide you to do that on ArcGIS Server. I am using ArcGIS server 10.2.

[ATTACH=CONFIG]28640[/ATTACH]

click on county layer to get next screen.

[ATTACH=CONFIG]28641[/ATTACH]

change the tab in left panel to get next screen.

[ATTACH=CONFIG]28642[/ATTACH]

change the value and save and restart service.

Which version of ArcGIS server are you using...?
0 Kudos
JasonZou
Occasional Contributor III
Yufei, although you can control limiting rendering features by setting the MaxRecordCount number at the map service level, it is normally not a good idea to use that measure as the only control. MaxRecordCount is used mainly for performance consideration. But you don't want to confuse the users that the features rendered are the only ones available at that map scale. I would suggest to control the layer visibility by setting their scale dependency. With that, you can control that only features within the limit will be displayed, and meet your performance need as well.

If you can describe more detail how you like to filter the layer, it will help us better help you out.
0 Kudos
yufeizhuang
New Contributor
Yes you are right, I'm just curious about how to control the MaxRecordCount number. In fact, I have 20000+ polygons, and only have to show around 1000 every time. I'm thinking maybe it's more efficiency if I only add makers to the selected polygons instead of using the renderer?
0 Kudos
JasonZou
Occasional Contributor III
It depends. If you need to query the layer based on the attribute data and/or spatial features, having a graphics layer to render the found features can be one way to go. Otherwise, if you only like to control the feature limit at each map scale level, making query and rendering afterwards would be an overhead. Setting scale dependencies in the map service would be the way I will recommend then.

Again, your business logic will eventually define the best approach you will need.
0 Kudos
yufeizhuang
New Contributor
If you need to query the layer based on the attribute data and/or spatial features, having a graphics layer to render the found features can be one way to go.

Yes I do have to query the layer based on spatial features. Thank you for the answer.
0 Kudos