using Google.Maps; using Google.Maps.Coord; using UnityEngine; using UnityEngine.UI; /// /// A controller to update the Lat/Lng display in the HUD based on the world position of this /// translated to a through the /// . /// public class SateliteHudUpdater : MonoBehaviour { /// /// The used to translate world position to . /// [Tooltip("The MapsService used to translate world position to latlng.")] public MapsService MapsService; /// /// The UI element used to display . /// [Tooltip("The Text UI element used to display latlng")] public Text LatLngDisplay; void Update() { LatLng latlng = MapsService.Projection.FromVector3ToLatLng(transform.position); LatLngDisplay.text = string.Format("Lat/Lng: {0:F4},{1:F4}", latlng.Lat, latlng.Lng); } }