Geolocation

The Geolocation Service provides access to the Google Places API and geocoding capabilities. For more information, check out https://developers.google.com/places/

Terms of service: https://developers.google.com/maps/terms

RPCS

Geolocation.city(latitude: Latitude, longitude: Longitude)

Get the name of the city nearest to the given latitude and longitude.

Arguments:

  • latitude: Latitude (Latitude) - latitude of the target location
  • longitude: Longitude (Longitude) - longitude of the target location

Returns: String (String) - city name

Geolocation.country(latitude: Latitude, longitude: Longitude)

Get the name of the country nearest to the given latitude and longitude.

Arguments:

  • latitude: Latitude (Latitude) - latitude of the target location
  • longitude: Longitude (Longitude) - longitude of the target location

Returns: String (String) - country name

Geolocation.countryCode(latitude: Latitude, longitude: Longitude)

Get the code for the country nearest to the given latitude and longitude.

Arguments:

  • latitude: Latitude (Latitude) - latitude of the target location
  • longitude: Longitude (Longitude) - longitude of the target location

Returns: String (String) - country code

Geolocation.county*(latitude: Latitude, longitude: Longitude)

Get the name of the county (or closest equivalent) nearest to the given latitude and longitude. If the country does not have counties, it will return the corresponding division for administrative level 2.

For more information on administrative divisions, check out https://en.wikipedia.org/wiki/List_of_administrative_divisions_by_country

Arguments:

  • latitude: Latitude (Latitude) - latitude of the target location
  • longitude: Longitude (Longitude) - longitude of the target location

Returns: String (String) - county name

Geolocation.geolocate(address: String)

Geolocates the address and returns the coordinates

Arguments:

  • address: String (String) - target address

Returns: Object (Object) - structured data representing the location of the address

Geolocation.info(latitude: Latitude, longitude: Longitude)

Get administrative division information for the given latitude and longitude.

Arguments:

  • latitude: Latitude (Latitude) - latitude of the target location
  • longitude: Longitude (Longitude) - longitude of the target location

Returns: List (List) - list of administative level names

Geolocation.nearbySearch(latitude: Latitude, longitude: Longitude, keyword: String?, radius: Number?)

Find places near an earth coordinate (latitude, longitude) (maximum of 10 results)

Arguments:

  • latitude: Latitude (Latitude)
  • longitude: Longitude (Longitude)
  • keyword: String? (String) - the keyword you want to search for, like pizza or cinema.
  • radius: Number? (Number) - search radius in meters (default 50km)

Returns: List<Object> (List | Object) - list of nearby locations

Geolocation.state*(latitude: Latitude, longitude: Longitude)

Get the name of the state (or closest equivalent) nearest to the given latitude and longitude. If the country does not have states, it will return the corresponding division for administrative level 1.

For more information on administrative divisions, check out https://en.wikipedia.org/wiki/List_of_administrative_divisions_by_country

Arguments:

  • latitude: Latitude (Latitude) - latitude of the target location
  • longitude: Longitude (Longitude) - longitude of the target location

Returns: String (String) - state name

Geolocation.stateCode*(latitude: Latitude, longitude: Longitude)

Get the code for the state (or closest equivalent) nearest to the given latitude and longitude. If the country does not have states, it will return the corresponding division for administrative level 1.

For more information on administrative divisions, check out https://en.wikipedia.org/wiki/List_of_administrative_divisions_by_country

Arguments:

  • latitude: Latitude (Latitude) - latitude of the target location
  • longitude: Longitude (Longitude) - longitude of the target location

Returns: String (String) - state code

Geolocation.streetAddress(address: String)

Get the street address of a given target location.

Arguments:

  • address: String (String) - the address string to look up

Returns: String (String) - the target street address

Geolocation.timezone(address: AnyOf<Tuple<Latitude, Longitude>, String>)

Get information about the timezone of the provided address or location. You can provide either a list of two values representing the latitude and longitude location, or a string address to look up.

Arguments:

  • address: AnyOf<Tuple<Latitude, Longitude>, String> (AnyOf | Tuple | Latitude | Longitude | String) - target location - either a list representing [latitude, longitude], or an address string

Returns: Object (Object) - information about the target’s timezone