public function projectPoint($point) { list($x, $y) = self::getXYFromPoint($point); error_log("projecting $x, $y"); if ($this->srcProj == $this->dstProj) { return array('lon' => $x, 'lat' => $y); } $result = $point; if ($this->srcProjSpec) { $fromProjection = new MapProjection($this->srcProjSpec); if (!$fromProjection->isGeographic()) { $fromProjection->setXY(array('x' => $x, 'y' => $y)); $result = $fromProjection->getLatLon(); } } if ($this->dstProjSpec) { $toProjection = new MapProjection($this->dstProjSpec); if (!$toProjection->isGeographic()) { list($x, $y) = self::getXYFromPoint($result); $toProjection->setLatLon(array('lon' => $x, 'lat' => $y)); $result = $toProjection->getXY(); } } list($x, $y) = self::getXYFromPoint($result); error_log("result: $x, $y"); return $result; }