Layers Intersection with an Envelope:
As we know Layers intersection is a common task in GIS, here we achieve this using Identity method.
Below is the code used to find the layers in the mapresource which are being intersected
with an envelope.
DataTable dt = GetIntersectionLayers(Map1.GetFunctionalities(0),x1,y1,x2,y2);
public DataTable GetIntersectionLayers(
ESRI.ArcGIS.ADF.Web.DataSources.IMapFunctionality gisFunctionality, double minX,
double minY, double maxX, double maxY)
int pixelTolerance = 1;
DataTable dt = null;
ESRI.ArcGIS.ADF.Web.DataSources.IGISResource gisResource = gisFunctionality.Resource;
ESRI.ArcGIS.ADF.Web.DataSources.IQueryFunctionality queryFunctionality =
string layerIDs = null;
string layerNames = null;
queryFunctionality.GetQueryableLayers(null, out layerIDs, out layerNames);
ESRI.ArcGIS.ADF.Web.Geometry.Envelope adfEnvelope =
new ESRI.ArcGIS.ADF.Web.Geometry.Envelope(minX, minY, maxX, maxY);
dt = queryFunctionality.Identify(gisFunctionality.Name, adfEnvelope,
pixelTolerance, ESRI.ArcGIS.ADF.Web.IdentifyOption.AllLayers, layerIDs);
The method returns the data table with a collection of intersected layers.