ArcGIS Explorer Component Help |
GeometryOperations..::.Move Method (Geometry, Double, Double, Unit) |
GeometryOperations Class Example See Also |
Returns a new Geometry which is a copy of the input Geometry moved by the specified distance
in the specified units, along the x and y axis.
Namespace:
ESRI.ArcGISExplorer.GeometryAssembly: ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)
Syntax
C# |
---|
public static Geometry Move( Geometry inputGeometry, double deltaX, double deltaY, Unit unit ) |
Visual Basic (Declaration) |
---|
Public Shared Function Move ( _ inputGeometry As Geometry, _ deltaX As Double, _ deltaY As Double, _ unit As Unit _ ) As Geometry |
Parameters
- inputGeometry
- Type: ESRI.ArcGISExplorer.Geometry..::.Geometry
The Geometry to copy and move.
- deltaX
- Type: System..::.Double
The distance to move the specified Geometry along the x axis.
- deltaY
- Type: System..::.Double
The distance to move the specified Geometry along the y axis.
- unit
- Type: ESRI.ArcGISExplorer.Geometry..::.Unit
The units of the deltaX and deltaY arguments. Units cannot be Area units.
Return Value
A new Geometry of the same type as the inputGeometry, moved by the specified amounts.Remarks
The Move method does not change the inputGeometry object. The unit parameter specifies the units of measurement given in the deltaX and deltaY parameters.
If you wish to move the Geometry of a Graphic, then you can use the Move and MoveTo methods directly on the Graphic class; these are convenience methods added as the Graphic class is designed to create moving symbols on the map.
Examples
The code below demonstrates how you can use the GeometryOperations Move method to change the Extent of the 2D display, by
creating a new Envelope by moving the Extent, and zooming to the new Envelope.
CopyC#
// Get a reference to the current Display. MapDisplay disp = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay; if (disp.DisplayMode == DisplayMode.Display2D) { // Get the current 2D extent Envelope, move it, and zoom to the moved Envelope. Envelope newExt = (Envelope)GeometryOperations.Move(disp.Extent, 1, 1); disp.ZoomTo(newExt); }
CopyVB.NET
' Get a reference to the current Display. Dim disp As ESRI.ArcGISExplorer.Mapping.MapDisplay = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay If disp.DisplayMode = DisplayMode.Display2D Then ' Get the current 2D extent Envelope, move it, and zoom to the moved Envelope. Dim newExt As Envelope = GeometryOperations.Move(disp.Extent, 1, 1) disp.ZoomTo(newExt) End If
Exceptions
Exception | Condition |
---|---|
System..::.ArgumentNullException | The inputGeometry cannot be null. |