Select to view content in your preferred language

FeatureLayer takes a long time to Load

1243
5
Jump to solution
10-31-2012 08:41 AM
SmaranHarihar
Deactivated User
I am using dijit.form.Select to load featureLayers as per the user selection in the Select box. I am able to successfully load the featureLayer but it takes really long for the Layer to be displayed (around 20+ sec).

Any idea how I can reduce the this time? This is my application.

Click on the docked floating pane name "Mapping the Data". When the floating pane opens, change the selection of the Select Combo Box. You will see another select box appear. Select any layer (lyr 0/1/2) and you will see that it takes a bit of time before it appears.

Could it be because of the file size of the layer? There are a lot of fields in the layer.
0 Kudos
1 Solution

Accepted Solutions
SmaranHarihar
Deactivated User

var educationLayer = new esri.layers.ArcGISDynamicMapServiceLayer(   "http://webgis.arizona.edu/ArcGIS/rest/services/webGIS/Demographics/MapServer",   {visibleLayers: [0]} );


Steve


I was able to get it working making the following changes,

var educationLayer = new esri.layers.ArcGISDynamicMapServiceLayer(   "http://domain/ArcGIS/rest/services/webGIS/Demographics/MapServer" ); educationLayer.setVisibleLayers([0]);

View solution in original post

0 Kudos
5 Replies
StephenLead
Honored Contributor
Could it be because of the file size of the layer? There are a lot of fields in the layer.


While there are a lot of fields, you're doing the right thing in terms of limiting them to just the ones you need.


var ftrLyr = new esri.layers.FeatureLayer(result,{
  mode: esri.layers.FeatureLayer.MODE_SNAPSHOT,
  outFields: ["NAME","STATE_NAME"]
});


I think the problem is due to the size of the layer - the soil layer is about 2Mb in size, which will take a while to download.

At the full scale, you're showing hundreds of tiny polygons which are too small to discern anyway. Is it an option to generalize the layer, and show States rather than Counties (or whatever) at this scale? Then show the more detailed polygons when you zoom in.

You could also try using a Dynamic or Tiled layer - there's nothing in your application which seems to require a Feature layer, which involves downloading the actual vectors to the client.

Steve
0 Kudos
SmaranHarihar
Deactivated User
While there are a lot of fields, you're doing the right thing in terms of limiting them to just the ones you need.


var ftrLyr = new esri.layers.FeatureLayer(result,{
  mode: esri.layers.FeatureLayer.MODE_SNAPSHOT,
  outFields: ["NAME","STATE_NAME"]
});


I think the problem is due to the size of the layer - the soil layer is about 2Mb in size, which will take a while to download.

At the full scale, you're showing hundreds of tiny polygons which are too small to discern anyway. Is it an option to generalize the layer, and show States rather than Counties (or whatever) at this scale? Then show the more detailed polygons when you zoom in.

You could also try using a Dynamic or Tiled layer - there's nothing in your application which seems to require a Feature layer, which involves downloading the actual vectors to the client.

Steve


Thanks for the reply Steve. Initially I did think of using the Dynamic layer but the Soil, Climate that you are seeing are the MXDs and the FeatureLayer is being used for the Layers within it. If I try to use Dynamic layer it gives me a error and I am not able to load it. What I am saying is that if I wish to use Dynamic Layer, doesn't the url need to be
http://domain/arcgis/rest/services/Soil/MapServer
but I need to use
http://domain/arcgis/rest/services/Soil/MapServer/1 or 2 or 3
and that gives me a error.
Is it possible to use Dynamic Layer?
0 Kudos
StephenLead
Honored Contributor
Is it possible to use Dynamic Layer?


Take a look at the visibleLayers property. You'd use something like this:

var educationLayer = new esri.layers.ArcGISDynamicMapServiceLayer(
  "http://webgis.arizona.edu/ArcGIS/rest/services/webGIS/Demographics/MapServer",
  {visibleLayers: [0]}
);


in order to create a dynamic layer showing only the education (layer 0) dataset.

Perhaps try modifying one of the sample dynamic maps with your own data to verify that it works. Ensure that you include a reference to dynamic layers:

dojo.require("esri.layers.agsdynamic");

Steve
0 Kudos
SmaranHarihar
Deactivated User
Sorry Steven i thought that would work but it seems to be failing. here is the updated app link

I am getting this error CustomError: Error in protected function: !283
0 Kudos
SmaranHarihar
Deactivated User

var educationLayer = new esri.layers.ArcGISDynamicMapServiceLayer(   "http://webgis.arizona.edu/ArcGIS/rest/services/webGIS/Demographics/MapServer",   {visibleLayers: [0]} );


Steve


I was able to get it working making the following changes,

var educationLayer = new esri.layers.ArcGISDynamicMapServiceLayer(   "http://domain/ArcGIS/rest/services/webGIS/Demographics/MapServer" ); educationLayer.setVisibleLayers([0]);
0 Kudos