salavert/open-location-code

此包已被 废弃 且不再维护。未建议替代包。

Google Open Location Codes 的 PHP 版本。

v1.0 2015-05-02 12:01 UTC

This package is not auto-updated.

Last update: 2022-10-09 08:37:34 UTC


README

Build Status

Google Open Location Codes 的 PHP 版本。

Open Location Codes 是一种简短的生成代码,可用于没有街道地址的地方,类似于街道地址。

http://openlocationcode.com

Open Location Codes 是在 Google 苏黎世工程办公室开发的,然后开源,以便可以免费使用。

使用方法

将经纬度编码为代码

$latitude = 51.3701125;
$longitude = -1.217765625;
$olc = new OpenLocationCodes();
$openLocationCode = $olc->encode($latitude, $longitude); // Will return 9C3W9QCJ+2V

安装

更新您的 composer.json

"require": {
	"salavert/open-location-code": "1.*"
}

或使用 composer 的 require 命令

composer require salavert/open-location-code:1.*

Google 的原始代码

https://github.com/google/open-location-code