百度地图经纬度转腾讯地图经纬度PHP源码
作者:xlnxin发布时间:2025-04-17分类:编程知识浏览:584
导读:/** * 百度地图经纬度转腾讯地图经纬度 *...
/**
* 百度地图经纬度转腾讯地图经纬度
* @param $lat
* @param $lon
* @return string
*/
public function map_bd2tx($lat, $lon)
{
$tx_lat = 0;
$tx_lon = 0;
$x_pi = 3.14159265358979324;
$x = $lon - 0.0065;
$y = $lat - 0.006;
//Math
$z = sqrt($x * $x + $y * $y) - 0.00002 * sin($y * $x_pi);
$theta = atan2($y, $x) - 0.000003 * cos($x * $x_pi);
$tx_lon = $z * cos($theta);
$tx_lat = $z * sin($theta);
return $tx_lat . "," . $tx_lon;
} 标签:php
- 编程知识排行
-
- 1layui图标css代码大全
- 2微信小程序弹出对话框输入名字
- 3微信小程序input组件解决iphone拼音字符maxlength长度问题
- 4宝塔面板phpMyAdmin提示:服务器和客户端上指示的HTTPS之间不匹配
- 5小程序默认icon
- 6微信小程序页面跳转:wx.switchTab、wx.reLaunch、wx.redirectTo、wx.navigateTo、wx.navigateBack”的使用区别介绍
- 7微信小程序image组件中aspectFill和widthfix、scaleToFill对比
- 8宝塔面板文件管理器文件不能排序解决方法
- 9宝塔面板PHP-5.6.40中phpmyadmin不能快捷打开数据库
- 最近发表

