Select to view content in your preferred language

FeatureLayers returning all features on load

195
10
Jump to solution
Wednesday
EricLake1
Emerging Contributor

Starting around version 4.20 of the ESRI JavaScript API, we noticed that FeatureLayers began returning all features from the server when the layer is loaded or made visible, regardless of the current map extent. I now see this behavior is confirmed in the 4.33 release notes and appears to be the new standard.

We manage hundreds of map services, and some layers contain tens of thousands of features. Now, even simple web maps with only 10–15 layers can take 20–30 seconds to load, depending on how many features are in each. This is significantly affecting performance and usability.

We’ve confirmed:

  • Even if the map is zoomed in before the layer is toggled visible, all features are still fetched from the server.

  • This behavior occurs even with small test apps using basic FeatureLayers from various sources.

  • It's not specific to our server; we've tried ArcGIS Server 11 and tested with binary (PBF) format responses—no significant improvement.

Questions:

  1. Why does the FeatureLayer no longer respect the current extent when requesting features?

  2. Is this really the permanent behavior moving forward?

  3. Is the only viable solution to switch to MapImageLayer for every service that contains a large number of features?

  4. Are there any workarounds or configurations (e.g., definitionExpression, featureReduction, etc.) that can force extent-based filtering?

If this is the intended behavior, this change will significantly increase the load on our infrastructure and may require a complete overhaul of our web maps.

We’d really appreciate any insights, solutions, or confirmation from Esri or others who’ve encountered and worked around this.

Thanks in advance.

0 Kudos
10 Replies
mgeorge
Esri Contributor

You can use the flag, but just be aware that this is not officially supported and likely will change. Some old versions of enterprise had a bug where querying for count was doing a select * from the database, and this flag was only really given out to work around that. 

There's a very good chance that you will be significantly increasing the load on your backend by disabling snapshot, so just be careful to do some stress testing. 60k features is not a lot of data, and I would definitely not disable it in that case.