Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I found interesting issue while using the “identify task” tool to display information at a point.

Situation: I am displaying records by Type (A, B, C etc). When I display Type "B" records and I click on anywhere on map, it shows attributes of other records (either "A", "C", or "D")

How is this possible?

Please see the screenshots for further illustration. I also have added the code to JS Fiddle (I changed the server name).

Is this a bug, showing attributes of a hidden record?

Please check this and let me know. Thanks in advance : )

The first screenshot shows all features and an "identify" popup. The second shows only "C"-type records with an identify popup at a location of a different record type. map showing records of all Types with an identify popup map showing only "C"-Type records with an identify popup on a different record Type

Update:

I am using single layer and using the combo box to display particular layer. I researched on Google and ESRI forums

Looks like its bug and its ID NIM042441 also it can be resolve according to ESRI forum so working on the same issue..

So thanks to all : )

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

You have set up your identify parms to search in all layers with the following line of code.

identifyParams.layerOption = esri.tasks.IdentifyParameters.LAYER_OPTION_ALL

The identify task doesn't know which layers are visible in your map. In fact it doesn't even need that mapservice to be displayed in the map. And since you have set it to search in all layers, it wouldn't matter.

That's why you are getting results from all layers.

share|improve this answer
    
thanks for the reply..I will check and let you know..thanks once again : ) –  Sunil Dec 22 '12 at 18:24
    
@Sunil: That bug is incorrect and arises out out of not understanding the REST API. If you give layers=all in your identify query, it does not matter if the layer is visible or not in your client. All that matters is whether it is visible in the original Mapservice. If you need a results from a specific layer in your service, you need to pass in layers=all:1 (if you want results from only the first layer) What is given as the workaround in the forum post, is what you need to do in the first place. –  Devdatta Tengshe Mar 18 '13 at 5:14
    
For example, look at this Identify result: (tinyurl.com/allLayer) It gives you result from all layers Now look at this: (tinyurl.com/specificLayer) This gives you results only from the first layer –  Devdatta Tengshe Mar 18 '13 at 5:20
    
thats true...I am going through it.In my case only 0 layer no other layers.. –  Sunil Mar 18 '13 at 5:36
    
According to you pass the parameters thats fine...but where should I pass the parameter ? (Because you can not customize the identify task by adding parameters OR I am thinking that "onclick" I will write down some function which will check whether that point is in combo-box or not) & thanks for your explanation too..I am quite new to the GIS development –  Sunil Mar 18 '13 at 7:38
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.