Hi,
esri/layers/ArcGISDynamicMapServiceLayer has a maxRecordCount property like this:
Number
> maxRecordCountThe 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
});
Yohan,
One option would be to change the service.
You can change 1000 to 100 here:
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