DK for .NET | TatukGIS.NDK.IGIS_Viewer.Locate | Overloads | Methods | Properties
Locates the shape nearest to _pt that is within _prec.
// C# public TGIS_ShapeAbstract Locate( TPoint _pt, int _prec );
' VisualBasic Public Function Locate( ByVal _pt As TPoint, ByVal _prec As Integer ) As TGIS_ShapeAbstract
// Oxygene public function Locate( _pt : TPoint; _prec : Integer ) : TGIS_ShapeAbstract;
| Name | Type | Description |
|---|---|---|
| _pt | TPoint | Reference point in screen coordinates, expressed in pixels. |
| _prec | int Integer | Maximum search distance in pixels. |
| Type | Description |
|---|---|
| TGIS_ShapeAbstract | Located shape, or nil if no shape is found within _prec. |
USAGE: Find the nearest shape to a screen position within a pixel search tolerance.
shp = GIS.Locate(screen_point, 20) if shp != None # Shape found near the screen point
If locate is called upon active paint operations then result could be null. But Locate and paint process are using the same vector enumerator context.
It is recommended to check InPaint property before calling this Locate.