graychen/geolocation
Composer 安装命令:
composer require graychen/geolocation
包简介
Get the geographic location based on latitude and longitude
README 文档
README
composer包 根据经纬度得到地理位置信息,暂时还只有baidu地图api接口
this is a library for find address by geolocation
how to use
<?php namespace graychen\Tests; use PHPUnit\Framework\TestCase; use graychen\geolocation\BaiduGeolocation; class BaiduGeolocationTest extends TestCase { private $geolocation; public function setUp() { $this->geolocation=new BaiduGeolocation(); } /** * Asserts that the container can set and get a simple closure with args. */ public function testGetgeolocation() { $this->geolocation->latitude= "your latitude"; $this->geolocation->longitude= "your longitude"; $this->geolocation->ak= "your ak"; $json_content=$this->geolocation->getGeolocation(); $province=$json_content["result"]["addressComponent"]["province"]; $this->assertEquals("江苏省", $province); } }
统计信息
- 总下载量: 1.5k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-07-17