/// <summary> /// Returns an array with a heightmap on it /// </summary> /// <param name="tile">tile x, y and zoom</param> /// <returns></returns> public static byte[] getByteHeight(USlippyTile tile) { byte[] pngData; using (WebClient client = new WebClient()) { string url = tile.getMapzenURLTerranium(UVariables.mapzenAPIKey); pngData = client.DownloadData(url); } return(pngData); }
/// <summary> /// Returns an array with a heightmap on it /// </summary> /// <param name="tile">tile x, y and zoom</param> /// <returns></returns> public static byte[] getByteHeight(USlippyTile tile) { byte[] pngData; using (WebClient client = new WebClient()) { string url = tile.getMapzenURLTerranium(UVariables.mapzenAPIKey); ServicePointManager.ServerCertificateValidationCallback = MyRemoteCertificateValidationCallback; pngData = client.DownloadData(url); } return(pngData); }
/// <summary> /// Returns a Texture2D with a heightmap on it /// </summary> /// <param name="tile">tile x, y and zoom</param> /// <returns></returns> public static Texture2D getHeight(USlippyTile tile) { Texture2D tex; using (WebClient client = new WebClient()) { string url = tile.getMapzenURLTerranium(UVariables.mapzenAPIKey); ServicePointManager.ServerCertificateValidationCallback = MyRemoteCertificateValidationCallback; byte[] pngData = client.DownloadData(url); tex = new Texture2D(256, 256); tex.LoadImage(pngData); tex.Apply(); } return(tex); }