<iframe src="https://developers.devsite.google/frame/maps/documentation/javascript/reference/coordinates_63110f1b96827569c559a708666dbfdad5f5e23c6f318d9973de46490295e3d0.frame" class="framebox inherit-locale redirect-iframe" allow="clipboard-write https://developers.devsite.google" allowfullscreen is-upgraded></iframe>

## [LatLng](https://developers.google.com/maps/documentation/javascript/reference/coordinates.md.txt#LatLng)
class


class
`google.maps.LatLng`

library `"core"`

A `LatLng` 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.  
Notice that you cannot modify the coordinates of a `LatLng`. If you want to compute another point, you have to create a new one.  

Most methods that accept `LatLng` objects also accept a `LatLngLiteral` object, so that the following are equivalent:

```
 map.setCenter(new google.maps.LatLng(-34, 151));
 map.setCenter({lat: -34, lng: 151}); 
```

The constructor also accepts `LatLngLiteral` and `LatLng` objects. If a `LatLng` instance is passed to the constructor, a copy is created.

The possible calls to the constructor are below:

```
 new google.maps.LatLng(-34, 151);
 new google.maps.LatLng(-34, 151, true);
 new google.maps.LatLng({lat: -34, lng: 151});
 new google.maps.LatLng({lat: -34, lng: 151}, true);
 new google.maps.LatLng(new google.maps.LatLng(-34, 151));
 new google.maps.LatLng(new google.maps.LatLng(-34, 151), true);
 
```

<br />

```javascript
const {LatLng} = await google.maps.importLibrary("core");
```

| ### Constructor ||
|---|---|
| `LatLng` | `LatLng(latOrLatLngOrLatLngLiteral[, lngOrNoClampNoWrap, noClampNoWrap])` **Parameters:** - `latOrLatLngOrLatLngLiteral: number|LatLngLiteral|LatLng` - `lngOrNoClampNoWrap: number|boolean optional` - `noClampNoWrap: boolean optional` 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 `noClampNoWrap` to `true` to enable values outside of this range. Note the ordering of latitude and longitude. |

| ### Methods ||
|---|---|
| `equals` | `equals(other)` **Parameters:** - `other: LatLng|LatLngLiteral optional` **Return Value:** `boolean` Comparison function for two LatLngs. Returns true if the coordinates are within 1e-9 of each other and false otherwise. |
| `lat` | `lat()` **Parameters:** None **Return Value:** `number` Returns the latitude in degrees. |
| `lng` | `lng()` **Parameters:** None **Return Value:** `number` Returns the longitude in degrees. |
| `toJSON` | `toJSON()` **Parameters:** None **Return Value:** `LatLngLiteral` Converts to JSON representation. This function is intended to be used via `JSON.stringify`. |
| `toString` | `toString()` **Parameters:** None **Return Value:** `string` Converts to string representation. |
| `toUrlValue` | `toUrlValue([precision])` **Parameters:** - `precision: number optional` **Return Value:** `string` Returns a string of the form "lat,lng" for this LatLng. We round the lat/lng values to 6 decimal places by default. |

## [LatLngLiteral](https://developers.google.com/maps/documentation/javascript/reference/coordinates.md.txt#LatLngLiteral)
interface


interface
`google.maps.LatLngLiteral`

extended by `DirectionalLocationLiteral, LatLngAltitudeLiteral`

implemented by `DirectionalLocation, LatLngAltitude`

Object literals are accepted in place of `LatLng` objects, as a convenience, in many places. These are converted to `LatLng` objects when the Maps API encounters them.

Examples:

```
 map.setCenter({lat: -34, lng: 151});
 new google.maps.Marker({position: {lat: -34, lng: 151}, map: map}); 
```

LatLng object literals are not supported in the Geometry library.

<br />

| ### Properties ||
|---|---|
| `lat` | **Type:** `number` Latitude in degrees. Values 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. |
| `lng` | **Type:** `number` Longitude in degrees. Values outside the range \[-180, 180\] 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. |

## [LatLngBounds](https://developers.google.com/maps/documentation/javascript/reference/coordinates.md.txt#LatLngBounds)
class


class
`google.maps.LatLngBounds`

library `"core"`

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

```javascript
const {LatLngBounds} = await google.maps.importLibrary("core");
```

| ### Constructor ||
|---|---|
| `LatLngBounds` | `LatLngBounds([swOrLatLngBounds, ne])` **Parameters:** - `swOrLatLngBounds: LatLng|LatLngLiteral|LatLngBounds|LatLngBoundsLiteral optional` - `ne: LatLng|LatLngLiteral optional` Constructs a rectangle from the points at its south-west and north-east corners. |

