GoogleMaps

The GoogleMaps Service provides access to the Google Maps API along with helper functions for interacting with the maps (such as converting coordinates). For more information, check out https://developers.google.com/maps/documentation/static-maps/intro

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

RPCS

GoogleMaps.getDistance(startLatitude: Latitude, startLongitude: Longitude, endLatitude: Latitude, endLongitude: Longitude)

Get the straight line distance between two points in meters.

Arguments:

  • startLatitude: Latitude info - Latitude of start point
  • startLongitude: Longitude info - Longitude of start point
  • endLatitude: Latitude info - Latitude of end point
  • endLongitude: Longitude info - Longitude of end point

Returns: Number info - Distance in meters

GoogleMaps.getEarthCoordinates(x: Number, y: Number)

Get the earth coordinates [latitude, longitude] of a given point in the last requested map image [x, y].

Arguments:

  • x: Number info - x position of the point
  • y: Number info - y position of the point

Returns: List info - A list containing the latitude and longitude of the given point.

GoogleMaps.getImageCoordinates(latitude: Latitude, longitude: Longitude)

Get the image coordinates [x, y] of a given location on the earth [latitude, longitude].

Arguments:

  • latitude: Latitude info - latitude of the point
  • longitude: Longitude info - longitude of the point

Returns: List info - A list containing the [x, y] position of the given point.

GoogleMaps.getLatitudeFromY(y: Number)

Convert y value of map image to latitude.

Arguments:

  • y: Number info - y value of map image

Returns: Latitude info - Latitude of the y value from the image

GoogleMaps.getLongitudeFromX(x: Number)

Convert x value of map image to longitude.

Arguments:

  • x: Number info - x value of map image

Returns: Longitude info - Longitude of the x value from the image

GoogleMaps.getMap(latitude: Latitude, longitude: Longitude, width: BoundedInteger<1>, height: BoundedInteger<1>, zoom: BoundedInteger<1, 25>)

Get a map image of the given region.

Arguments:

  • latitude: Latitude info - Latitude of center point
  • longitude: Longitude info - Longitude of center point
  • width: BoundedInteger<1> info - Image width
  • height: BoundedInteger<1> info - Image height
  • zoom: BoundedInteger<1, 25> info - Zoom level of map image

Returns: Image - Map image

GoogleMaps.getSatelliteMap(latitude: Latitude, longitude: Longitude, width: BoundedInteger<1>, height: BoundedInteger<1>, zoom: BoundedInteger<1, 25>)

Get a satellite map image of the given region.

Arguments:

  • latitude: Latitude info - Latitude of center point
  • longitude: Longitude info - Longitude of center point
  • width: BoundedInteger<1> info - Image width
  • height: BoundedInteger<1> info - Image height
  • zoom: BoundedInteger<1, 25> info - Zoom level of map image

Returns: Image - Map image

GoogleMaps.getTerrainMap(latitude: Latitude, longitude: Longitude, width: BoundedInteger<1>, height: BoundedInteger<1>, zoom: BoundedInteger<1, 25>)

Get a terrain map image of the given region.

Arguments:

  • latitude: Latitude info - Latitude of center point
  • longitude: Longitude info - Longitude of center point
  • width: BoundedInteger<1> info - Image width
  • height: BoundedInteger<1> info - Image height
  • zoom: BoundedInteger<1, 25> info - Zoom level of map image

Returns: Image - Map image

GoogleMaps.getXFromLongitude(longitude: Longitude)

Convert longitude to the x value on the map image.

Arguments:

  • longitude: Longitude info - Longitude coordinate

Returns: Number info - Map x coordinate of the given longitude

GoogleMaps.getYFromLatitude(latitude: Latitude)

Convert latitude to the y value on the map image.

Arguments:

  • latitude: Latitude info - Latitude coordinate

Returns: Number info - Map y coordinate of the given latitude

GoogleMaps.maxLatitude()

Get the maximum latitude of the current map.

Returns: Longitude info

GoogleMaps.maxLongitude()

Get the maximum longitude of the current map.

Returns: Longitude info

GoogleMaps.minLatitude()

Get the minimum latitude of the current map.

Returns: Longitude info

GoogleMaps.minLongitude()

Get the minimum longitude of the current map.

Returns: Longitude info