/** * Sets the info window position * * Available prototypes: * - function setPosition(Ivory\GoogleMap\Base\Coordinate $position = null) * - function setPosition(double $latitude, double $longitude, boolean $noWrap = true) * * @throws \Ivory\GoogleMap\Exception\OverlayException If the position is not valid. */ public function setPosition() { $args = func_get_args(); if (isset($args[0]) && $args[0] instanceof Coordinate) { $this->position = $args[0]; } elseif (isset($args[0]) && is_numeric($args[0]) && (isset($args[1]) && is_numeric($args[1]))) { if ($this->position === null) { $this->position = new Coordinate(); } $this->position->setLatitude($args[0]); $this->position->setLongitude($args[1]); if (isset($args[2]) && is_bool($args[2])) { $this->position->setNoWrap($args[2]); } } elseif (!isset($args[0])) { $this->position = null; } else { throw OverlayException::invalidInfoWindowPosition(); } }