When viewing a hosted feature service in the ArcGIS Online Map Viewer, sometimes a warning of “Layer did not draw completely because there are too many features to display” is returned. This message is expected to appear when attempting to display a large number of features in the Map Viewer. This message is a warning that all of the features expected to be seen in the map extent cannot draw completely and some features may be missing from the view.
When features from a service are displayed in the Map Viewer, requests are sent to the server so that the features can be returned from the service and show them in the web map. The type of requests that are sent out from the Map Viewer to the service are query requests that include parameters to determine how many features can be displayed at one time.
In the past, the number of features that can draw at one time from a hosted feature service was determined by setting the maximum number of records returned by the server, also known as the Max Record Count. The Max Record Count can be set in the ArcMap Service Editor dialog box when publishing the service or it is automatically assigned, depending on the publishing workflow used. When working with a typical query request, the Max Record Count still determines the number of features that can be returned from the service at one time. However, the Map Viewer currently uses a different type of query request.
Currently in the Map Viewer, the number of features that display at one time is determined by the tileMaxRecordCount property instead of the MaxRecordCount value. The tileMaxRecordCount value cannot be changed manually when publishing the service and is automatically assigned to a service definition, unlike the Max Record Count.
When displaying features, the Map Viewer uses the tileMaxRecordCount of the service along with the current extent of the web map. The extent of the web map is broken up into sections that are referred to as 'tiles', which are not visible on the map. A request is sent out to the service for each tile that is present in the extent of the Map Viewer. The tileMaxRecordCount of the service limits the number of features that are displayed within each tile. If the number of features within a tile is less than the tileMaxRecordCount, all features within this tile can be displayed. If the number of features within a tile exceeds the tileMaxRecordCount, not all features can be displayed and the “Layer Did Not Draw Completely” warning message is returned.
When viewing the REST endpoint/URL of a service, the value for the tileMaxRecordCount parameter is not visible in the same way as the Max Record Count. The value for tileMaxRecordCount can only be seen through the Admin view of the service's REST endpoint. To access this page add "/admin" to the service URL, between “/rest” and “/services”. For example:
Note: To access the Admin view, one must be the owner of the service.
From the Admin view of the REST endpoint, navigate to “Update Definition” at the bottom of the page and find the tileMaxRecordCount property within the definition details. In the image below, the tileMaxRecordCount is set to 4000 by default. This means that when the Map viewer requests to view the service, only 4000 features per tile can be displayed. For point features, the tileMaxRecordCount defaults to 8000. For polylines and polygons, this value is a default of 4000, because there are more vertices in these features.
As you zoom in or out on the web map and the extent changes, the number of tiles in that extent may or may not change. The basemap that the service is displaying on top of is divided into a defined grid of tiles for each scale level. As you zoom in, the tiles become smaller as compared to the previous scale levels and less features are expected to draw within each tile. Therefore, the warning message is less likely to appear. Conversely when zooming out, the tiles become larger as compared to the previous scale levels and more features can fit into just one tile. Only 4000 total features can be displayed per tile and the warning message is more likely to appear.
There is currently no way to change the tileMaxRecordCount parameter when publishing the service or through updating the service definition at REST. However, the maxRecordCountFactor can be changed through updating the service definition. To update the service definition, browse to the Admin view of service URL as described above. Chose the layer then the Update Definition supported operation, Now find the parameter for maxRecordCountFactor. By default, the value of this parameter is 1. If the goal is to increase the tileMaxRecordCount so that more features are able to draw in each tile, increase this value to be higher than 1. To decrease the number of features that draw in each tile, decrease the value to less than 1.
Note: It is not recommended to make changes to the maxRecordCountFactor, as increasing this value can affect browser performance.