Unable to draw more than 4000 features in a FeatureLayer

698
3
11-17-2016 05:26 PM
KevinAndras
New Contributor II

Hi, I am using the ArcGIS Javascript API 4.0 to display a Feature Layer hosted by AGOL.  It is a river network with 13,000 lines.  In the REST admin services, I have set the Max Record Count to 100,000 and the standardMaxRecordCount to 20,000.  I am using a definitionExpression to limit the number of lines that are drawn at any time.  The definitionExpression uses an attribute that is a measure of river size (stream order), so when you zoom out, only high-order streams are show, and when you zoom in to level 16, it will show all of the streams.  At the highest level of zoom, there should only be a few hundred lines visible.    When the query yields more than 4000 results, any features beyond the first 4000 results are not drawn.  4000, coincidentally (?) is the same number that was initially set as the maxRecordCount.   There's a popup window that works on the lines and shows the OBJECTID.  The numbering order is a little strange, but the easy way to replicate the behavior is to set both sliders to zero, zoom in to the west side, and as you zoom in, the definition query changes, some lines start disappearing, even though they are included in the definition query.   Here's a link to the map.  Thanks for any help!

Map here

0 Kudos
3 Replies
AdrianWelsh
MVP Honored Contributor

Hi Kevin,

From looking at this article, it says that large features like this will take a significant amount of time to draw. Have you given it ample time to render all of the drawings?

FAQ: Is there a feature limit in ArcGIS Online? 

by Anonymous User
Not applicable

The Given service maximum use tile looks low and service require time to draw/ render maps with such a large extent of features.
try to optimise it and also try some labeling and mapping displays extent in map services.

0 Kudos
KevinAndras
New Contributor II

Thanks for the responses.  I have done Optimize Layer Drawing in the Feature Layer (Hosted) Settings,with no effect.  I've given it plenty of time to draw, as well.   

I've made some attempts at using the REST API to pass in a URL with a query (Query - Feature Service (Operation)).  So far I have not been able to make it work.  My idea is to pass the stream size query as well as the map envelope as a geometry spatial query.  I can build those queries and get back a limited number of features on the FeatureServer/0/query page, but I don't know how (or if it's possible) to retrieve a feature layer on my map.  If that would work, it would certainly be faster than drawing a huge number of features.

0 Kudos