Help with Identify Task

1048
10
Jump to solution
08-23-2012 10:38 AM
JessicaKnight1
New Contributor III
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?

I have attached my code if someone can take a look. I used this sample: http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/find_popup.htm...
0 Kudos
1 Solution

Accepted Solutions
DavideLimosani
Occasional Contributor II
Hi jessica,

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).

Davide

View solution in original post

0 Kudos
10 Replies
ReneRubalcava
Frequent Contributor
I think you need to add the popup.css file in your page.
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.8/js/esri/dijit/css/Popup.css"> 


Yeah, I added it in your sample it shows up correctly now.
0 Kudos
JessicaKnight1
New Contributor III
Perfect. Thanks. I knew it had to be something simple. Sometimes just helps to have another set of eyes on it to see it!
0 Kudos
JessicaKnight1
New Contributor III
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?
0 Kudos
VernWolfley
New Contributor III
I think because you have some of the layers in your MXD turned off if you change your code to this in the Identify Parameters it should work.


identifyParams.layerOption = esri.tasks.IdentifyParameters.LAYER_OPTION_ALL;
0 Kudos
JessicaKnight1
New Contributor III
Even when I turn on the layers, it won't identify them. And it doesn't seem to want to if I do the ALL option either.
0 Kudos
JessicaKnight1
New Contributor III
Anyone? I want to be able to identify my point data!
0 Kudos
PramodHarithsa1
Occasional Contributor II
Hi Jessica,

This thread might help you
http://forums.arcgis.com/threads/59247-URL-Parameters-Sample-(Polygons-vs.-Points)

and you can also have a look at this
http://jsfiddle.net/xV8bh/
0 Kudos
DavideLimosani
Occasional Contributor II
Hi jessica,

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).

Davide
0 Kudos
JessicaKnight1
New Contributor III
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.
0 Kudos