setCoordX($x); $this->setCoordY($y); } /** * * Sets X coordenate of the point * @param integer $x */ public function setCoordX( $x ){ if( !is_numeric($x) ) throw new CException(Yii::t('EGMap','X Coordenate must be a numeric string or a number!')); $this->_x = $x; } /** * * Sets Y coordenate of the point * @param integer $y */ public function setCoordY( $y ){ if( !is_numeric($y) ) throw new CException(Yii::t('EGMap','Y Coordenate must be a numeric string or a number!')); $this->_y = $y; } /** * * returns array representation of the coords */ public function toArray(){ return array('x'=>$this->_x, 'y'=>$this->_y); } /** * @return string Javascript code to return the Point */ public function toJs() { return ' new google.maps.Point('.$this->_x.','.$this->_y.')'; } }