用于编码谷歌地图的编码多段线的库。

v1.0.1 2024-08-20 12:00 UTC

This package is auto-updated.

Last update: 2024-09-20 12:15:24 UTC


README

这是一个在PHP中实现谷歌Polyline编码算法的简单实现。

main License: MIT

安装

此包目前支持PHP 8.2及以上版本。

composer require sourcetoad/bytey

文档

编码

use Sourcetoad\Bytey;

$points = [
    [38.5, -120.2],
    [40.7, -120.95],
    [43.252, -126.453]
];

$encoded = Bytey::googlePolylineEncode($points);
// Outputs "_p~iF~ps|U_ulLnnqC_mqNvxq`@"