Google.Maps.Coord.Coords

Encapsulates management aspects of the coordinate system.

Summary

Manages the floating origin, Mercator scale, and converts between Unity Worldspace (Vector3), Earth-scale Mercator Space (Vector2D) and Google Maps Tile Coordinates (TileCoord).

Caution: You must set the floating origin before using the Coordinate System. For more information, see the MapsService.InitFloatingOrigin method.

Public attributes

Zoom
int
The zoom level.

Public functions

FromLatLngToVector3(LatLng latLng)
Vector3
Converts a LatLng value into a Unity Worldspace Vector3 by way of the Spherical Mercator projection:
FromVector3ToLatLng(Vector3 vector3)
Converts a Unity Worldspace Vector3 into a LatLng, by way of the Spherical Mercator projection.

Public attributes

Zoom

int Zoom

The zoom level.

Public functions

FromLatLngToVector3

Vector3 FromLatLngToVector3(
  LatLng latLng
)

Converts a LatLng value into a Unity Worldspace Vector3 by way of the Spherical Mercator projection:

  • translated relative to the current origin (FloatingOrigin).
  • scaled relative to the latitude of the initial floating origin (MercatorScale).

Details
Parameters
latLng
The LatLng value to convert.
Returns
A Vector3 value in Unity Worldspace.

FromVector3ToLatLng

LatLng FromVector3ToLatLng(
  Vector3 vector3
)

Converts a Unity Worldspace Vector3 into a LatLng, by way of the Spherical Mercator projection.

This method is the inverse of the FromLatLngToVector3 method. It takes into account the fact that the Vector3 has been translated relative to the current origin, and scaled relative to the latitude of the initial origin.

Details
Parameters
vector3
The Vector3 value to convert.
Returns
The converted LatLng value.

Send feedback about...

Google Maps Platform gaming solution
Google Maps Platform gaming solution