Select to view content in your preferred language

identify - no results

2733
21
04-09-2010 09:41 AM
GaryBushek
Deactivated User
Im having some issues with the identfy widget and im not sure if its the widget or my map service. I have about 20 layers and only about 4 or 5 show results when identifying. So it works for some layers and not others. To rule out the tolerance being a factor, some of the layers that dont work are polygon features so im definitely hitting the features but it returns "no results". Its not throwing any errors in the code. I have it set to identify visible layers only and I zoom to the features im trying to identify so I can physically see the features and it just doesnt identify. I compared the identifyParams.layerIds with my rest service endpoint to be sure the layer id was correct for the layer i wanted to identify on. Everything seems to look correct. It just seems to not like most of the layers for some reason. Any help is appreciated.

Thanks, Gary
Tags (2)
0 Kudos
21 Replies
RoyceSimpson
Frequent Contributor
I just published the mxd as a map service using MSD file and now the identify works.  I can put in the same parameters for the MSD based service and the standard dynamic service (geometry, layers, map extent, etc...).  One produces results, the other doesn't.

Odd indeed.
0 Kudos
RoyceSimpson
Frequent Contributor
Now I'm really confused.

Why does this return results for the 11th layer?  (Where is the documentation on this syntax?)
identifyParams.layerOption = "all:11"

But this doesn't...
identifyParams.layerOption = "all"; identifyParams.layerIds = [11];

and this doesn't seem to work when manually setting visiblelayers property properly.
identifyParams.layerOption = "visible"  ..."visible:11"
0 Kudos
RoyceSimpson
Frequent Contributor
Ok, here is the REST doc on the "all:3" syntax...

Description: The layers to perform the identify operation on. There are three ways to specify which layers to identify on:

    * top: Only the top-most layer at the specified location.
    * visible: All visible layers at the specified location.
    * all: All layers at the specified location.

Example: layers=all

Default: By default the identify operation identifies the top-most layer (i.e. layers=top)

You can either specify the layer options as mentioned above by themselves or specify the layer option in conjunction with a list of layer IDs. When both the layer option as well as the layer IDs are specified, the server treats it as a boolean "AND" operator. For example, if the parameter is specified as: layers=visible:2,5 only layers with IDs 2 and 5, if visible, are identified.
0 Kudos
BradOleson
Emerging Contributor
I'd be happy if it ID's on ANY of my layers, and it is set to "all".
0 Kudos
DasaPaddock
Esri Regular Contributor
identifyParams.layerOption = "all"; identifyParams.layerIds = [11]; is the proper use of the API. You could call identifyParams.layerOption = "all:11" a shortcut way of doing the same thing. Either way, the REST request should be the same. Are they not? What version of the API are you using?
0 Kudos
RoyceSimpson
Frequent Contributor
API 2.0 update 3.

This is the only solution that i've gotten to fully work so far.
I have to use the "all" option since "visible" never returns results no matter how many layers I set "visibleLayers" for.
Then I set the layerIds property to the current visibleLayers property.

identifyParams.layerOption = "all";
identifyParams.layerIds = assetMap.visibleLayers.source;
0 Kudos
DasaPaddock
Esri Regular Contributor
This is the correct usage and behavior. When identifying on "visible" layers, it's working against the default layer visibilities as defined in the service/mxd, not the overrides you've made on the client on the ArcGISDynamicMapServiceLayer.
0 Kudos
RoyceSimpson
Frequent Contributor
Thanks for the info.
0 Kudos
BradOleson
Emerging Contributor
I inadvertently found something that may be affecting the ID issue: projection.

I'm working (in another forum thread) on getting my maps to be projected in UTM (for a grid layer that must be in that projection).  I changed the way my map loads by taking out the StreetMap and Satellite maps and just having mine load, with the extents changed to UTM coordinates (to match my projected map service layer).  Now, not only is the grid layer correct, but the ID tool works fine on all of my layers.  Why wasn't it working when projected to overlay the StreetMap data in Lat/Lon, but now it works?
0 Kudos
DasaPaddock
Esri Regular Contributor
0 Kudos