/// <summary> /// Get elevation values for path. /// </summary> /// <param name="path">Path on the earth for which to return elevation data. </param> /// <param name="samples"> /// Specifies the number of sample points along a path for which to return elevation data. \n /// The samples parameter divides the given path into an ordered set of equidistant points along the path. /// </param> /// <param name="key"> /// Your application's API key. \n /// This key identifies your application for purposes of quota management. /// </param> /// <param name="client"> /// Client ID identifies you as a Maps API for Work customer and enables support and purchased quota for your application. \n /// Requests made without a client ID are not eligible for Maps API for Work benefits. /// </param> /// <param name="signature"> /// Your welcome letter includes a cryptographic signing key, which you must use to generate unique signatures for your web service requests. /// </param> /// <returns>Query instance to the Google API.</returns> public static OnlineMapsGoogleAPIQuery Find(Vector2[] path, int samples, string key = null, string client = null, string signature = null) { OnlineMapsGetElevation query = new OnlineMapsGetElevation(path, samples, key, client, signature); OnlineMaps.instance.AddGoogleAPIQuery(query); return(query); }
private void OnMapClick() { // Get elevation on click point OnlineMapsGoogleAPIQuery elevationRequest = OnlineMapsGetElevation.Find(OnlineMapsControlBase.instance.GetCoords()); elevationRequest.OnComplete += OnComplete; }
private void OnComplete(string response) { // Get results from response string OnlineMapsGetElevationResult[] results = OnlineMapsGetElevation.GetResults(response); if (results == null) { // If results is null log message Debug.Log("Null result"); } else { // Shows first result elevation Debug.Log(results[0].elevation); } }
/// <summary> /// Get elevation value for single location. /// </summary> /// <param name="location"> /// Location on the earth from which to return elevation data. /// </param> /// <param name="key"> /// Your application's API key. \n /// This key identifies your application for purposes of quota management. /// </param> /// <param name="client"> /// Client ID identifies you as a Maps API for Work customer and enables support and purchased quota for your application. \n /// Requests made without a client ID are not eligible for Maps API for Work benefits. /// </param> /// <param name="signature"> /// Your welcome letter includes a cryptographic signing key, which you must use to generate unique signatures for your web service requests. /// </param> /// <returns>Query instance to the Google API.</returns> public static OnlineMapsGoogleAPIQuery Find(Vector2 location, string key = null, string client = null, string signature = null) { OnlineMapsGetElevation query = new OnlineMapsGetElevation(location, key, client, signature); OnlineMaps.instance.AddGoogleAPIQuery(query); return query; }
private void OnMapClick() { // Get elevation on click point OnlineMapsGetElevation.Find(OnlineMapsControlBase.instance.GetCoords()).OnComplete += OnComplete; }