Select to view content in your preferred language

Limit features from featureLayer to visible extent

765
2
Jump to solution
01-04-2023 01:43 AM
ITApplications
Occasional Contributor

Hi all, is it possible to get a FeatureLayer to limit features that are displayed on the map to just the current map extent that I'm viewing?

My featureLayer has roughly 280K features covering the entire county. I've restricted the scale at which the features show, so you have to be zoomed into a small area before they load. When the features are displayed it's loading all 280k features onto the map which can take 1-2 mins. Once all features are loaded, it's fine and you can zoom around the map and select features with no issue, however that's not what I require. I'd like it to just load on the area I'm viewing and hopefully that will vastly improve the initial performance.

This map is going to be customer facing and will be used to log an issue against a feature via the popup. With the current initial load time it would be unacceptable for use.

I've seen something called queryExtent but I'm not sure how I would implement it?

Thanks

Ricky

0 Kudos
1 Solution

Accepted Solutions
JoelBennett
MVP Regular Contributor

You may find the solution to this here.

View solution in original post

2 Replies
JoelBennett
MVP Regular Contributor

You may find the solution to this here.

ITApplications
Occasional Contributor

Hi Joel

Thank you so much for the link which lead me to the solution. Following the advice I've applied the following to the beginning of my code:

 

<script>
      var dojoConfig = {
        has: {
          "featurelayer-snapshot-enabled": 0,
        }
      };
    </script>

 

All I can say is wow what a difference in performance! The features now load in my view in the blink of an eye rather than an agonising wait whilst it loaded data for the whole county!

Thanks again, Ricky.

0 Kudos