| ### Constants ||
|---|---|
| `MAX_BOUNDS` | LatLngBounds for the max bounds of the Earth. These bounds will encompass the entire globe. |

| ### Methods ||
|---|---|
| `contains` | `contains(latLng)` **Parameters:** - `latLng: LatLng|LatLngLiteral` **Return Value:** `boolean` Returns `true` if the given lat/lng is in this bounds. |
| `equals` | `equals(other)` **Parameters:** - `other: LatLngBounds|LatLngBoundsLiteral optional` **Return Value:** `boolean` Returns `true` if this bounds approximately equals the given bounds. |
| `extend` | `extend(point)` **Parameters:** - `point: LatLng|LatLngLiteral` **Return Value:** `LatLngBounds` Extends this bounds to contain the given point. |
| `getCenter` | `getCenter()` **Parameters:** None **Return Value:** `LatLng` Computes the center of this LatLngBounds |
| `getNorthEast` | `getNorthEast()` **Parameters:** None **Return Value:** `LatLng` Returns the north-east corner of this bounds. |
| `getSouthWest` | `getSouthWest()` **Parameters:** None **Return Value:** `LatLng` Returns the south-west corner of this bounds. |
| `intersects` | `intersects(other)` **Parameters:** - `other: LatLngBounds|LatLngBoundsLiteral` **Return Value:** `boolean` Returns `true` if this bounds shares any points with the other bounds. |
| `isEmpty` | `isEmpty()` **Parameters:** None **Return Value:** `boolean` Returns if the bounds are empty. |
| `toJSON` | `toJSON()` **Parameters:** None **Return Value:** `LatLngBoundsLiteral` Converts to JSON representation. This function is intended to be used via `JSON.stringify`. |
| `toSpan` | `toSpan()` **Parameters:** None **Return Value:** `LatLng` Converts the given map bounds to a lat/lng span. |
| `toString` | `toString()` **Parameters:** None **Return Value:** `string` Converts to string. |
| `toUrlValue` | `toUrlValue([precision])` **Parameters:** - `precision: number optional` **Return Value:** `string` Returns a string of the form "lat_lo,lng_lo,lat_hi,lng_hi" for this bounds, where "lo" corresponds to the southwest corner of the bounding box, while "hi" corresponds to the northeast corner of that box. |
| `union` | `union(other)` **Parameters:** - `other: LatLngBounds|LatLngBoundsLiteral` **Return Value:** `LatLngBounds` Extends this bounds to contain the union of this and the given bounds. |

## [LatLngBoundsLiteral](https://developers.google.com/maps/documentation/javascript/reference/coordinates.md.txt#LatLngBoundsLiteral)
interface


interface
`google.maps.LatLngBoundsLiteral`

Object literals are accepted in place of `LatLngBounds` objects throughout the API. These are automatically converted to `LatLngBounds` objects. All `south`, `west`, `north` and `east` must be set, otherwise an exception is thrown.

| ### Properties ||
|---|---|
| `east` | **Type:** `number` East longitude in degrees. Values outside the range \[-180, 180\] will be wrapped to the range \[-180, 180). 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. |
| `north` | **Type:** `number` North latitude in degrees. Values 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. |
| `south` | **Type:** `number` South latitude in degrees. Values 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. |
| `west` | **Type:** `number` West longitude in degrees. Values outside the range \[-180, 180\] will be wrapped to the range \[-180, 180). 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. |

## [LatLngAltitude](https://developers.google.com/maps/documentation/javascript/reference/coordinates.md.txt#LatLngAltitude)
class


class
`google.maps.LatLngAltitude`
implements `LatLngAltitudeLiteral, LatLngLiteral`

extended by `DirectionalLocation`

library `"core"`

A `LatLngAltitude` is a 3D point in geographical coordinates: latitude, longitude, and altitude.  

- 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.
- Altitude is measured in meters. Positive values denote heights above ground level, and negative values denote heights underneath the ground surface.

<br />

```javascript
const {LatLngAltitude} = await google.maps.importLibrary("core");
```

| ### Constructor ||
|---|---|
| `LatLngAltitude` | `LatLngAltitude(value[, noClampNoWrap])` **Parameters:** - `value: LatLngAltitude|LatLngAltitudeLiteral|LatLng|LatLngLiteral` The initializing value. - `noClampNoWrap: boolean optional` Whether to preserve the initialization values, even if they may not necessarily be valid latitude values in the range of \[-90, 90\] or valid longitude values in the range of \[-180, 180\]. The default is `false` which enables latitude clamping and longitude wrapping. |

