new files

This commit is contained in:
panchengyong
2026-03-07 22:29:07 +08:00
parent cd7e80b502
commit 7acbf45ff7
12516 changed files with 1808447 additions and 194 deletions

View File

@@ -0,0 +1,37 @@
<?php
namespace Joypack\Tencent\Map\Bundle;
use Joypack\Tencent\Map\Response;
use Joypack\Tencent\Map\Bundle;
/**
* 地址解析(地址转坐标)
* 本接口提供由地址描述到所述位置坐标的转换
* 与逆地址解析的过程正好相反。
*/
class Address extends Bundle
{
/**
* 地址解析(地址转坐标)
* @param boolean $using_sig 使用签名方式校验
* @return Response
*/
public function request($using_sig=false)
{
$uri = '/ws/geocoder/v1';
if($using_sig) {
$this->option->setSig($uri);
}
$data = $this->option->getAll();
//$this->request->logger->print($data, true);
$this->request->uri($uri);
$this->request->query($data);
return $this->request->get();
}
}

View File

@@ -0,0 +1,29 @@
<?php
namespace Joypack\Tencent\Map\Bundle;
use Joypack\Tencent\Map\Option;
/**
* 地址解析(地址转坐标)
* 参数
*/
class AddressOption extends Option
{
/**
* 地址
* @param string $value
*/
public function setAddress($value)
{
$this->option['address'] = $value;
}
/**
* 指定地址所属城市
* @param string $value
*/
public function setRegion($value)
{
$this->option['region'] = $value;
}
}

View File

@@ -0,0 +1,37 @@
<?php
namespace Joypack\Tencent\Map\Bundle;
use Joypack\Tencent\Map\Response;
use Joypack\Tencent\Map\Bundle;
/**
* IP定位
* 通过终端设备IP地址获取其当前所在地理位置
* 精确到市级,常用于显示当地城市天气预报、初始化用户城市等非精确定位场景。
*/
class Ip extends Bundle
{
/**
* IP定位
* @param boolean $using_sig 使用签名方式校验
* @return Response
*/
public function request($using_sig=false)
{
$uri = '/ws/location/v1/ip';
if($using_sig) {
$this->option->setSig($uri);
}
$data = $this->option->getAll();
//$this->request->logger->print($data, true);
$this->request->uri($uri);
$this->request->query($data);
return $this->request->get();
}
}

View File

@@ -0,0 +1,20 @@
<?php
namespace Joypack\Tencent\Map\Bundle;
use Joypack\Tencent\Map\Option;
/**
* IP定位
* 参数
*/
class IpOption extends Option
{
/**
* IP地址
* @param string $value
*/
public function setIp($value)
{
$this->option['ip'] = $value;
}
}

View File

@@ -0,0 +1,37 @@
<?php
namespace Joypack\Tencent\Map\Bundle;
use Joypack\Tencent\Map\Response;
use Joypack\Tencent\Map\Bundle;
/**
* 逆地址解析(坐标位置描述)
* 本接口提供由坐标到坐标所在位置的文字描述的转换
* 输入坐标返回地理位置信息和附近poi列表。
*/
class Location extends Bundle
{
/**
* 逆地址解析(坐标位置描述)
* @param boolean $using_sig 使用签名方式校验
* @return Response
*/
public function request($using_sig=false)
{
$uri = '/ws/geocoder/v1';
if($using_sig) {
$this->option->setSig($uri);
}
$data = $this->option->getAll();
//$this->request->logger->print($data, true);
$this->request->uri($uri);
$this->request->query($data);
return $this->request->get();
}
}

View File

@@ -0,0 +1,16 @@
<?php
namespace Joypack\Tencent\Map\Bundle;
use Joypack\Tencent\Map\Option;
/**
* 逆地址解析(坐标位置描述)
* 参数
*/
class LocationOption extends Option
{
public function setLocation($lat, $lng)
{
$this->option['location'] = "{$lat},{$lng}";
}
}

View File

@@ -0,0 +1,37 @@
<?php
namespace Joypack\Tencent\Map\Bundle;
use Joypack\Tencent\Map\Response;
use Joypack\Tencent\Map\Bundle;
/**
* 坐标转换
* 实现从其它地图供应商坐标系或标准GPS坐标系
* 批量转换到腾讯地图坐标系
*/
class Translate extends Bundle
{
/**
* 逆地址解析(坐标位置描述)
* @param boolean $using_sig 使用签名方式校验
* @return Response
*/
public function request($using_sig=false)
{
$uri = '/ws/coord/v1/translate';
if($using_sig) {
$this->option->setSig($uri);
}
$data = $this->option->getAll();
//$this->request->logger->print($data, true);
$this->request->uri($uri);
$this->request->query($data);
return $this->request->get();
}
}

View File

@@ -0,0 +1,58 @@
<?php
namespace Joypack\Tencent\Map\Bundle;
use Joypack\Tencent\Map\Option;
/**
* 坐标转换
* 参数
*/
class TranslateOption extends Option
{
const TYPE_GPS = 1;
const TYPE_SOGOU = 2;
const TYPE_BAIDU = 3;
const TYPE_MAPBAR = 4;
const TYPE_DEFAULT = 5;
const TYPE_SOGOU_MERCATOR = 6;
/**
* 预转换的坐标
* @param string $value
*/
public function setLocation($lat, $lng)
{
$this->option['locations'] = "{$lat},{$lng}";
}
/**
* 预转换的坐标,支持批量转换
* @param array $locations
* <p>['lat,lng', [lat,lng]]</p>
*/
public function setLocations(array $locations)
{
$pieces = [];
foreach ($locations as $item) {
if(is_array($item)) {
$pieces[] = "{$item[0]},{$item[1]}";
}
}
$this->option['locations'] = implode(';', $pieces);
}
/**
* 设置坐标类型
* @param number $value
* 1 GPS坐标
* 2 sogou经纬度
* 3 baidu经纬度
* 4 mapbar经纬度
* 5 腾讯、google、高德坐标[默认]
* 6 sogou墨卡托
*/
public function setType($value=self::TYPE_DEFAULT)
{
$this->option['type'] = $value;
}
}