endlessmiles/polyline

一个用于将 Google Polyline 字符串解码成经纬度对数组的包。

1.0.1 2022-06-06 05:34 UTC

This package is auto-updated.

Last update: 2024-09-06 10:17:08 UTC


README

一个 Laravel composer 包,用于将 Google Polyline 字符串解码成 GPS 坐标对数组。兼容 PHP 7.4 或更高版本。

安装

在项目目录的根目录下运行以下命令

composer require endlessmiles/polyline

使用

此包非常易于使用

$coordinates = Polyline::decode($polylineString);

该函数返回经度和纬度对的数组

[
    [latitute_float1, longitude_float1],
    [latitute_float2, longitude_float2],
    [latitute_float3, longitude_float3],
]