Hi Derek,
I figured out how to use the callback function and my code is working well for now. Thanks for your help. I have tried this:
dojo.connect(stateFeatureLayer, "onSelectionComplete", mapM.addLayer(stateFeatureLayer));
This works well, but I am trying to change it to this but it does not work:
dojo.connect(stateFeatureLayer, "onSelectionComplete", function() {
mapM.addLayer(stateFeatureLayer);
});
Do you see a potential problem in this?
Thanks
Samir