CSVLayer maxRecordCount

856
6
Jump to solution
05-08-2014 09:23 AM
DawenXie
New Contributor III
I really like the CSVLayer in version 3.9 of the API! What I want to do is simple: display the points in a CSV file. I run into problem when there are more than 1000 points. I have been trying to set maxRecordCount when I create the CSVLayer (see below), but it still renders 1000 points. Any help? Thanks!

csv = new CSVLayer("./demo.csv", {                 id: "locations_in_bbox",                 maxRecordCount: 3000             });
0 Kudos
1 Solution

Accepted Solutions
JohnGravois
Frequent Contributor
Dawen, because we have no concept of readonly properties in JavaScript, maxRecordCount is a property of a FeatureLayer that is technically writable, but is really only intended to learn what value has been set by ArcGIS Server when interacting with a particular service.

in general, the same concepts for all other graphicsLayers is relevant to a CSV layer.  its usually not an optimal user experience to have people interacting with more than 1,000 individual features.

Determining Limits for Map Graphics
https://developers.arcgis.com/javascript/jshelp/limits_for_graphics.html

View solution in original post

0 Kudos
6 Replies
JohnGravois
Frequent Contributor
Dawen, because we have no concept of readonly properties in JavaScript, maxRecordCount is a property of a FeatureLayer that is technically writable, but is really only intended to learn what value has been set by ArcGIS Server when interacting with a particular service.

in general, the same concepts for all other graphicsLayers is relevant to a CSV layer.  its usually not an optimal user experience to have people interacting with more than 1,000 individual features.

Determining Limits for Map Graphics
https://developers.arcgis.com/javascript/jshelp/limits_for_graphics.html
0 Kudos
DawenXie
New Contributor III
Thanks for your reply John! I understand 1000 is a big number, if I have to change it to 1500 or so, can you tell me how to set it  if the source is a csv file, there's not ArcGIS Server involved in this case. In my case, I display csv.graphics.length and the max value I see is 1000.

Dawen

Dawen, because we have no concept of readonly properties in JavaScript, maxRecordCount is a property of a FeatureLayer that is technically writable, but is really only intended to learn what value has been set by ArcGIS Server when interacting with a particular service.

in general, the same concepts for all other graphicsLayers is relevant to a CSV layer.  its usually not an optimal user experience to have people interacting with more than 1,000 individual features.

Determining Limits for Map Graphics
https://developers.arcgis.com/javascript/jshelp/limits_for_graphics.html
0 Kudos
JohnGravois
Frequent Contributor
dawen,
you might consider publishing the data as an ArcGIS Online hosted feature service and updating the maxRecordCount property of the service itself.

http://forums.arcgis.com/threads/94744-Is-it-possible-to-change-the-Max-Record-Count-on-an-AGOL-host...
0 Kudos
DawenXie
New Contributor III
Thanks again for your reply. This is not doable in my case as the source of csv is a dynamic web service that generates csv file. We will plot up to 1000 points and provide a way for end user to download the 'original' csv data.

dawen,
you might consider publishing the data as an ArcGIS Online hosted feature service and updating the maxRecordCount property of the service itself.

http://forums.arcgis.com/threads/94744-Is-it-possible-to-change-the-Max-Record-Count-on-an-AGOL-host...
0 Kudos
BjornSvensson
Esri Regular Contributor
Another option might be to not use the CSVLayer, but instead have your application read the CSV file directly, then populate a featurelayer with that information.

There's a basic sample at https://developers.arcgis.com/javascript/jssamples/exp_dragdrop.html that does this (and other things).
0 Kudos
JimSibbald
Esri Contributor
Further to the previous conversation the CSVLayer is excellent but limited.  Our intent is to allow users to add their own CSV file to the Map to render in that session only, the limit of 1,000 is not acceptable to our users who may wish to add up to 40,000 records.  Creating it as a feature layer online or not is a non-starter and as we do not use HTML 5 the workaround will not be applicable.  How does one set maxRecordCount to work properly?
0 Kudos