mihkelo

Possible bug in 10.1 prerelease FeatureLayer

Discussion created by mihkelo on Mar 13, 2012
Latest reply on Mar 13, 2012 by jeff.pace
Hi,
I found a weird behavior for FeatureLayer with mode: MODE_ONDEMAND.
Seems that server ignores geometry filter and return always all layers features. It happens only line types. With point types it seems to work. Other datatypes not tested.
It also happens for querytasks.
Can anybody confirm that it is happen also for them? Or is it service configuration/misconfiguration problem?

I use just most simple example:

<!-- ArcGIS API for JavaScript -->
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.7compact"></script>
<script type="text/javascript">

/* load esri sources */
dojo.require("esri.map");
dojo.require("esri.layers.graphics");
dojo.require("esri.layers.FeatureLayer");
var map;
var chains;
  
// initialize map
function init(){
   
map = new esri.Map('arcmap', {
 extent: new esri.geometry.Extent({
  xmin:2726026,
  ymin:8424580,
  xmax:2822643,
  ymax:8472353,
  spatialReference: {
   wkid:102100
  }
 }),
 navigationMode: 'css-transform',
  fadeOnZoom: true
 });
   
 // init map events
 dojo.connect(map,'onLoad',function(m){
  // define layer
  var url = 'http://myserver/arcgis/rest/services/Chains/MapServer/2';
  chains = new esri.layers.FeatureLayer(url, {
   mode: esri.layers.FeatureLayer.MODE_ONDEMAND
  });
    
  // bind layer content change to update panel content
  dojo.connect(chains,'onUpdateEnd',function(){
   console.log(chains.graphics.length);
  });
    
  // add layer to map
  map.addLayer(chains);
 });
   
 // add baselayer
 var url = 'http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer';
 var bm = new esri.layers.ArcGISTiledMapServiceLayer(url);
 map.addLayer(bm);
}
  
/* initialize map */
dojo.addOnLoad(init);

</script>


EDIT: Found some additional information
Underlaying data had joins in it. After it was exported into new feature class, the problem was solved.

Outcomes