I have the Identify task working with my data via a sample (I added my map service into the sample to test things), but when I try to add the Identify task to my existing code, I can't get the popup window to work correctly. I get text in the top left of my map window, but you can't really see all of it. Any idea what I'm doing wrong?
wolfley is right, change esri.tasks.IdentifyParameters.LAYER_OPTION_VISIBLE in esri.tasks.IdentifyParameters.LAYER_OPTION_ALL and your sample works correctly. You have some layer turned off in your mxd because when you load the page some checkboxes in the TOC are unchecked. You cant identify all the layers that are not initially checked. All points are unchecked as you can see.
The esri.tasks.IdentifyParameters.LAYER_OPTION_VISIBLE option does not use the current visibility in the viewer but uses the visibility in the mxd, so you should use the LAYER_OPTION_ALL option to identify both visible and unvisible layers. If you want to identify only the sublayers currently visible in the viewer u have to save an array with the ids of visible layers every time you change the toc and then pass that array to the identiy task through the layerIds parameter (Class: IdentifyParameters).
Another issue I'm having is that it won't identify my point data. It seems to only highlight and identify my county layer. Even after I take the county layer out of the task, it won't identify the point and highlights the county. Any thoughts?
wolfley is right, change esri.tasks.IdentifyParameters.LAYER_OPTION_VISIBLE in esri.tasks.IdentifyParameters.LAYER_OPTION_ALL and your sample works correctly. You have some layer turned off in your mxd because when you load the page some checkboxes in the TOC are unchecked. You cant identify all the layers that are not initially checked. All points are unchecked as you can see.
The esri.tasks.IdentifyParameters.LAYER_OPTION_VISIBLE option does not use the current visibility in the viewer but uses the visibility in the mxd, so you should use the LAYER_OPTION_ALL option to identify both visible and unvisible layers. If you want to identify only the sublayers currently visible in the viewer u have to save an array with the ids of visible layers every time you change the toc and then pass that array to the identiy task through the layerIds parameter (Class: IdentifyParameters).
Thanks! Seems like that works. Maybe the terminology should be changed though...changing it to VISIBLE, to me, seems like it should work on all layers that are seen.