--- polyline_encoder/class.polylineEncoder.php 2008-12-10 18:36:04.000000000 +0100 +++ enrico/class.polylineEncoder.php 2009-07-15 08:59:50.000000000 +0200 @@ -51,6 +51,8 @@ */ public function encode($points) { + $absMaxDist = 0; + if(count($points) > 2) { $stack[] = array(0, count($points)-1); @@ -140,6 +142,8 @@ private function createEncodings($points, $dists) { + $plat = 0; $plng = 0; $encoded_points = ''; + for($i=0; $iforceEndpoints) { $encoded_levels .= $this->encodeNumber($this->numLevels-1); @@ -189,6 +195,8 @@ private function encodeNumber($num) { + $encodeString = ''; + while($num >= 0x20) { $nextValue = (0x20 | ($num & 0x1f)) + 63;