Does ESRI Leaflet load all features?

7229
2
04-24-2015 03:23 PM
Labels (1)
JimO_Leary3
New Contributor II

I am using ESRI Leaflet to load an ESRI rest service layer. I am counting the number of features that it loads in my pointToLayer function and displaying that number to the screen when the layer fires the load event. The number is different every time. Also, the number gets smaller if I set the initial view extent to a higher number. So it appears that ESRI Leaflet is only loading the features within the current extent, plus some padding.

 

However, it does not always load ALL of the features within the initial view. Sometimes some features are missing and when I refresh, they appear again. I have more than 1,000 features in my Rest service, but there would never be that many in the initial view that I set.

 

I am thus wondering:

 

  • Why does ESRI Leaflet load a different number of features even when I don't change the initial view?
  • Why does it not always load ALL of the features in the initial view?
  • Is there anything that I can do about this?

 

Thanks

 

Jim

Tags (1)
0 Kudos
2 Replies
JohnGravois
Frequent Contributor

hi jim, sorry it took me so long to see this post.

its definitely expected behavior that Esri Leaflet queries the current map extent for a subset of the features stored in your actual service, but i'm surprised to hear that you're seeing an inconsistent count for a single view.

can you share a url to your service so that i can take a look?

EzraBoyd
New Contributor II

I've observed similar behavior when adding the warnings layer (12) from this server:  igems_haz (MapServer) 

The layer does not consist of more than 1,000 features, but there are days when it seems that the features contain over 1,000 vertices.  Like what you described, it doesn't always load all features and does not even load the same number when I hit reload. My assumption has been that the shear size of the layer overwhelms the memory on my computer, which leads to the inconsistent behavior.  If you're adding over 1,000 features, you also be pushing the limits of your memory.

John Gravois‌ provided some very helpful pointers on dealing with the issue here:

 https://community.esri.com/thread/187448-trying-to-figure-to-best-way-to-add-a-online-layer-to-a-lea...