endlessmiles/polyline

A comopser package to decode Google Polyline strings into an array of latlng pairs.

1.0.1 2022-06-06 05:34 UTC

This package is auto-updated.

Last update: 2025-05-06 11:55:32 UTC


README

A Laravel composer package to decode Google Polyline strings into an array of GPS coordinate pairs. Compatible with PHP 7.4 or higher.

Installation

Run the following command in the root of your project directory:

composer require endlessmiles/polyline

Use

The package is very simple to use:

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

The function returns an array of pairs of latitude and longitude:

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