GlideGeoPoint - Global
-
- UpdatedFeb 1, 2024
- 3 minutes to read
- Washington DC
- API reference
The GlideGeoPoint API enables you to get and set geopoint data type values in a table.
The GlideGeoPoint API is available by default. The geopoint data type allows you to store a latitude and longitude values in a single field within a table. Using the GlideGeoPoint API, you can instantiate new GlideGeoPoint objects, create new geopoints for a specific table, or retrieve single latitude, longitude or geotype values. For additional information on how to implement specific use cases like inserting new records using a geopoint, computing distances between geopoint locations, or querying for nearby geopoint locations, see GlideGeoPoint Developer Guide.
- It consists of a pair of decimal numbers representing longitude and latitude values.
- The range for longitude is (-180, 180]. Any value outside this range is normalized to the equivalent value inside this range.
- The range for latitude is [-90, 90]. Any value outside this range is normalized to the equivalent value inside this range.
- Geopoint values are always accepted as input and display as a comma-separated pair: “longitude,latitude”. Parentheses may optionally surround the expression.
- Both longitude and latitude values are stored up to 6 decimal places of precision.
The examples on this page assume that a custom table is pre-populated with fields containing the geopoint field type. For more information about this data type, see Geo point field type and Function field.
GlideGeoPoint - GlideGeoPoint()
Instantiates a GlideGeoPoint object. The GlideGeoPoint object adds semantic awareness to longitude and latitude values that are otherwise stored as strings.
Name | Type | Description |
---|---|---|
None |
Example
The following example shows how to initialize a new GlideGeoPoint object as a null value.
GlideGeoPoint - GlideGeoPoint(String longitude, String latitude)
Instantiates the GlideGeoPoint object according to provided longitude and latitude values.
Name | Type | Description |
---|---|---|
longitude | String | The longitude coordinate of the geopoint. |
latitude | String | The latitude coordinate of the geopoint. |
Type | Description |
---|---|
geopoint | The resultant GlideGeoPoint object. |
Example
The following example shows how providing longitude and latitude values initializes the object accordingly.
Output:
GlideGeoPoint - GlideGeoPoint(Object geoPoint)
Copies longitude and latitude points values to instantiate a new GlideGeoPoint object.
Name | Type | Description |
---|---|---|
geoPoint | Object | The geopoint instance that you want copy. |
Type | Description |
---|---|
geopoint | The resultant GlideGeoPoint object. |
Example
The following example shows how to copy longitude and latitude values to instantiate a new GlideGeoPoint object.
GlideGeoPoint - getDisplayValue()
Returns the geopoint of the current user in a user-friendly format.
The getDisplayValue() function returns a single geopoint value. For information about how to retrieve all geopoint values from a specific table, see GlideGeoPoint Developer Guide.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
String | The value of the longitude and latitude coordinates set in the object. |
Example
Output:
GlideGeoPoint - getLatitude()
Returns the latitude value of the GlideGeoPoint object.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
String | The latitude value of the GlideGeoPoint object. |
Example
Output:
GlideGeoPoint - getLongitude()
Returns the longitude value of the GlideGeoPoint object.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
String | The longitude value of the GlideGeoPoint object. |
Example
Output:
GlideGeoPoint - getValue()
Returns a string containing the programmatic longitude and latitude value of the current GlideGeoPoint object.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
String | The longitude and latitude value of the current GlideGeoPoint object. |
Example
Output:
GlideGeoPoint - setValue(String longitude, String latitude)
Sets the longitude and latitude values of the geopoint.
Name | Type | Description |
---|---|---|
longitude | String | The longitudinal coordinate of the geopoint. |
latitude | String | The latitude coordinate of the geopoint. |
Type | Description |
---|---|
String | The longitude and latitude value set on the GlideGeoPoint object. |
Example
Output:
GlideGeoPoint - setValue(String value)
Sets the longitude and latitude values of the geopoint using a single comma-delimited value.
Name | Type | Description |
---|---|---|
value | String | A comma-delimited value containing longitude and latitude points respectively. |
Type | Description |
---|---|
String | The longitude and latitude value set on the GlideGeoPoint object. |
Example
The following example shows how to set the longitude and latitude values using a single string.
Output:
On this page
- GlideGeoPoint - GlideGeoPoint()
- GlideGeoPoint - GlideGeoPoint(String longitude, String latitude)
- GlideGeoPoint - GlideGeoPoint(Object geoPoint)
- GlideGeoPoint - getDisplayValue()
- GlideGeoPoint - getLatitude()
- GlideGeoPoint - getLongitude()
- GlideGeoPoint - getValue()
- GlideGeoPoint - setValue(String longitude, String latitude)
- GlideGeoPoint - setValue(String value)