This is the method in which the server-side action of a tool is performed.
Syntax
Parameters
- args
- Holds the results of the client-side interaction.
Example
In this example, a user clicked on a point on the Map with a Tool, and the following server-side method is called. The method retrieves the screen point and converts it to map coordinates.
Visual Basic | Copy Code |
---|
Public Class MyPointToolAction
Implements IMapServerToolAction
Sub ServerAction(ByVal args As ToolEventArgs) _
Implements IMapServerToolAction.ServerAction
Dim map As ESRI.ArcGIS.ADF.Web.UI.WebControls.Map = _
CType(args.Control, ESRI.ArcGIS.ADF.Web.UI.WebControls.Map)
Dim pArgs As PointEventArgs = CType(args, PointEventArgs)
Dim screenPt As System.Drawing.Point = pArgs.ScreenPoint
Dim transParams As ESRI.ArcGIS.ADF.Web.Geometry.TransformationParams = _
map.GetTransformationParams(TransformationDirection.ToMap)
Dim pnt As ESRI.ArcGIS.ADF.Web.Geometry.Point = _
ESRI.ArcGIS.ADF.Web.Geometry.Point.ToMapPoint(screenPt.X, screenPt.Y, transParams)
' Do something with the point...
End Sub
End Class |
C# | Copy Code |
---|
public class MyPointToolAction: IMapServerToolAction
{
void IMapServerToolAction.ServerAction(ToolEventArgs args)
{
ESRI.ArcGIS.ADF.Web.UI.WebControls.Map map =
(ESRI.ArcGIS.ADF.Web.UI.WebControls.Map)args.Control;
PointEventArgs pArgs = (PointEventArgs)args;
System.Drawing.Point screenPt = pArgs.ScreenPoint;
ESRI.ArcGIS.ADF.Web.Geometry.TransformationParams transParams =
map.GetTransformationParams(TransformationDirection.ToMap);
ESRI.ArcGIS.ADF.Web.Geometry.Point pnt =
ESRI.ArcGIS.ADF.Web.Geometry.Point.ToMapPoint(screenPt.X, screenPt.Y, transParams);
// Do something with the point...
}
} |
Remarks
Requirements
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family
See Also