地图debug
parent
f40fad3511
commit
9dac5101f4
|
|
@ -299,16 +299,6 @@ class QuickNavService
|
|||
if($v['event_type'] == 3)
|
||||
{
|
||||
$v['event_value_data'] = explode('|', $v['event_value']);
|
||||
// 坐标转换 百度转火星(高德,谷歌,腾讯坐标)
|
||||
if(isset($v['event_value_data'][2]) && isset($v['event_value_data'][3]) && in_array(APPLICATION_CLIENT_TYPE, config('shopxo.coordinate_transformation')))
|
||||
{
|
||||
$map = \base\GeoTransUtil::BdToGcj($v['event_value_data'][2], $v['event_value_data'][3]);
|
||||
if(isset($map['lng']) && isset($map['lat']))
|
||||
{
|
||||
$v['event_value_data'][2] = $map['lng'];
|
||||
$v['event_value_data'][] = $map['lat'];
|
||||
}
|
||||
}
|
||||
}
|
||||
$v['event_value'] = $v['event_value'];
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ App({
|
|||
// 请求地址
|
||||
request_url: "{{request_url}}",
|
||||
request_url: 'http://shopxo.com/',
|
||||
request_url: 'https://dev.shopxo.net/',
|
||||
// request_url: 'https://dev.shopxo.net/',
|
||||
|
||||
// 基础信息
|
||||
application_title: "{{application_title}}",
|
||||
|
|
@ -532,11 +532,12 @@ App({
|
|||
return false;
|
||||
}
|
||||
|
||||
var map = this.BMapTransqqMap(parseFloat(values[2]), parseFloat(values[3]));
|
||||
wx.openLocation({
|
||||
name: values[0],
|
||||
address: values[1],
|
||||
longitude: parseFloat(values[2]),
|
||||
latitude: parseFloat(values[3])
|
||||
longitude: map.lng,
|
||||
latitude: map.lat
|
||||
});
|
||||
break;
|
||||
|
||||
|
|
@ -801,4 +802,18 @@ App({
|
|||
}, 100);
|
||||
},
|
||||
|
||||
BMapTransqqMap(lng, lat) {
|
||||
let x_pi = 3.14159265358979324 * 3000.0 / 180.0;
|
||||
let x = lng - 0.0065;
|
||||
let y = lat - 0.006;
|
||||
let z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * x_pi);
|
||||
let theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi);
|
||||
let lngs = z * Math.cos(theta);
|
||||
let lats = z * Math.sin(theta);
|
||||
return {
|
||||
lng: lngs,
|
||||
lat: lats
|
||||
};
|
||||
},
|
||||
|
||||
});
|
||||
Loading…
Reference in New Issue