Editor widget

791
2
09-07-2012 11:13 AM
VIKRANTKRISHNA
New Contributor III
I have editing application with about 10 layers to edit. Everything works fine when I have all the layers turned on all the time and template picker shows all the symbols. Problem comes when I try to hide and show the layers and update template picker dynamically as layers get turned off and on from the checkbox. Problem that I am seeing is with overlapping features in this case, sometimes when I click on the point feature at the junction of two line features the infowindow shows the title of point feature but displays the attribute table of line feature. Further, when I click on next feature or previous feature button on infoWindow, this table get fixed automatically. In the same code everything works fine if I don't toggle layers and update template picker.


In second case, when I use attributeInspector digit instead of editor widget, I loose the capability of geometry editing. Is there is a workaround in this case?
0 Kudos
2 Replies
JohnGravois
Frequent Contributor
Vikrant and i were able to confirm that as long as the feature layers are instantiated in the order they are displayed in the map, the infoWindow displays the attributes which correspond with the correct layer.

//instantiate the featureLayer you would like to draw on top first
pointsOfInterest = new esri.layers.FeatureLayer("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/0",{
  mode: esri.layers.FeatureLayer.MODE_ONDEMAND, //QUERY_SELECTION is working as well
  outFields: ['*']
});
//second
WildfireLine = new esri.layers.FeatureLayer("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/1",{
  mode: esri.layers.FeatureLayer.MODE_ONDEMAND, //QUERY_SELECTION is working as well
  outFields: ['*']
});
//polygons last
evacuationPerimeter = new esri.layers.FeatureLayer("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/2",{
  mode: esri.layers.FeatureLayer.MODE_ONDEMAND, //QUERY_SELECTION is working as well
  outFields: ['*']
});

//in the array of featureLayers to add, specify the bottom layer first    
map.addLayers([evacuationPerimeter,WildfireLine,pointsOfInterest]);
0 Kudos
VIKRANTKRISHNA
New Contributor III
That works perfectly!!
0 Kudos