コード例 #1
0
ファイル: UTerrainLoader.cs プロジェクト: kamal01k/Ushia
 /// <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);
 }
コード例 #2
0
 /// <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);
 }
コード例 #3
0
    /// <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);
    }