25 lines
694 B
C#
25 lines
694 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Net.Http;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using UnityEngine.Networking;
|
|
|
|
namespace Assets.Scripts.Apis
|
|
{
|
|
public class MapBoxApi: ApiBase
|
|
{
|
|
public async Task<string> GetAddressInfo(string address)
|
|
{
|
|
var url = $"https://a.tiles.mapbox.com/geocoding/v5/mapbox.places/{ UnityWebRequest.EscapeURL(address) }.json?access_token={ App.MapBoxAccessToken }";
|
|
//var res = Get(url);
|
|
|
|
var result = await new HttpClient().GetAsync(url);
|
|
return await result.Content.ReadAsStringAsync();
|
|
//UnityWebRequest.
|
|
}
|
|
|
|
}
|
|
}
|