3

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

1 Answer 1

4

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.

6
  • thanks for the reply..I will check and let you know..thanks once again : )
    – Sunil
    Dec 22, 2012 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. Mar 18, 2013 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 Mar 18, 2013 at 5:20
  • thats true...I am going through it.In my case only 0 layer no other layers..
    – Sunil
    Mar 18, 2013 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, 2013 at 7:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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