public static function encode($path) {
        
        $lastLat = 0;
        $lastLng = 0;

        $result = '';

        foreach( $path as $point ) {
            $lat = round( $point['lat'] * 1e5);
            $lng = round( $point['lng'] * 1e5);
            
            $dLat = $lat - $lastLat;
            $dLng = $lng - $lastLng;

            self::enc($dLat);
            self::enc($dLng);

            $lastLat = $lat;
            $lastLng = $lng;
        }
        return self::$result;
    }
public static function encode($path) {
        
        $lastLat = 0;
        $lastLng = 0;

        $result = '';

        foreach( $path as $point ) {
            $lat = round( $point['lat'] * 1e5);
            $lng = round( $point['lng'] * 1e5);
            
            $dLat = $lat - $lastLat;
            $dLng = $lng - $lastLng;

            self::enc($dLat);
            self::enc($dLng);

            $lastLat = $lat;
            $lastLng = $lng;
        }
        return self::$result;
    }
public static function encode ( $ path ) { $ lastLat = 0 ; $ lastLng = 0 ; $ result = '' ; foreach ( $ path as $ point ) { $ lat = round ( $ point [ 'lat' ] * 1e5 ) ; $ lng = round ( $ point [ 'lng' ] * 1e5 ) ; $ dLat = $ lat - $ lastLat ; $ dLng = $ lng - $ lastLng ; self :: enc ( $ dLat ) ; self :: enc ( $ dLng ) ; $ lastLat = $ lat ; $ lastLng = $ lng ; } return self :: $ result ; }
Encodes a sequence of LatLngs into an encoded path string.
Encodes a sequence of LatLngs into an encoded path string .