动态海拔图,全路线小地图,骑行记录上传增加截图

This commit is contained in:
lishuo committed 2021-04-07 17:22:45 +08:00
1 parent 65fc5b5c50
commit 725b510748
11 files changed
+4294 -4675

No files matched your search

+20 -2
View File
@@ -1,4 +1,5 @@
using System;
using GeoJSON.Net.Geometry;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -64,6 +65,8 @@ namespace Assets.Scripts.Apis.Models
if (_List == null) return;
this.CalcDistance();
this.CalcGrade();
this.CalcBbox();
this.CalcCenter();
}
}
@@ -117,7 +120,22 @@ namespace Assets.Scripts.Apis.Models
}
}
private void CalcCenter()
{
var list = this.List.Select(p => new GeoJSON.Net.Geometry.GeographicPosition(p.Point[0], p.Point[1]));
LineString lineString = new LineString(list);
var ll = Turf.Centroid(lineString);
var p1 = ((Point)ll.Geometry).Coordinates;
Center = new double[] { ((GeographicPosition)p1).Latitude, ((GeographicPosition)p1).Longitude };
}
private void CalcBbox()
{
var list = this.List.Select(p => new GeoJSON.Net.Geometry.GeographicPosition(p.Point[0], p.Point[1]));
LineString lineString = new LineString(list);
Bbox = Turf.Bbox(lineString);
}
public Double[] Center { set; get; }
public List<Double> Bbox { set; get; }
public MapDataModel()
{
//List = new List<Item>();