cadetill's blog Copyright © Xavier Martínez (cadetill)

Class TGMLatLngBounds

Unit

Declaration

type TGMLatLngBounds = class(TGMPersistentStr, IGMControlChanges)

Description

A TGMLatLngBounds instance represents a rectangle in geographical coordinates, including one that crosses the 180 degrees longitudinal meridian.

More information at google.maps.LatLngBounds class

Hierarchy

Overview

Methods

Public constructor Create(SW, NE: TGMLatLng; Lang: TGMLang = lnEnglish); reintroduce; overload; virtual;
Public constructor Create(AOwner: TPersistent; SWLat: Real = 0; SWLng: Real = 0; NELat: Real = 0; NELng: Real = 0); reintroduce; overload; virtual;
Public constructor Create(AOwner: TPersistent; SW, NE: TGMLatLng); reintroduce; overload; virtual;
Public constructor Create(SWLat: Real = 0; SWLng: Real = 0; NELat: Real = 0; NELng: Real = 0; Lang: TGMLang = lnEnglish); reintroduce; overload; virtual;
Public destructor Destroy; override;
Public function Contains(LatLng: TGMLatLng): Boolean;
Public function GetCenter: TGMLatLng;
Public function Intersects(Other: TGMLatLngBounds): Boolean;
Public function IsEmpty: Boolean;
Public function IsEqual(Other: TGMLatLngBounds): Boolean;
Public function PropToString: string; override;
Public function ToJson(Precision: Integer = 6): string;
Public function ToSpan: TGMLatLng;
Public function ToStr(Precision: Integer = 6): string;
Public function ToUrlValue(Precision: Integer = 6): string;
Protected function GetOwnerLang: TGMLang; override;
Public procedure Assign(Source: TPersistent); override;
Public procedure Extend(LatLng: TGMLatLng);
Public procedure Union(Other: TGMLatLngBounds);
Protected procedure PropertyChanged(Prop: TPersistent; PropName: string);

Properties

Public property APIUrl;
Published property NE: TGMLatLng read FNE write FNE;
Published property SW: TGMLatLng read FSW write FSW;

Description

Methods

Public constructor Create(SW, NE: TGMLatLng; Lang: TGMLang = lnEnglish); reintroduce; overload; virtual;

Constructor class.

Parameters
SW
South-west corner.
NE
North-east corner.
Lang
TGMLang to use in exceptions.
Public constructor Create(AOwner: TPersistent; SWLat: Real = 0; SWLng: Real = 0; NELat: Real = 0; NELng: Real = 0); reintroduce; overload; virtual;

Constructor class.

Parameters
AOwner
Object owner.
SWLat
South-west latitude. Default 0.
SWLng
South-west longitude. Default 0.
NELat
North-east latitude. Default 0.
NELng
North-east longitude. Default 0.
Public constructor Create(AOwner: TPersistent; SW, NE: TGMLatLng); reintroduce; overload; virtual;

Constructor class.

Parameters
AOwner
Object owner.
SW
South-west corner.
NE
North-east corner.
Public constructor Create(SWLat: Real = 0; SWLng: Real = 0; NELat: Real = 0; NELng: Real = 0; Lang: TGMLang = lnEnglish); reintroduce; overload; virtual;

Constructor class.

Parameters
SWLat
South-west latitude. Default 0.
SWLng
South-west longitude. Default 0.
NELat
North-east latitude. Default 0.
NELng
North-east longitude. Default 0.
Lang
TGMLang to use in exceptions.
Public destructor Destroy; override;

Destructor class.

Public function Contains(LatLng: TGMLatLng): Boolean;

Returns True if the given TGMLatLng is in the bounds.

Parameters
LatLng
TGMLatLng to check.
Returns

True if the given TGMLatLng is in the bounds, otherwise False.

Exceptions raised
EGMWithoutOwner
This exception is raised if the object don't have a owner.
EGMOwnerWithoutJS
This exception is raised if the owner can't execute JavaScript functions.
EGMUnassignedObject
This exception is raised if LanLng param is unassigned.
EGMMapIsNull
This exception is raised if Map object in JavaScript is null.
Public function GetCenter: TGMLatLng;

Get the center of current bounds.

