Enterprise point FeatureLayers in 4.20

966
2
Jump to solution
01-14-2022 04:27 PM
RyderRoss
New Contributor II

I understand that ArcGIS JS 4.19 was changed to load *all* points from ArcGIS Online FeatureLayers into memory and that in 4.20 that was extended to also include Enterprise FeatureLayers. 

We have an Enterprise point FeatureLayer with ~350k points and we'd very much like to prevent that from occurring as it hammers our performance. 

Will there be any options to prevent this behavior? Maybe an option to choose whether it should try to load all points or not? 

Additionally, we have an issue in 4.21 and/or 4.22 where changing the definitionExpression of a layer does not remove points/clusters from the map when the definitionExpression is more restrictive but I'm not sure if that's a by-product of this issue or not. 

0 Kudos
1 Solution

Accepted Solutions
UndralBatsukh
Esri Regular Contributor

Hi there, 

So the snapshot mode (we load all features on layer load) is enabled when one of the following conditions are met, otherwise layers will fetch its data as needed:

  • If the layer has 0-80,000 points 
  • if the layer has 80,001 - 400,000 points and if the view's initial extent is greater than 10% of layer's data extent (i.e., we are not super zoomed in).

Snapshot should be very performant after the initial load. However, if you are making server side calls via refreshInterval or refresh() method, this can slow down the performance as the app has to download the entire data. 

Have you considered using client-side filters like FeatureFilter or FeatureEffect on the FeatureLayerView? If you are querying your data also have you considered using client side queries via FeatureLayerView.queryFeatures()? Setting those properties and calling the those methods on the LayerView will take place on the client-side without having to fetch data from the server side. 

I created a very simple test app where the layer is loaded in the snapshot mode. I have aded a few buttons where you can set the layer.definitionExpression versus layerView.filter. If you have the network tab open, you'll notice that setting layerView.filter does not generate network requests. 

In any case, you can opt of out your layer loading in a snapshot mode by setting featurelayer-snapshot-enabled flag to 0. You can test this flag in the test app I provided by uncommenting the script tag added towards to beginning of the app: https://codepen.io/U_B_U/pen/dyVLKaG?editors=1000

I cannot reproduce the definitionExpression issue you are describing. 

 

View solution in original post

0 Kudos
2 Replies
UndralBatsukh
Esri Regular Contributor

Hi there, 

So the snapshot mode (we load all features on layer load) is enabled when one of the following conditions are met, otherwise layers will fetch its data as needed:

  • If the layer has 0-80,000 points 
  • if the layer has 80,001 - 400,000 points and if the view's initial extent is greater than 10% of layer's data extent (i.e., we are not super zoomed in).

Snapshot should be very performant after the initial load. However, if you are making server side calls via refreshInterval or refresh() method, this can slow down the performance as the app has to download the entire data. 

Have you considered using client-side filters like FeatureFilter or FeatureEffect on the FeatureLayerView? If you are querying your data also have you considered using client side queries via FeatureLayerView.queryFeatures()? Setting those properties and calling the those methods on the LayerView will take place on the client-side without having to fetch data from the server side. 

I created a very simple test app where the layer is loaded in the snapshot mode. I have aded a few buttons where you can set the layer.definitionExpression versus layerView.filter. If you have the network tab open, you'll notice that setting layerView.filter does not generate network requests. 

In any case, you can opt of out your layer loading in a snapshot mode by setting featurelayer-snapshot-enabled flag to 0. You can test this flag in the test app I provided by uncommenting the script tag added towards to beginning of the app: https://codepen.io/U_B_U/pen/dyVLKaG?editors=1000

I cannot reproduce the definitionExpression issue you are describing. 

 

0 Kudos
RyderRoss
New Contributor II

@UndralBatsukh Thank you for this! Opting out fixed the issue! Is this something that will be maintained long-term? 

We must be triggering the second condition. We have a default extent of the whole US view and then we detect and have > 350k features. With that many features, client side filtering doesn't work well for us. 

 

0 Kudos