geocoder-php/yandex-provider

Geocoder Yandex 插件

4.5.0 2022-07-30 12:09 UTC

This package is auto-updated.

Last update: 2024-09-04 10:55:37 UTC


README

Build Status Latest Stable Version Total Downloads Monthly Downloads Code Coverage Quality Score Software License

这是 PHP Geocoder 的 Yandex 提供者。这是一个 只读 仓库。有关信息和文档,请参阅 主仓库

安装

composer require geocoder-php/yandex-provider

使用方法

现在 API 需要一个 API 密钥。有关更多信息,请参阅 此处

$httpClient = new \Http\Discovery\Psr18Client();
$provider = new \Geocoder\Provider\Yandex\Yandex($httpClient, null, '<your-api-key>);

$result = $geocoder->geocodeQuery(GeocodeQuery::create('ул.Ленина, 19, Минск 220030, Республика Беларусь'));
$result = $geocoder->reverseQuery(ReverseQuery::fromCoordinates(...));

注意

默认语言-区域设置为 ru-RU,您可以选择 uk-UAbe-BYen-USen-BRtr-TR

可以通过精确地点名称来获取更精确的逆向地理编码结果:housestreetmetrodistrictlocality

贡献

欢迎贡献!请向 主仓库 发送拉取请求或在任何 问题跟踪器 上报告您发现的问题。