Each Layer I add to my map goes into its own custom pane. Each custom pane is assigned a zindex starting with 401 so I can control the stacking order. I do the following.
1. Add FeatureLayer, pane = "pane_401", zindex = 401
2. Add DynamicMapLayer, pane = "pane_402", zindex = 402
3. Remove the FeatureLayer from the map
4. Add the FeatureLayer, pane = "pane_403", zindex = 403
The FeatureLayer should be on top of the DynamicMapLayer but it is not, it is underneath.
If I am only adding/deleting DynamicMapLayers then the stacking order on the map is fine.
Obviously there is something about FeatureLayer that I am not understanding.
Can anyone point me in the right direction?
Solved! Go to Solution.
Apparently if you have a FeatureServer layer that you:
add to the map
remove from the map
add to the map again
then when you re-add it to the map you *must* use the original pane where you placed the FeatureServer layer. It is OK to change the zindex to control the stacking order. But you should not make a new pane when you add FeatureServer data that you previously added to your map and then deleted.
My map works fine now.
Apparently if you have a FeatureServer layer that you:
add to the map
remove from the map
add to the map again
then when you re-add it to the map you *must* use the original pane where you placed the FeatureServer layer. It is OK to change the zindex to control the stacking order. But you should not make a new pane when you add FeatureServer data that you previously added to your map and then deleted.
My map works fine now.