FeatureLayer Load is Slow

4637
5
05-05-2011 06:59 AM
by Anonymous User
Not applicable
Original User: ereed

Hello,

I am adding polygon and line map tips to my application, using FeatureLayer. It works, but the two feature layers are taking a long time (30 seconds each) to load. The tiled and dynamic layer load fairly quick, but then everything freezes while the two feature layers load. Once loaded, everything works great.
Anybody have any idea how to spped this up?

<esri:FeatureLayer id="livemap2_A"
graphicAdd="graphicAddHandler(event)"
mode="onDemand" useAMF="false" useHandCursor="false"
outFields="[siteid,sitename,catid]"
url="http://xxx/ArcGIS/rest/services/xxx/MapServer/1">
  <esri:symbol>
   <esri:SimpleFillSymbol style="solid" alpha="0.0" />
  </esri:symbol>
</esri:FeatureLayer>

public function graphicAddHandler(event:GraphicEvent):void
{
var graphic:Graphic = event.graphic;
graphic.addEventListener(MouseEvent.ROLL_OVER, rollOverHandler);
graphic.addEventListener(MouseEvent.ROLL_OUT, rollOutHandler);
}
private function rollOverHandler(event:MouseEvent):void
{
const graphic:Graphic = event.target as Graphic;
myMap.infoWindow.styleName="InfoSymbolContainer1";
myMap.infoWindow.show(myMap.toMapFromStage(event.stageX, event.stageY)); 
}
  
private function rollOutHandler(event:MouseEvent):void
{
const graphic:Graphic = event.target as Graphic;
if (graphic)
{
     myMap.infoWindow.hide();
}
}
0 Kudos
5 Replies
by Anonymous User
Not applicable
Original User: vandrunenan

What is the geometric complexity of the features you are trying to load? With FeatureLayers, you are pulling all of that spatial data (within the map extent) over the wire to get the features to draw. As well, if you are using JSON (as opposed to AMF, which is only in AGS 10), the parsing of the data is particularly slow. Generalizing the spatial data is one approach that could help speed things up.
0 Kudos
IvanBespalov
Occasional Contributor III
We had the same problem. Parsing polygon geometries takes a lot of time.
1 - We do not show map tips at all scales - for example in map full extent (scale 4000000) we have about 10000 features - its not possible quickly load and parse all geometries from server.
featureLayer.minScale = 100000;
featureLayer.maxScale = 0;


2 - By default we do not turn map tips on. We have toolbar, where client can turn on map tips for selected layers.
0 Kudos
by Anonymous User
Not applicable
Original User: odoe

We had similar issues with polygons and verifying we had spatial indexes in SDE helped. You'll also see some improvement if you are able to move to AGS 10 and set useAMF=true.
0 Kudos
HaroldBostic
Occasional Contributor II
0 Kudos
by Anonymous User
Not applicable
Original User: AnastasiaAourik

My featurelayer load is slow (on javascript api) ok on silverlight api...

In javascript api, I am messing with minScale to try and have the layer NOT draw but it always seems to be drawing...
I even try
        featureLayer.minScale = 1;
which should certainly not draw...

Can you tell me what I should do.
0 Kudos