PHP Class Polyline, google-map-polyline-encoding-tool

Convert list of points to encoded string following Google's Polyline Algorithm.
Afficher le fichier Open project: emcconville/google-map-polyline-encoding-tool Class Usage Examples

Protected Properties

Свойство Type Description
$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.

Méthodes publiques

Méthode Description
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

Method Details

decode() final public static méthode

Reverse Google Polyline algorithm on encoded string.
final public static decode ( string $string ) : array
$string string Encoded string to extract points from.
Résultat array points

encode() final public static méthode

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.
Résultat string encoded string

flatten() final public static méthode

Reduce multi-dimensional to single list
final public static flatten ( array $array ) : array
$array array Subject array to flatten.
Résultat array flattened

pair() final public static méthode

Concat list into pairs of points
final public static pair ( array $list ) : array
$list array One-dimensional array to segment into list of tuples.
Résultat array pairs

Property Details

$precision protected_oe static_oe property

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
Résultat integer