| ### Properties ||
|---|---|
| `altitude` readonly | **Type:** `number` Returns the altitude. |
| `lat` readonly | **Type:** `number` Returns the latitude. |
| `lng` readonly | **Type:** `number` Returns the longitude. |

| ### Methods ||
|---|---|
| `equals` | `equals(other)` **Parameters:** - `other: LatLngAltitude|LatLngAltitudeLiteral optional` Another LatLngAltitude object. **Return Value:** `boolean` Whether the two objects are equal. Comparison function for two LatLngAltitudes. Returns true if the coordinates are within 1e-9 of each other and false otherwise. |
| `toJSON` | `toJSON([key])` **Parameters:** - `key: string optional` **Return Value:** `LatLngAltitudeLiteral` Converts to a plain object. |

## [LatLngAltitudeLiteral](https://developers.google.com/maps/documentation/javascript/reference/coordinates.md.txt#LatLngAltitudeLiteral)
interface


interface
`google.maps.LatLngAltitudeLiteral`
extends `LatLngLiteral`

extended by `DirectionalLocationLiteral`

implemented by `DirectionalLocation, LatLngAltitude`

Object literals are accepted in place of `LatLngAltitude` objects, as a convenience, in many places. These are converted to `LatLngAltitude` objects when the Maps API encounters them.

| ### Properties ||
|---|---|
| `altitude` | **Type:** `number` Distance (in meters) above the ground surface. Negative value means underneath the ground surface. |
| `lat` | **Type:** `number` Latitude in degrees. Values 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. |
| `lng` | **Type:** `number` Longitude in degrees. Values outside the range \[-180, 180\] 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. |

## [Point](https://developers.google.com/maps/documentation/javascript/reference/coordinates.md.txt#Point)
class


class
`google.maps.Point`

library `"core"`

```javascript
const {Point} = await google.maps.importLibrary("core");
```

| ### Constructor ||
|---|---|
| `Point` | `Point(x, y)` **Parameters:** - `x: number` - `y: number` A point on a two-dimensional plane. |

| ### Properties ||
|---|---|
| `x` | **Type:** `number` The X coordinate |
| `y` | **Type:** `number` The Y coordinate |

| ### Methods ||
|---|---|
| `equals` | `equals(other)` **Parameters:** - `other: Point optional` **Return Value:** `boolean` Compares two Points |
| `toString` | `toString()` **Parameters:** None **Return Value:** `string` Returns a string representation of this Point. |

## [Size](https://developers.google.com/maps/documentation/javascript/reference/coordinates.md.txt#Size)
class


class
`google.maps.Size`

library `"core"`

```javascript
const {Size} = await google.maps.importLibrary("core");
```

| ### Constructor ||
|---|---|
| `Size` | `Size(width, height[, widthUnit, heightUnit])` **Parameters:** - `width: number` - `height: number` - `widthUnit: string optional` - `heightUnit: string optional` Two-dimensional size, where width is the distance on the x-axis, and height is the distance on the y-axis. |

| ### Properties ||
|---|---|
| `height` | **Type:** `number` The height along the y-axis, in pixels. |
| `width` | **Type:** `number` The width along the x-axis, in pixels. |

| ### Methods ||
|---|---|
| `equals` | `equals(other)` **Parameters:** - `other: Size optional` **Return Value:** `boolean` Compares two Sizes. |
| `toString` | `toString()` **Parameters:** None **Return Value:** `string` Returns a string representation of this Size. |

## [Padding](https://developers.google.com/maps/documentation/javascript/reference/coordinates.md.txt#Padding)
interface


interface
`google.maps.Padding`

| ### Properties ||
|---|---|
| `bottom` optional | **Type:** `number optional` Padding for the bottom, in pixels. |
| `left` optional | **Type:** `number optional` Padding for the left, in pixels. |
| `right` optional | **Type:** `number optional` Padding for the right, in pixels. |
| `top` optional | **Type:** `number optional` Padding for the top, in pixels. |

## [CircleLiteral](https://developers.google.com/maps/documentation/javascript/reference/coordinates.md.txt#CircleLiteral)
interface


interface
`google.maps.CircleLiteral`
extends `CircleOptions`

Object literal which represents a circle.

| ### Properties ||
|---|---|
| `center` | **Type:** `LatLng|LatLngLiteral` The center of the Circle. |
| `radius` | **Type:** `number` The radius in meters on the Earth's surface. |

## [Orientation3D](https://developers.google.com/maps/documentation/javascript/reference/coordinates.md.txt#Orientation3D)
class


class
`google.maps.Orientation3D`
implements `Orientation3DLiteral`

library `"core"`

A `Orientation3D` is a three-dimensional vector used for standard mathematical rotation transformations along heading, tilt, and roll.  

