Select to view content in your preferred language

Performance issues with feature layer

2589
1
06-29-2012 07:46 AM
EdwardSon
Emerging Contributor
Why would one see performance issues in feature layer depending on how it's added to the Map Contents control?

Have feature layers that are organized hierarchically.

In the app builder can add the root node, which adds all child layers.  In the viewer, can actually expand each node and see child layers.
Or can add each child layers individually in the app builder, which gives a flat structure in the viewer map control.

The difference is in performance for one of the feature layers.  Adding them in hiearchical mode seems to give higher performance then as flat structure.
The issue is I have added the layers using the second method, b/c that way each layer is configurable from the app builder.
Using the first method, only allows configuration of the root node.

Is it possible to use the second method, and still modfiy the layer from the code so as to have it equal the performance of the first method....

I have copied the map.xaml configuration setting for each method above (removing some of the columns to limit size):

1) adding root node only:

</esriMapping:LayerInformation.LayerJson>
   </esriMapping:LayerInformation>
   <esriMapping:LayerInformation Name="2D Horizons" DisplayField="NAME" ID="4" PopUpsEnabled="false">
    <esriMapping:LayerInformation.Fields>
     <esriMapping:FieldInfo Name="OSP_KEY" DisplayName="OSP_KEY" AliasOnServer="OSP_KEY" DomainSubtypeLookup="None" />
     <esriMapping:FieldInfo Name="NAME" DisplayName="NAME" AliasOnServer="NAME" DomainSubtypeLookup="None" />
    </esriMapping:LayerInformation.Fields>
    <esriMapping:LayerInformation.LayerJson>{"layerDefinition":{
  "currentVersion" : 10.02,
  "id" : 4,
  "name" : "2D Horizons",
  "type" : "Feature Layer",
  "description" : "",
  "definitionExpression" : "",
  "geometryType" : "esriGeometryPolyline",
  "copyrightText" : "",
  "parentLayer" : {"id" : 1, "name" : "Interpretation"},
  "subLayers" : [],
  "minScale" : 0,
  "maxScale" : 0,
  "defaultVisibility" : false,
  "extent" : {
    "xmin" : 8.42483106396115,
    "ymin" : -4.3580950440476,
    "xmax" : 10.884721450394,
    "ymax" : 0.948677222407349,
    "spatialReference" : {
      "wkid" : 4326
    }
  },
  "hasAttachments" : false,
  "htmlPopupType" : "esriServerHTMLPopupTypeAsHTMLText",
  "drawingInfo" : {"renderer" :
    {
      "type" : "simple",
      "symbol" :
      {
        "type" : "esriSLS",
        "style" : "esriSLSSolid",
       
        "color" : [
          255,
          0,
          0,
          255
        ],
        "width" : 2
      },
      "label" : "",
      "description" : ""
    },
    "transparency" : 0,
    "labelingInfo" : null},
  "displayField" : "NAME",
  "fields" : [
    {
      "name" : "OSP_KEY",
      "type" : "esriFieldTypeString",
      "alias" : "OSP_KEY",
      "length" : 1024},
    {
      "name" : "NAME",
      "type" : "esriFieldTypeString",
      "alias" : "NAME",
      "length" : 100}
],
  "typeIdField" : null,
  "types" : null,
  "relationships" : [],
  "capabilities" : "Map,Query,Data"
}}</esriMapping:LayerInformation.LayerJson>

2) Adding each layer individually:

<esri:FeatureLayer ID="6cd00a9e6e394691ade3600dd80e18dc" Visible="False" RendererTakesPrecedence="True" Url="http://hacsstc102/arcgis/rest/services//P_OPSGeoframe/MP_Geoframe/MapServer/4" Mode="OnDemand" OutFields="NAME,PRIMARYDOMAIN,DATASOURCE,INTERPRETER,LASTMODIFIED,TRACESTART,TRACEEND,TRACEDELTA,DATASOURCENAME,PROJECT,DATASOURCETYPENAME,DATASOURCETYPEVERSION,XYVALUESUNITZ">
  <esriMapping:LayerExtensions.LayerName>2D Horizons</esriMapping:LayerExtensions.LayerName>
  <esriMapping:LayerExtensions.DisplayUrl>http://hacsstc102/arcgis/rest/services//P_OPSGeoframe/MP_Geoframe/MapServer/4</esriMapping:LayerExtensions.DisplayUrl>
  <esriMapping:LayerExtensions.LayerInfos />
  <esriExtensibility:LayerProperties.IsPopupEnabled>true</esriExtensibility:LayerProperties.IsPopupEnabled>
  <esriExtensibility:LayerProperties.IsVisibleInMapContents>true</esriExtensibility:LayerProperties.IsVisibleInMapContents>
  <esriMapping:LayerExtensions.GeometryType>Polyline</esriMapping:LayerExtensions.GeometryType>
  <esriMapping:LayerExtensions.GradientBrush>
   <LinearGradientBrush>
    <GradientStop Color="#FF090991" Offset="0" />
    <GradientStop Color="#FFB6EDF0" Offset="1" />
   </LinearGradientBrush>
  </esriMapping:LayerExtensions.GradientBrush>
  <esriMapping:LayerExtensions.Fields>
   <esriMapping:FieldInfo Name="OSP_KEY" DisplayName="OSP_KEY" VisibleOnMapTip="false" VisibleInAttributeDisplay="false" AliasOnServer="OSP_KEY" DomainSubtypeLookup="None" />
   <esriMapping:FieldInfo Name="NAME" DisplayName="NAME" AliasOnServer="NAME" DomainSubtypeLookup="None" />
     </esriMapping:LayerExtensions.Fields>
  <esriMapping:LayerExtensions.DisplayField>NAME</esriMapping:LayerExtensions.DisplayField>
  <esriMapping:LayerExtensions.PopUpsOnClick>True</esriMapping:LayerExtensions.PopUpsOnClick>
  <esri:GraphicsLayer.Renderer>
   <esri:SimpleRenderer>
    <esri:SimpleRenderer.Symbol>
     <esriFSSymbols:SimpleLineSymbol>
      <esriMapping:SymbolExtensions.Json>{"type":"esriSLS","style":"esriSLSSolid","color":[255,0,0,255],"width":2}</esriMapping:SymbolExtensions.Json>
     </esriFSSymbols:SimpleLineSymbol>
    </esri:SimpleRenderer.Symbol>
   </esri:SimpleRenderer>
  </esri:GraphicsLayer.Renderer>
</esri:FeatureLayer>
0 Kudos
1 Reply
BrianLeroux
Frequent Contributor
I think I follow what you are saying. When you add the entire srvice in the builder you are actaully adding a Dynamic Map service (esri:ArcGISDynamicMapServiceLayer). When you add just the child layer you are adding a Feature Layer (esri:FeatureLayer). These layer types are handled differentl from one another. The Dynamic Service layer is drawn on the server where as the Feature Layer is drawn by the client. the Dynamic Service Layer is much faster on the client side. I have about 100,000 points fairly quickly. With the Feature Layer I limit my services to about 5,000 so the client doesn't hang waiting for the features to draw.

Unfortunately the Dynamic Service Layer is limited in what you are actually able to configure. i belive Pop-Ups are the only thing you can configure seperately for each layer when working with a Dynamic Map Service Layer. I hope this helps...
0 Kudos