adrianoalves/google-geolocation 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

adrianoalves/google-geolocation

Composer 安装命令:

composer require adrianoalves/google-geolocation

包简介

Simple, resource saver, framework-agnostic, lightweight and vanilla PHP geolocation service using Google Geo API

README 文档

README

Resource saving, lightweight, framework-agnostic google geo location services in vanilla PHP

What we can do

  1. Get Latitude and Longitude Coordinates of a Human readable Address with GeoCoder;

  2. Calculates the distance and time between 2 physical points from its Human readable addresses considering the way and riding mode.

Get it started

How to install

You can clone this repository or use composer to install this package:

composer require adrianoalves/google-geolocation

Prior to use this package, you need an api key, register as a google developer, create a project with a billing account and generate your api key. To learn more visit the official google documentation.

  • Using the Geocoder
// a simplest example
$geoCoder = new \Geolocation\GeoCoder\GeoCoder( 'yoUr-aPiKey-hEre' );
// getting the latitude and longitude of an address
$result = $geoCoder->request( 'Praça da Sé, São Paulo, SP' );
var_dump( $result );
  • Using the Distance Matrix
// same simplest example here
$distanceMatrix = new \Geolocation\DistanceMatrix\DistanceMatrix( 'yoUr-aPiKey-hEre' );
// getting the distance in metrics and the time in seconds from an address to another
$result = $distanceMatrix->request( ['Praça da Sé, São Paulo, SP'], ['Avenida Paulista, 1, São Paulo, SP'] );
var_dump( $result );

There is a examples directory where you can learn more about how to use it easily.

I appreciate any suggestions, critics, comments and bug report, so please let me know.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-11-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固