Select to view content in your preferred language

Slow performance when upgrading to API version 4

829
3
Jump to solution
11-03-2022 06:29 AM
AdrienFrench
Emerging Contributor

We are upgrading from the JS API version 3.X to 4.24 and we have run into a performance issue when using FeatureLayer objects. Previously we were using ArcGISDynamicMapServiceLayer objects, but these are no longer available in API version 4. 

The upgraded version seems to make far more requests to the GIS server and take much longer when panning/zooming around the map. This seems to cause the initial layer load (when we zoom in to a visible scale) to take up 10 seconds, where it was previously less than 1 second.

See the attached screenshots for comparison. In particular, the FeatureLayer seems to make many requests to /query endpoint, whereas the ArcGISDynamicMapServiceLayer does not.

Can anyone offer any explanations as to why this is happening? Is there something I am missing when configuring layers, or am I on the wrong track altogether? 

Thanks in advance,

Adrien French

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
JS_GilbertAZ
Occasional Contributor

I think that MapImageLayer would work, that should do what 3.x ArcGISDynamicMapServiceLayer did.  I use multiple MapImageLayers in my app and I have no performance issues.

Ex.

"esri/layers/MapImageLayer",MapImageLayer

dbLayer=new MapImageLayer({
url: svcUrlDB,  //rest enpoint url for MapServer
title: "Common"
});

View solution in original post

3 Replies
JS_GilbertAZ
Occasional Contributor

I think that MapImageLayer would work, that should do what 3.x ArcGISDynamicMapServiceLayer did.  I use multiple MapImageLayers in my app and I have no performance issues.

Ex.

"esri/layers/MapImageLayer",MapImageLayer

dbLayer=new MapImageLayer({
url: svcUrlDB,  //rest enpoint url for MapServer
title: "Common"
});

ReneRubalcava
Honored Contributor

@JS_GilbertAZ is correct.

The 4x equivalent to 3x ArcGISDynamicMapServiceLayer is the MapImageLayer. It has an updated API to make it easier to configure the layers in the service.

In the first screenshot, with the FeatureService, the API is going to request data in cacheable tiles, which can lead extra requests. If you are using multiple FeatureLayers to display the same layers that are in the Map Service, then that would explain the number of requests and possibly slower than expected response if they each contain a good amount of data. MapImageLayer can still perform very fast for Map Services, and if needed you can still create a FeatureLayer from a SubLayer that you an use for queries and more.

0 Kudos
AdrienFrench
Emerging Contributor

Thank you both for your replies, performance is drastically improved using the MapImageLayer!

0 Kudos