| |
//Set the URL property of the MapServerProxy object
mapServerProxy.Url = serviceURL;
//Get the MapServerInfo
MapServerInfo mapServerInfo = mapServerProxy.GetServerInfo(mapServerProxy.GetDefaultMapName());
//Get the MapDescription
MapDescription mapDescription = mapServerInfo.DefaultMapDescription;
//Project the point into the coord sys of the MapService
if (inputPoint.CoordinateSystem.Id != mapDescription.SpatialReference.WKID)
{
//Create an instance of the CoordinateSystem to project the Point into.
CoordinateSystem projectInto = new CoordinateSystem(mapDescription.SpatialReference.WKID);
//Project the point
inputPoint = GeometryOperations.Project(inputPoint, projectInto) as ESRI.ArcGISExplorer.Geometry.Point;
//If the Project() failed exit
if (inputPoint == null) return;
}
//Create an Image Display to pass into the Identify operation
ImageDisplay imageDisplay = new ImageDisplay();
//Get the geometry:
//Convert from an Explorer point to a SOAP PointN with GeometryToSoap<Explorer Type, SOAP Type>.
ESRI.ArcGIS.SOAP.PointN inputSoapPointN =
SoapConverter.GeometryToSoap<ESRI.ArcGISExplorer.Geometry.Point, ESRI.ArcGIS.SOAP.PointN>(inputPoint);
//Call the Identify() operation
MapServerIdentifyResult[] mapServerIdentifyResults = mapServerProxy.Identify(
mapDescription,
imageDisplay,
inputSoapPointN,
1,
esriIdentifyOption.esriIdentifyAllLayers,
null); |