maxRecordCount property of ArcGISDynamicMapServiceLayer

3936
2
05-13-2015 11:52 AM
YohanBienvenue
Occasional Contributor II

Hi,

esri/layers/ArcGISDynamicMapServiceLayer has a maxRecordCount property like this:

<Number> maxRecordCount

The maximum number of results that can be returned from query, identify and find operations. Requires ArcGIS Server version 10.1 or greater. (Added at v2.6)

I expected this property to override the maxRecordCount set in the map service (which is 1000 by default).

My problem is that right now I set this maxRecordCount property to 100 but when I make a spatial query on the layer 1000 results are returned anyway.

Also when inspecting the request of the query I don't see this limit of 100 anywhere in the query parameters.

We are using ArcGIS Server 10.1 and version 3.13 of the JavaScript API

Did I misunderstand or doing something wrong?

Thanks

Code:

                    this.dynamicMapServiceLayer = new ArcGISDynamicMapServiceLayer(parameters.url, {

                        opacity: parameters.opacity,

                        maxRecordCount: parameters.maxRecordCount

                    });

  1. GET request parameters of Query:
  2. Query String Parametersview sourceview URL encoded
    1. f:json
    2. where:
    3. returnGeometry:true
    4. spatialRel:esriSpatialRelIntersects
    5. geometry:{"rings":[[[271363.347754655,5137593.251916758],[287039.4222343921,5137593.251916758],[287039.4222343921,5126301.73822563],[271363.347754655,5126301.73822563],[271363.347754655,5137593.251916758]]],"spatialReference":{"wkid":32187}}
    6. geometryType:esriGeometryPolygon
    7. inSR:32187
    8. outFields:Matricule
    9. outSR:32187
0 Kudos
2 Replies
RickeyFight
MVP Regular Contributor

Yohan,

One option would be to change the service.

You can change 1000 to 100 here:

0 Kudos
YohanBienvenue
Occasional Contributor II

Rickey,

Yes we already know about this, and this is the 1000 limit I mentioned. However we have a lot of services and we'd like to avoid manually changing this server side for each client. For us it would be more convenient to have a simple maxRecordCount parameter for each of our client and pass it client side in the layer configuration.

I did see in the documentation that the maxRecordCount is not really an option you can pass when creating the layer. But I tried setting it after and got the same result.

                    this.dynamicMapServiceLayer = new ArcGISDynamicMapServiceLayer(parameters.url, {

                        opacity: parameters.opacity

                    });

                    this.dynamicMapServiceLayer.maxRecordCount = parameters.maxRecordCount;

Thanks

0 Kudos