Parameters
LatLng
TGMLatLng representing the centre.
Exceptions raised
EGMWithoutOwner
This exception is raised if the object don't have a owner.
EGMOwnerWithoutJS
This exception is raised if the owner can't execute JavaScript functions.
EGMJSError
This exception is raised if an error occurred executing JavaScript function.
Public function Intersects(Other: TGMLatLngBounds): Boolean;

Returns True if this bounds shares any points with this bounds.

Parameters
Other
Bounds to compare.
Returns

True if shares, otherwise False.

Exceptions raised
EGMWithoutOwner
This exception is raised if the object don't have a owner.
EGMOwnerWithoutJS
This exception is raised if the owner can't execute JavaScript functions.
EGMJSError
This exception is raised if an error occurred executing JavaScript function.
EGMUnassignedObject
This exception is raised if LanLng param is unassigned.
Public function IsEmpty: Boolean;

Returns True if the bounds is empty.

Returns

True if empty, otherwise False.

Public function IsEqual(Other: TGMLatLngBounds): Boolean;

Returns True if this bounds is equals the given bounds.

Two bounds are equals if his coordinates NE and SW are equals.

Parameters
Other
Bounds to compare.
Returns

True if equals, otherwise False.

Public function PropToString: string; override;

Converts all class properties values to a string separated by comma used to send values to a JavaScript function.

Returns

string with all properties.

Public function ToJson(Precision: Integer = 6): string;

Convert bounds to Json representation.

Parameters
Precision
Precision of values. Default 6.
Returns

Json with the bounds.

Public function ToSpan: TGMLatLng;

Converts the given bounds to a lat/lng span.

Parameters
LatLng
TGMLatLng with the span.
Exceptions raised
EGMWithoutOwner
This exception is raised if the object don't have a owner.
EGMOwnerWithoutJS
This exception is raised if the owner can't execute JavaScript functions.
EGMJSError
This exception is raised if an error occurred executing JavaScript function.
Public function ToStr(Precision: Integer = 6): string;

Convert bounds to string representation.

Parameters
Precision
Precision of values. Default 6.
Returns

String with the bounds.

Public function ToUrlValue(Precision: Integer = 6): string;

Returns a string with format "lat_lo,lng_lo,lat_hi,lng_hi" for this bounds, where "lo" corresponds to the southwest corner of the bounding box and "hi" corresponds to the northeast corner of that box.

Parameters
Precision
Precision of values. Default 6.
Returns

Formatted string.

Protected function GetOwnerLang: TGMLang; override;

Returns the TGMLang of the Owner.

If Owner is not assigned or not supports IGMOwnerLang interface then should be returned lnEnglish.

Returns

TGMLang of the owner object.

Public procedure Assign(Source: TPersistent); override;

Call Assign to copy the properties or other attributes form an object to another.

The standard form of a call to Assign method is
     Destination.Assign(Source);
which tells the Destination object to copy the contents of the Source object to itself.

Parameters
Source
Object to copy the content.
Public procedure Extend(LatLng: TGMLatLng);

Extends the bounds to contain the given point.

Parameters
LatLng
TGMLatLng to contain.
Exceptions raised
EGMWithoutOwner
This exception is raised if the object don't have a owner.
EGMOwnerWithoutJS
This exception is raised if the owner can't execute JavaScript functions.
EGMJSError
This exception is raised if an error occurred executing JavaScript function.
EGMUnassignedObject
This exception is raised if LanLng param is unassigned.
Public procedure Union(Other: TGMLatLngBounds);

Extends this bounds to contain the union of this and the given bounds.

Parameters
Other
TGMLatLngBounds to union.
Exceptions raised
EGMWithoutOwner
This exception is raised if the object don't have a owner.
EGMOwnerWithoutJS
This exception is raised if the owner can't execute JavaScript functions.
EGMJSError
This exception is raised if an error occurred executing JavaScript function.
EGMUnassignedObject
This exception is raised if LanLng param is unassigned.
Protected procedure PropertyChanged(Prop: TPersistent; PropName: string);

Method to call into the owner object when changes a property into the current object.

Parameters
Prop
Object property that has changed.
PropName
Name of the property that has changed.

Properties

Public property APIUrl;

URL to Google Maps API page.

Published property NE: TGMLatLng read FNE write FNE;

North-east coordinates.

Published property SW: TGMLatLng read FSW write FSW;

South-west coordinates.


Generated by PasDoc 0.15.0.