AnsweredAssumed Answered

Cannot get featureLayer to display under DynamicMapServiceLayer

Question asked by garethmann on Jan 20, 2012
Latest reply on Jan 23, 2012 by garethmann
I am trying to add 2 layers to my map, 1 featureLayer and 1 dynamicMapServiceLayer. The featureLayer needs to show up underneath the dynamicMapServiceLayer.

For some reason if I try to add the featurelayer first I get a "type error" in

arguments: Array[2]
get message: function getter() { [native code] }
get stack: function getter() { [native code] }
set message: function setter() { [native code] }
set stack: function setter() { [native code] }
type: "non_object_property_load"
__proto__: Error

If I add the featureLayer in after adding the dynamicMapServiceLayer it works fine and I get no error. However I need the featureLayer to be under the dynamicMapServiceLayer not ontop. I have tried to add it to the map with an index of 0 (map.addLayer(featureLayer,0)) but it still puts it on top. I have tried to use "map.reorderLayer" but it does not seem to do anything, it still shows up on top. What am I doing wrong and why will the featureLayer not show up under the dynamicMapServiceLayer?

Here is my page: