We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All
ReferencesSite KitAndroidcom.huawei.hms.site.api.modelClass SummaryCoordinate

Coordinate

Expand

Class Info

public class Coordinate

Represents the location (longitude and latitude) of a place.

Public Constructor Summary

Expand

Constructor Name

Coordinate(double lat, double lng)

Creates a Coordinate object using the latitude and longitude.

Public Method Summary

Expand

Qualifier and Type

Method Name and Description

double

getLat()

Obtains the latitude of a place.

double

getLng()

Obtains the longitude of a place.

void

setLat(double lat)

Sets the latitude of a place.

void

setLng(double lng)

Sets the longitude of a place.

Public Constructors

Coordinate

Expand

Constructor

Coordinate(double lat, double lng)

Creates a Coordinate object using the latitude and longitude.

Parameters

Expand

Name

Description

lat

Latitude.

lng

Longitude.

Public Methods

getLat

Expand

Method

public double getLat()

Obtains the latitude of a place.

Returns

Expand

Type

Description

double

Latitude.

getLng

Expand

Method

public double getLng()

Obtains the longitude of a place.

Returns

Expand

Type

Description

double

Longitude.

setLat

Expand

Method

public void setLat(double lat)

Sets the latitude of a place.

Parameters

Expand

Name

Description

lat

Latitude. The value ranges from –90 to 90.

setLng

Expand

Method

public void setLng(double lng)

Sets the longitude of a place.

Parameters

Expand

Name

Description

lng

Longitude. The value ranges from –180 to 180.