Select to view content in your preferred language

do I have to change spatial reference for map services for identify?

874
6
11-04-2010 11:43 AM
XiujuZhou
Emerging Contributor
I need to do identify for my map service layers and online editing for feature layers. both of map service and feature service are generated from a same MXD with spatial reference of Texas south centra. I use ESRI basenmap as background of my map. I can do online editing with no problem. But my mapservice layers and feature service layers failed to identify. Can Feature layer be identified? What should be done for identify without affect editing? Do I have to convert it to  WKID="4326"  in MXD file for my map services layers and feature services?
0 Kudos
6 Replies
DominiqueBroux
Esri Frequent Contributor

Can Feature layer be identified?


No, the identify task is not working with feature layers. As the features are loaded at the client side, you don't need to indentify the features ('Identify' is working with the server). Instead you can use a maptip to display infos about features.


But my mapservice layers and feature service layers failed to identify.


It should work with mapservice layers. What is exactly your issue?
0 Kudos
XiujuZhou
Emerging Contributor
Thanks dbroux. I got your first idea.
No identify result come out for mapservice layers. IdentifyEventArgs e.IdentifyResults.count=0.
I am not sure if different spatial references between esri map and my map caused the problem.

No, the identify task is not working with feature layers. As the features are loaded at the client side, you don't need to indentify the features ('Identify' is working with the server). Instead you can use a maptip to display infos about features.



It should work with mapservice layers. What is exactly your issue?
0 Kudos
JenniferNery
Esri Regular Contributor
To test if IdentifyTask failed in your SL application or if empty IdentifyResults was expected, you can use Fidder to see what parameters SL app formed and use the same parameters in your web browser. If the result that you get from the web browser is not identical to the result you get from your application, we may have a problem.  To do this, you can look at this thread, post #14 http://forums.arcgis.com/threads/14730-Area-And-Perimeter.
0 Kudos
XiujuZhou
Emerging Contributor
My question is whether different spatial references between esri map and my map can cause identify no result? I mean, are different spatial references OK when my layers need to be identified?

To test if IdentifyTask failed in your SL application or if empty IdentifyResults was expected, you can use Fidder to see what parameters SL app formed and use the same parameters in your web browser. If the result that you get from the web browser is not identical to the result you get from your application, we may have a problem.  To do this, you can look at this thread, post #14 http://forums.arcgis.com/threads/14730-Area-And-Perimeter.
0 Kudos
JenniferNery
Esri Regular Contributor
The MapService need not match the Map's SpatialReference.  In the SDK sample: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#Identify, the base layer where map inherits its SpatialReference from belong to 4326 and the MapService belong to 4269. Here's a link to IdentifyParameters documentation: http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Tasks.Iden...  Have you tried reproducing the issue outside the SL app?  Did you find any difference in the web browser result?  Were the parameters correct?
0 Kudos
DominiqueBroux
Esri Frequent Contributor
The trick is to initialize the spatialreference property of the IdentifyParameters.
Something like:
 
ESRI.ArcGIS.Client.Tasks.IdentifyParameters identifyParams = new IdentifyParameters()
{
Geometry = clickPoint,
MapExtent = map.Extent,
Width = (int)map.ActualWidth,
Height = (int)map.ActualHeight,
LayerOption = LayerOption.visible,
SpatialReference = map.SpatialReference
};
0 Kudos