定制 jackmartin/laravel-yandex-geocode 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jackmartin/laravel-yandex-geocode

最新稳定版本:v1.2.1

Composer 安装命令:

composer require jackmartin/laravel-yandex-geocode

包简介

Simply service laravel Yandex Geocoding

README 文档

README

Simply package laravel Yandex.Geocoding

Latest Stable Version Total Downloads License

Installation

Run composer require command.

composer require jackmartin/laravel-yandex-geocode

Laravel Setting

After updating composer, register the service provider in bootstrap\app.php

Yandex\Geocode\YandexGeocodeServiceProvider::class

Add then alias YaGeo adding its facade to the aliases array in the same file:

'YaGeo' => Yandex\Geocode\Facades\YandexGeocodeFacade::class

Configuration parameters package

Api page: https://tech.yandex.ru/maps/doc/geocoder/desc/concepts/input_params-docpage/

Copy file config yandex-geocoding.php in config folder

php artisan vendor:publish

Select Tag: yandex-geocoding-config

or

php artisan vendor:publish --provider="Yandex\Geocode\YandexGeocodeServiceProvider" --tag="yandex-geocoding-config"

Api key

'api_key' => ''

Api version

'api_version' => '1.x'

Language api response

'language' => 'uk_UA'

Skip object in query

'skip_object' => 0

Usage

dd(

    \YaGeo::make()->setQuery('Ukraine, Kiev')->load()

);

Methods

  1. Get raw data response
  2. Get data response
  3. Get name country
  4. Get name region
  5. Get name district
  6. Get name locality
  7. Get name street
  8. Get house number
  9. Get full raw address
  10. Get full address
  11. Get latitude
  12. Get longitude
  13. Get type

Laravel Яндекс.Геокодирование

Простой пакет laravel Яндекс.Геокодирование

Установка

Установить пакет с помощью composer

composer require jackmartin/laravel-yandex-geocode

Laravel настройка пакета

После установки пакета с помощью composer, зарегистрируйте сервис пакета в файле bootstrap/app.php:

Yandex\Geocode\YandexGeocodeServiceProvider::class

Затем для быстрого вызов класса пакета, добавьте псевдоним в этот же файле:

'YaGeo' => Yandex\Geocode\Facades\YandexGeocodeFacade::class

Настройка параметров пакета

Документация: https://tech.yandex.ru/maps/doc/geocoder/desc/concepts/input_params-docpage/

Копируем файл настроек yandex-geocondig.php в config папку

php artisan vendor:publish

Выбираем Tag: yandex-geocoding-config

или

php artisan vendor:publish --provider="Yandex\Geocode\YandexGeocodeServiceProvider" --tag="yandex-geocoding-config"

Ключ API

'api_key' => ''

API версия

'api_version' => '1.x'

Язык ответа

'language' => 'uk_UA'

Количество пропускаемых объектов в запросе

'skip_object' => 0

Использование

dd(

    \YaGeo::make()->setQuery('Украина, Киев')->load()

);

Методы

  1. Получить сырые данные ответа
  2. Получить данные ответа
  3. Получить имя страны
  4. Получить имя области
  5. Получить имя района
  6. Получить имя населенного пункта
  7. Получить имя улицы
  8. Получить номер дома
  9. Получить полный сырой адрес
  10. Получить полный адрес
  11. Получить широту
  12. Получить долготу
  13. Получить тип

Methods - Методы:

getRawData()

use YaGeo;

$data = YaGeo::setQuery('Kiev, Vishnevoe, Lesi Ukrainki, 57')->load();

$data = $data->getResponse()->getRawData();

getData()

use YaGeo;

$data = YaGeo::setQuery('Kiev, Vishnevoe, Lesi Ukrainki, 57')->load();

$data = $data->getResponse()->getData();

getCountry()

use YaGeo;

$data = YaGeo::setQuery('Kiev, Vishnevoe, Lesi Ukrainki, 57')->load();

$data = $data->getResponse()->getCountry();

getRegion()

use YaGeo;

$data = YaGeo::setQuery('Kiev, Vishnevoe, Lesi Ukrainki, 57')->load();

$data = $data->getResponse()->getCountry();

getDistrict()

use YaGeo;

$data = YaGeo::setQuery('Kiev, Vishnevoe, Lesi Ukrainki, 57')->load();

$data = $data->getResponse()->getDistrict();

getLocality()

use YaGeo;

$data = YaGeo::setQuery('Kiev, Vishnevoe, Lesi Ukrainki, 57')->load();

$data = $data->getResponse()->getLocality();

getStreet()

use YaGeo;

$data = YaGeo::setQuery('Kiev, Vishnevoe, Lesi Ukrainki, 57')->load();

$data = $data->getResponse()->getStreet();

getHouseNumber()

use YaGeo;

$data = YaGeo::setQuery('Kiev, Vishnevoe, Lesi Ukrainki, 57')->load();

$data = $data->getResponse()->getHouseNumber();

getRawFullAddress()

use YaGeo;

$data = YaGeo::setQuery('Kiev, Vishnevoe, Lesi Ukrainki, 57')->load();

$data = $data->getResponse()->getRawFullAddress();

getFullAddress()

use YaGeo;

$data = YaGeo::setQuery('Kiev, Vishnevoe, Lesi Ukrainki, 57')->load();

$data = $data->getResponse()->getFullAddress();

getLatitude()

use YaGeo;

$data = YaGeo::setQuery('Kiev, Vishnevoe, Lesi Ukrainki, 57')->load();

$data = $data->getResponse()->getLatitude();

getLongitude()

use YaGeo;

$data = YaGeo::setQuery('Kiev, Vishnevoe, Lesi Ukrainki, 57')->load();

$data = $data->getResponse()->getLongitude();

getType()

use YaGeo;

$data = YaGeo::setQuery('Kiev, Vishnevoe, Lesi Ukrainki, 57')->load();

$data = $data->getResponse()->getType();

统计信息

  • 总下载量: 15.34k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 11
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 10
  • Watchers: 3
  • Forks: 55
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-08-06