PHP 클래스 Polyline, google-map-polyline-encoding-tool

Convert list of points to encoded string following Google's Polyline Algorithm.
파일 보기 프로젝트 열기: emcconville/google-map-polyline-encoding-tool 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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