| cadetill's blog | Copyright © Xavier Martínez (cadetill) |
Class TGMLatLng
Unit
Declaration
type TGMLatLng = class(TGMPersistentStr)
Description
A TGMLatLng is a point in geographical coordinates: latitude and longitude.
Latitude ranges between -90 and 90 degrees, inclusive. Values above or below this range will be clamped to the range [-90, 90]. This means that if the value specified is less than -90, it will be set to -90. And if the value is greater than 90, it will be set to 90.
Longitude ranges between -180 and 180 degrees, inclusive. Values above or below this range will be wrapped so that they fall within the range. For example, a value of -190 will be converted to 170. A value of 190 will be converted to -170. This reflects the fact that longitudes wrap around the globe.
Although the default map projection associates longitude with the x-coordinate of the map, and latitude with the y-coordinate, the latitude coordinate is always written first, followed by the longitude.
More information at google.maps.LatLng class.
Hierarchy
- TObject
- TPersistent
- TInterfacedPersistent
- TGMInterfacedOwnedPersistent
- TGMPersistent
- TGMPersistentStr
- TGMLatLng
Overview
Fields
![]() |
FPrecision: Integer; |
Methods
![]() |
constructor Create(Lat: Real = 0; Lng: Real = 0; NoWrap: Boolean = False; Lang: TGMLang = lnEnglish); reintroduce; overload; virtual; |
![]() |
constructor Create(AOwner: TPersistent; Lat: Real = 0; Lng: Real = 0; NoWrap: Boolean = False); reintroduce; overload; virtual; |
![]() |
function IsEqual(Other: TGMLatLng): Boolean; virtual; |
![]() |
function LatToStr(Precision: Integer = 6): string; |
![]() |
function LngToStr(Precision: Integer = 6): string; |
![]() |
function PropToString: string; override; |
![]() |
function ToJson(Precision: Integer = 6): string; |
![]() |
function ToStr(Precision: Integer = 6): string; |
![]() |
function ToUrlValue(Precision: Integer = 6): string; |
![]() |
function ControlPrecision(Value: Double): Double; virtual; |
![]() |
function GetOwnerLang: TGMLang; override; |
![]() |
procedure Assign(Source: TPersistent); override; |
![]() |
procedure SetLang(Lang: TGMLang); |
![]() |
procedure LatLngToStr(var aLat, aLng: string; Precision: Integer = 6); |
Properties
![]() |
property APIUrl; |
![]() |
property Lat: Double read GetLat write SetLat; |
![]() |
property Lng: Double read GetLng write SetLng; |
![]() |
property NoWrap: Boolean read FNoWrap write SetNoWrap default False; |
Description
Fields
![]() |
FPrecision: Integer; |
|
Precision value to show Lat and Lng. Default 6. | |
Methods
![]() |
constructor Create(Lat: Real = 0; Lng: Real = 0; NoWrap: Boolean = False; Lang: TGMLang = lnEnglish); reintroduce; overload; virtual; |
|
Constructor class.
Creates a LatLng object representing a geographic point. Latitude is specified in degrees within the range [-90, 90]. Longitude is specified in degrees within the range [-180, 180]. Set noWrap to true to enable values outside of this range.
Parameters
| |
![]() |
function IsEqual(Other: TGMLatLng): Boolean; virtual; |
|
Returns
Parameters
Returns
| |
![]() |
function LatToStr(Precision: Integer = 6): string; |
|
Convert Lat value to a string.
Parameters
ReturnsString with the latitude. | |
![]() |
function LngToStr(Precision: Integer = 6): string; |
|
Convert Lng value to a string.
Parameters
ReturnsString with the longitude. | |
![]() |
function PropToString: string; override; |
|
Converts all class properties values to a string separated by comma used to send values to a JavaScript function. Returnsstring with all properties. | |
![]() |
function ToStr(Precision: Integer = 6): string; |
|
Convert LatLng to string representation in format
Parameters
ReturnsString with the conversion. | |
![]() |
function ControlPrecision(Value: Double): Double; virtual; |
|
Rounds the Value to the number of decimal places defined by FPrecision.
If FPrecision is 0 it does nothing.
Parameters
ReturnsValue rounded to the specified precision. | |
![]() |
function GetOwnerLang: TGMLang; override; |
|
Returns the TGMLang of the Owner.
If Owner is not assigned or not supports IGMOwnerLang interface then should be returned
ReturnsTGMLang of the owner object. | |
![]() |
procedure SetLang(Lang: TGMLang); |
|
Set a Lang to the object.
Parameters
| |
Properties
![]() |
property APIUrl; |
|
URL to Google Maps API page. | |
![]() |
property Lat: Double read GetLat write SetLat; |
|
Latitude in degrees. | |
![]() |
property Lng: Double read GetLng write SetLng; |
|
Longitude in degrees | |
![]() |
property NoWrap: Boolean read FNoWrap write SetNoWrap default False; |
|
Allows to put values outside the default range of Lat/Lng properties. | |
Generated by PasDoc 0.15.0.


