完成大地图主要界面
This commit is contained in:
1 parent
5156473bb2
commit
d22eecd133
78 files changed
+8684
-6941
No files matched your search
@@ -78,7 +78,12 @@ namespace Assets.Scripts.Apis
|
||||
protected async Task<byte[]> GetAsync(string url)
|
||||
{
|
||||
AddLanguage();
|
||||
var httpResponseMessage = await httpClient.GetAsync(ConfigHelper.Host + url, HttpCompletionOption.ResponseContentRead).ConfigureAwait(false);
|
||||
var _url = url;
|
||||
if(_url.IndexOf("http") == -1)
|
||||
{
|
||||
_url = ConfigHelper.Host + url;
|
||||
}
|
||||
var httpResponseMessage = await httpClient.GetAsync(_url, HttpCompletionOption.ResponseContentRead).ConfigureAwait(false);
|
||||
if (!httpResponseMessage.IsSuccessStatusCode)
|
||||
{
|
||||
return null;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Assets.Scenes.Ride.Scripts.Model;
|
||||
|
||||
using Assets.Scenes.Ride.Scripts.Model;
|
||||
using Assets.Scripts.Apis.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -87,5 +88,21 @@ namespace Assets.Scripts.Apis
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public async Task<JsonResult<List<NearRouteModel>>> GetNearRouteAsync(float lat, float lng, float zoom, string bounds)
|
||||
{
|
||||
var res = await GetAsync<JsonResult<List<NearRouteModel>>>($"/Map/GetNearRoute?lat={ lat }&lng={ lng }&zoom={zoom}&bounds={ bounds }");
|
||||
|
||||
//var result = System.Text.Encoding.UTF8.GetString(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
public async Task<string> GetDetailsAsync(int[] ids)
|
||||
{
|
||||
var res = await GetAsync("/Map/GetDetails?ids=" + string.Join(",", ids));
|
||||
|
||||
return Encoding.UTF8.GetString(res);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Assets.Scripts.Apis
|
||||
{
|
||||
public class MapBoxApi: ApiBase
|
||||
{
|
||||
public string GetAddressInfo(string address)
|
||||
{
|
||||
var url = $"https://a.tiles.mapbox.com/geocoding/v5/mapbox.places/{ address }.json?access_token={ App.MapBoxAccessToken }";
|
||||
var res = Get(url);
|
||||
|
||||
//return System.Text.Encoding.UTF8.GetString(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 97ae508c230356844bf73819c3e1b451
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Assets.Scripts.Apis.Models
|
||||
{
|
||||
public class NearRouteModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string DirPath { get; set; }
|
||||
public string CreateTime { get; set; }
|
||||
public int UserId { get; set; }
|
||||
public double Distance { get; set; }
|
||||
public double EleDifference { get; set; }
|
||||
public double TotalClimb { get; set; }
|
||||
public double AverageGrade { get; set; }
|
||||
public string CoverImage { get; set; }
|
||||
public string ElevationPath { get; set; }
|
||||
public List<double> Point { get; set; }
|
||||
public string Address { get; set; }
|
||||
/// <summary>
|
||||
/// 骑行热度
|
||||
/// </summary>
|
||||
public int TheHeat { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: df1953478a7c274448dcde606e6718e9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in new issue
Block a user