Hello.
Yes, you need to use OnlineMapsControlBase.GetCoords.
Example:
using UnityEngine;
public class GetCoordinatesOfScreenCorners:MonoBehaviour
{
public static void LogCorners()
{
double lng, lat;
OnlineMapsControlBase.instance.GetCoords(out lng, out lat, new Vector2(0, 0));
Debug.Log("Bottom left longitude: " + lng + ", latitude: " + lat);
OnlineMapsControlBase.instance.GetCoords(out lng, out lat, new Vector2(Screen.width, 0));
Debug.Log("Bottom right longitude: " + lng + ", latitude: " + lat);
OnlineMapsControlBase.instance.GetCoords(out lng, out lat, new Vector2(Screen.width, Screen.height));
Debug.Log("Top right longitude: " + lng + ", latitude: " + lat);
OnlineMapsControlBase.instance.GetCoords(out lng, out lat, new Vector2(0, Screen.height));
Debug.Log("Top left longitude: " + lng + ", latitude: " + lat);
}
private void OnGUI()
{
if (GUILayout.Button("Log corners")) LogCorners();
}
}
Kind Regards,
Infinity Code Team.
Boost your productivity a lot and immediately using
Ultimate Editor Enhancer.
Trial and non-commerce versions available.