/** * Renders a size. * * @param \Ivory\GoogleMap\Base\Size $size The size. * * @return string The JS output. */ public function render(Size $size) { if ($size->hasUnits()) { return sprintf('%s = new google.maps.Size(%s, %s, "%s", "%s");' . PHP_EOL, $size->getJavascriptVariable(), $size->getWidth(), $size->getHeight(), $size->getWidthUnit(), $size->getHeightUnit()); } return sprintf('%s = new google.maps.Size(%s, %s);' . PHP_EOL, $size->getJavascriptVariable(), $size->getWidth(), $size->getHeight()); }