Select to view content in your preferred language

dynamically segemented featurelayer returns only one record

703
2
06-27-2012 11:20 PM
Egan_LouisFajardo
Occasional Contributor
I have a layer that is dynamically segmented with data through an OLEDB connection. As a base layer, the contents load fine and complete. But when I use it as a FeatureLayer, always only one record is returned. Why is this so and how can I completely load the dynamically segmented layer's content?

This is the how I use the FeatureLayer:
function showFeatureRender() {

 var infoTemplate = new esri.InfoTemplate("${NAME}", "${*}");
 featuremap = new esri.layers.FeatureLayer("http://co-gis-01/ArcGIS/rest/services/dev_RTIA/rtia/MapServer/2", {
  mode: esri.layers.FeatureLayer.MODE_SNAPSHOT,
  outFields: ["*"],
  infoTemplate: infoTemplate
 });

 map.addLayer(featuremap);
 
 dojo.connect(featuremap, "onError", function(error) {
 
  alert("message: " + error.message);
 });

dojo.connect(featuremap, 'onLoad', featureLoaded);
}


The onError event does not fire, but onLoad does. I tested loading a layer that is equivalent to the dynamically segmented one (I exported and imported the layer) and it is able to load the non-dynamically segmented one fine. Are there other settings needed to be configured to deal with dynamically segmented layers in map services?
0 Kudos
2 Replies
derekswingley1
Deactivated User
Layers from a map service that are used as the basis for a Feature Layer are required to have ano ID field. If there is not object ID, only a single feature will display. You will need to add an object ID to your layer if you want to use it as a Feature Layer.
0 Kudos
Egan_LouisFajardo
Occasional Contributor
Thanks, that's it. My layer did not have an ObjectID. I modified it to have a Query Table as an event source so as to have an ObjectID, and now it can load more than one feature present in the dynamically segmented layer.

However, I notice if I increase the number of features to render, not all will be displayed. For example, one dynamically segmented layer has 200 records and all are loaded, but another layer with 2500 layers will only have about half of it rendered. Is there a limit of records that can be shown by a FeatureLayer, and if it does then how can I modify this limit? I am using ArcGIS Server 10.
0 Kudos