PHP Класс Polyline, google-map-polyline-encoding-tool

Convert list of points to encoded string following Google's Polyline Algorithm.
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$precision integer Overwrite this property in extended class to adjust precision of numbers. !!!CAUTION!!! 1) Adjusting this value will not guarantee that third party libraries will understand the change. 2) Float point arithmetic IS NOT real number arithmetic. PHP's internal float precision may contribute to undesired rounding.

Открытые методы

Метод Описание
decode ( string $string ) : array Reverse Google Polyline algorithm on encoded string.
encode ( array $points ) : string Apply Google Polyline algorithm to list of points.
flatten ( array $array ) : array Reduce multi-dimensional to single list
pair ( array $list ) : array Concat list into pairs of points

Описание методов

decode() закрытый публичный статический Метод

Reverse Google Polyline algorithm on encoded string.
final public static decode ( string $string ) : array
$string string Encoded string to extract points from.
Результат array points

encode() закрытый публичный статический Метод

Apply Google Polyline algorithm to list of points.
final public static encode ( array $points ) : string
$points array List of points to encode. Can be a list of tuples, or a flat on dimensional array.
Результат string encoded string

flatten() закрытый публичный статический Метод

Reduce multi-dimensional to single list
final public static flatten ( array $array ) : array
$array array Subject array to flatten.
Результат array flattened

pair() закрытый публичный статический Метод

Concat list into pairs of points
final public static pair ( array $list ) : array
$list array One-dimensional array to segment into list of tuples.
Результат array pairs

Описание свойств

$precision защищенное статическое свойство

Overwrite this property in extended class to adjust precision of numbers. !!!CAUTION!!! 1) Adjusting this value will not guarantee that third party libraries will understand the change. 2) Float point arithmetic IS NOT real number arithmetic. PHP's internal float precision may contribute to undesired rounding.
protected static int $precision
Результат integer