Reference documentation and code samples for the Google API Common Protos Client class LatLng.
An object that represents a latitude/longitude pair. This is expressed as a
pair of doubles to represent degrees latitude and degrees longitude. Unless
specified otherwise, this must conform to theWGS84
standard. Values must be within normalized ranges.
Generated from protobuf messagegoogle.type.LatLng
Namespace
Google \ Type
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ latitude
float
The latitude in degrees. It must be in the range [-90.0, +90.0].
↳ longitude
float
The longitude in degrees. It must be in the range [-180.0, +180.0].
getLatitude
The latitude in degrees. It must be in the range [-90.0, +90.0].
Returns
Type
Description
float
setLatitude
The latitude in degrees. It must be in the range [-90.0, +90.0].
Parameter
Name
Description
var
float
Returns
Type
Description
$this
getLongitude
The longitude in degrees. It must be in the range [-180.0, +180.0].
Returns
Type
Description
float
setLongitude
The longitude in degrees. It must be in the range [-180.0, +180.0].
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google API Common Protos Client - Class LatLng (4.12.3)\n\nVersion latestkeyboard_arrow_down\n\n- [4.12.3 (latest)](/php/docs/reference/common-protos/latest/Type.LatLng)\n- [4.12.2](/php/docs/reference/common-protos/4.12.2/Type.LatLng)\n- [4.11.0](/php/docs/reference/common-protos/4.11.0/Type.LatLng)\n- [4.10.0](/php/docs/reference/common-protos/4.10.0/Type.LatLng)\n- [4.9.0](/php/docs/reference/common-protos/4.9.0/Type.LatLng)\n- [4.8.3](/php/docs/reference/common-protos/4.8.3/Type.LatLng) \nReference documentation and code samples for the Google API Common Protos Client class LatLng.\n\nAn object that represents a latitude/longitude pair. This is expressed as a\npair of doubles to represent degrees latitude and degrees longitude. Unless\nspecified otherwise, this must conform to the\n[WGS84\nstandard](http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf). Values must be within normalized ranges.\n\nGenerated from protobuf message `google.type.LatLng`\n\nNamespace\n---------\n\nGoogle \\\\ Type\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getLatitude\n\nThe latitude in degrees. It must be in the range \\[-90.0, +90.0\\].\n\n### setLatitude\n\nThe latitude in degrees. It must be in the range \\[-90.0, +90.0\\].\n\n### getLongitude\n\nThe longitude in degrees. It must be in the range \\[-180.0, +180.0\\].\n\n### setLongitude\n\nThe longitude in degrees. It must be in the range \\[-180.0, +180.0\\]."]]