var latitude1; // 纬度,浮点数,由getLocation获得,数据随不同地点变化
var longitude1 ; // 经度,浮点数,由getLocation获得,数据随不同地点变化
var latitude2; // 纬度,浮点数,服务器字段“纬度”已有数据,数据固定
var longitude2; // 经度,浮点数,服务器字段“经度”已有数据,数据固定
wx.getLocation({
type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'wgs84'|'gcj02'
success: function (res) {
latitude1 = res.latitude; // 纬度,浮点数,范围为90 ~ -90
longitude1 = res.longitude; // 经度,浮点数,范围为180 ~ -180。
latitude2 = document.getElementById("latitude2").value; // 纬度,浮点数
longitude2 = document.getElementById("longitude2").value; // 经度,浮点数
latitude1 = latitude1 * Math.PI / 180.0;
latitude2 = latitude2 * Math.PI / 180.0;
var latitude5 = latitude1 - latitude2;
var Lb5 = longitude1 * Math.PI / 180.0 - longitude2 * Math.PI / 180.0;
var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(latitude5 / 2), 2) + Math.cos(latitude1) * Math.cos(latitude2) * Math.pow(Math.sin(Lb5 / 2), 2)));
s = s * 6378.137;//地球半径
s = Math.round(s * 10000) / 10000; //这是求s(单位是米)的方法,计算还挺准
下面是问题:
Dim drs As List(of DataRow)
Dim filter As String = “” ’需要筛选s>5000,这个表达式怎么写?主要是涉及到了“纬度”、“经度”,两个列,有没有官方文档可以查?
drs = DataTables("物品信息").SQLSelect(filter,20,"添加时间 Desc")
[此贴子已经被作者于2021/2/8 8:36:44编辑过]