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 info - latitude of the target location
  • longitude: Longitude info - longitude of the target location

Returns: String info - city name

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

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

Arguments:

  • latitude: Latitude info - latitude of the target location
  • longitude: Longitude info - longitude of the target location

Returns: String info - country name

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

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

Arguments:

  • latitude: Latitude info - latitude of the target location
  • longitude: Longitude info - longitude of the target location

Returns: String info - 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 info - latitude of the target location
  • longitude: Longitude info - longitude of the target location

Returns: String info - county name

Geolocation.geolocate(address: String)

Geolocates the address and returns the coordinates

Arguments:

  • address: String info - target address

Returns: Object info - 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 info - latitude of the target location
  • longitude: Longitude info - longitude of the target location

Returns: List info - 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 info
  • longitude: Longitude info
  • keyword: String? info - the keyword you want to search for, like pizza or cinema.
  • radius: Number? info - search radius in meters (default 50km)

Returns: List<Object> info - 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 info - latitude of the target location
  • longitude: Longitude info - longitude of the target location

Returns: String info - 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 info - latitude of the target location
  • longitude: Longitude info - longitude of the target location

Returns: String info - state code