ArcGIS Explorer Component Help |
MapDisplay..::.TrackMoveGeometry Method (Geometry) |
MapDisplay Class Example See Also |
Assembly: ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)
Syntax
C# |
---|
public Geometry TrackMoveGeometry( Geometry geometry ) |
Visual Basic (Declaration) |
---|
Public Function TrackMoveGeometry ( _ geometry As Geometry _ ) As Geometry |
Parameters
- geometry
- Type: ESRI.ArcGISExplorer.Geometry..::.Geometry
The Geometry to be moved.
Return Value
A new Geometry at the clicked location. The shape is based on the input geometry but translated to the new location.Remarks
This method will block the user interface (UI) thread until the user has clicked on the display. The method can be cancelled if the ESC key is pressed after the method has been called or the CancelTracking()()() method is called; in this case the method will return nullNothingnullptra null reference (Nothing in Visual Basic).
If you are using this method to move a Graphic or Note remember that you will need to update the Geometry property with that of the tracked geometry to actually move it, see the code example below.
Alternatively you may wish to use an asynchronous equivalent, see the BeginTrackMoveGeometry methods.
Version Information: This method is supported from version 2.0.0.1500.
Examples
//Return the map display ESRI.ArcGISExplorer.Mapping.MapDisplay disp = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay; Graphic targetGraphic = null; //Find a particular Graphic by it's Tag property foreach (Graphic graphic in disp.Graphics) { if (graphic.Tag.ToString() == "LineTarget") { targetGraphic = graphic; break; } } if (targetGraphic != null) { //Track the 'LineTarget' geometry to a new location ESRI.ArcGISExplorer.Geometry.Geometry movedTargetGeometry = disp.TrackMoveGeometry(targetGraphic.Geometry); //Update the Graphics Geometry to be the tracked geoemtry targetGraphic.Geometry = movedTargetGeometry; }
'Return the map display Dim disp As ESRI.ArcGISExplorer.Mapping.MapDisplay = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay Dim targetGraphic As Graphic = Nothing 'Find a particular Graphic by its Tag property For Each graphic As Graphic In disp.Graphics If graphic.Tag.ToString() = "LineTarget" Then targetGraphic = graphic Exit For End If Next If targetGraphic IsNot Nothing Then 'Track the 'LineTarget' geometry to a new location Dim movedTargetGeometry As ESRI.ArcGISExplorer.Geometry.Geometry = disp.TrackMoveGeometry(targetGraphic.Geometry) 'Update the Graphics Geometry to be the tracked geoemtry targetGraphic.Geometry = movedTargetGeometry End If