Download the PHP package reprover/amap without Composer

On this page you can find all versions of the php package reprover/amap. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package amap

高德开放平台API封装SDK

小版本更新了psr规范

之前对这方面了解不多,因此写的可能有点问题。

但是欢迎指出错误而不是带着一股子嘲讽过来喷人好吗。

用处不多维护精力比较少

但基本够用

注:可能有不兼容改动,一些类名大小写可能有问题 请注意

需求

php >=7.0.0
guzzlehttp/guzzlehttp:^6.3

没有安装guzzlehttp也不要紧,在require的时候回自动安装

安装

composer require reprover/amap

用法

use Reprover\Amap\Amap;

(1)

$amap = new Amap();
$gateway = $amap->uses("Georegeo")->gateway("geo")->build(["key"=>"你的api key",...其他选项]);
//这里支持setKey("key值");
//这里支持useHttps(true);
$result = $gateway->ask();

如果不需要额外的配置,可以用以下方法:

(2)

$gateway = Amap::use("georegeo")->gateway("regeo")->build(...);
$result = $gateway->ask();

(3) 如果请求的接口大类只有一个子方法(例如坐标转换),则可以省略gateway()方法

$gateway = Amap::use("convert")->build(...);
$result = $gateway->ask();

额外方法

build方法传什么?

$config 参数,参数列表为一数组,具体实现为一 Reprover/Support/Config 对象,

返回结果为一个 Reprover\AMap\Support\Result 对象,类似于 LaravelCollection ,不过没那么全面。可用的方法:

所得数据结果数量,如果有多种类型结果则只返回主要数据(如天气只返回实时天气数量,天气预报也可以用 $result->forecast )获取。

可以用 foreach 进行结果的循环

判断结果是否正确,即根据高德返回数据 status(errcode) 是否为 1(0)

部分特殊接口有一些特殊用法,开发ing

说明:

这个sdk是第一版(目前看起来好像不会更新了的样子),还存在很多不足的地方,欢迎大家指正。

接下来的任务:


All versions of amap with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.0
guzzlehttp/guzzle Version ^7.1.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package reprover/amap contains the following files

Loading the files please wait ....