User Tools

Site Tools


api:dk11:delphi:gisviewer.tgis_viewer.rotatedpoint_tgis_point

Table of Contents

TGIS_Viewer.RotatedPoint method

DK11 for Delphi | GisViewer.TGIS_Viewer.RotatedPoint | Constructors | Fields | Methods | Properties | Events

Compute position of the point after the viewer rotation.

Available also on: .NET | Java | ActiveX | Python.

Syntax

Implements IGIS_Viewer.RotatedPoint.

// Delphi
public
  function RotatedPoint(
    const _ptg : TGIS_Point
  ) : TGIS_Point;
// C++ Builder
public:
  TGIS_Point* RotatedPoint(
    TGIS_Point* const _ptg
  );

Parameters

Name Type Description
_ptg TGIS_Point point in to be rotated

Result

Type Description
TGIS_Point Rotated map coordinates.

Example

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

Delphi

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 ;
2022/11/30 19:19

Page Tools