x = $x[0];
$this->y = $x[1];
$this->z = isset($x[2]) ? $x[2] : 0.0;#(count( $x ) > 2) ? $x[2] : 0.0;
} else if( is_string( $x ) && !is_numeric( $y ) ) {
$coord = explode( ' ', $x );
$this->x = floatval( $coord[0] );
$this->y = floatval( $coord[1] );
$this->z = (count( $coord ) > 2) ? floatval( $coord[2] ) : 0.0;
} else {
$this->x = $x !== null ? $x : 0.0;
$this->y = $y !== null ? $y : 0.0;
$this->z = $z !== null ? $z : 0.0;
}
}
/**
* APIMethod: clone
* Build a copy of a Proj4js.Point object.
*
* renamed because of PHP keyword.
*
* Return:
* {Proj4js}.Point the cloned point.
*/
public function _clone() {
return new Proj4phpPoint( $this->x, $this->y, $this->z );
}
/**
* APIMethod: toString
* Return a readable string version of the point
*
* Return:
* {String} String representation of Proj4js.Point object.
* (ex. "x=5,y=42")
*/
public function toString() {
return "x=" . $this->x . ",y=" . $this->y;
}
/**
* APIMethod: toShortString
* Return a short string version of the point.
*
* Return:
* {String} Shortened String representation of Proj4js.Point object.
* (ex. "5, 42")
*/
public function toShortString() {
return $this->x . " " . $this->y;
}
}