- heading is an angle in the range \[0, 360) degrees.
- tilt is an angle in the range \[0, 360) degrees.
- roll is an angle in the range \[0, 360) degrees.

<br />

```javascript
const {Orientation3D} = await google.maps.importLibrary("core");
```

| ### Constructor ||
|---|---|
| `Orientation3D` | `Orientation3D(value)` **Parameters:** - `value: Orientation3D|Orientation3DLiteral` The initializing value. |

| ### Properties ||
|---|---|
| `heading` readonly | **Type:** `number` **Default:** `0` Rotation about the z-axis (normal to the Earth's surface). A value of 0 (the default) equals North. A positive rotation is clockwise around the z-axis and specified in degrees from 0 to 360. 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 530 will be converted to 170 as well. |
| `roll` readonly | **Type:** `number` **Default:** `0` Rotation about the y-axis. A positive rotation is clockwise around the y-axis and specified in degrees from 0 to 360. 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 530 will be converted to 170 as well. |
| `tilt` readonly | **Type:** `number` **Default:** `0` Rotation about the x-axis. A positive rotation is clockwise around the x-axis and specified in degrees from 0 to 360. 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 530 will be converted to 170 as well. |

| ### Methods ||
|---|---|
| `equals` | `equals(other)` **Parameters:** - `other: Orientation3D|Orientation3DLiteral optional` Another Orientation3D object. **Return Value:** `boolean` Whether the two objects are equal. Comparison function. |
| `toJSON` | `toJSON([key])` **Parameters:** - `key: string optional` **Return Value:** `Orientation3DLiteral` Converts to a plain object. |

## [Orientation3DLiteral](https://developers.google.com/maps/documentation/javascript/reference/coordinates.md.txt#Orientation3DLiteral)
interface


interface
`google.maps.Orientation3DLiteral`

implemented by `Orientation3D`

Object literals are accepted in place of `Orientation3D` objects, as a convenience, in many places. These are converted to `Orientation3D` objects when the Maps API encounters them.

| ### Properties ||
|---|---|
| `heading` optional | **Type:** `number optional` Rotation about the z-axis (normal to the Earth's surface). A value of 0 (the default) equals North. A positive rotation is clockwise around the z-axis and specified in degrees from 0 to 360. |
| `roll` optional | **Type:** `number optional` Rotation about the y-axis. A positive rotation is clockwise around the y-axis and specified in degrees from 0 to 360. |
| `tilt` optional | **Type:** `number optional` Rotation about the x-axis. A positive rotation is clockwise around the x-axis and specified in degrees from 0 to 360. |

## [Vector3D](https://developers.google.com/maps/documentation/javascript/reference/coordinates.md.txt#Vector3D)
class


class
`google.maps.Vector3D`
implements `Vector3DLiteral`

library `"core"`

A `Vector3D` is a three-dimensional vector used for standard mathematical operations such as scaling the bounds of three-dimensional object along local x-, y-, and z-axes.  

- x is a real number.
- y is a real number.
- z is a real number.

<br />

```javascript
const {Vector3D} = await google.maps.importLibrary("core");
```

| ### Constructor ||
|---|---|
| `Vector3D` | `Vector3D(value)` **Parameters:** - `value: Vector3D|Vector3DLiteral` The initializing value. |

| ### Properties ||
|---|---|
| `x` readonly | **Type:** `number` X-component of the three-dimensional vector. |
| `y` readonly | **Type:** `number` Y-component of the three-dimensional vector. |
| `z` readonly | **Type:** `number` Z-component of the three-dimensional vector. |

| ### Methods ||
|---|---|
| `equals` | `equals(other)` **Parameters:** - `other: Vector3D|Vector3DLiteral optional` Another Vector3D or Vector3DLiteral object. **Return Value:** `boolean` Comparison function. |
| `toJSON` | `toJSON([key])` **Parameters:** - `key: string optional` **Return Value:** `Vector3DLiteral` Converts to a plain object. |

## [Vector3DLiteral](https://developers.google.com/maps/documentation/javascript/reference/coordinates.md.txt#Vector3DLiteral)
interface


interface
`google.maps.Vector3DLiteral`

implemented by `Vector3D`

Object literals are accepted in place of `Vector3D` objects, as a convenience, in many places. These are converted to `Vector3D` objects when the Maps API encounters them.

| ### Properties ||
|---|---|
| `x` | **Type:** `number` X-component of the three-dimensional vector. |
| `y` | **Type:** `number` Y-component of the three-dimensional vector. |
| `z` | **Type:** `number` Z-component of the three-dimensional vector. |