DK11 for Delphi | GisViewer.TGIS_Viewer.RotatedPoint | Constructors | Fields | Methods | Properties | Events
Compute position of the point after the viewer rotation.
Implements IGIS_Viewer.RotatedPoint.
// Delphi public function RotatedPoint( const _ptg : TGIS_Point ) : TGIS_Point;
// C++ Builder public: TGIS_Point* RotatedPoint( TGIS_Point* const _ptg );
Name | Type | Description |
---|---|---|
_ptg | TGIS_Point | point in to be rotated |
Type | Description |
---|---|
TGIS_Point | Rotated map coordinates. |
Suppose that your map has been rotated and projected and you want to have original Longitude/Latitude of the mouse position a feature on such rotated map
procedure MyClass.GISMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); var shp : TGIS_Shape ; ptg : TGIS_Point begin ptg := GIS.ScreenToMap(Point(x,y)) ; // now we have point but possible in a rotated coordinates ptg := GIS.UnrotatedPoint( ptg ) ; // now we have a point in an original unrotated state ptg := GIS.CS.ToWGS( ptg ) ; StatusBar1.Text := GisLongitudeToStr( ptg.X ) + ' ' + GisLatitudeToStr( ptg.Y ) + ' ' ; end ;