/** * Renders the size * * @param Ivory\GoogleMapBundle\Model\Size $size * @return string HTML output */ public function render(Size $size) { if ($size->hasUnits()) { return sprintf('new google.maps.Size(%s, %s, "%s", "%s")', $size->getWidth(), $size->getHeight(), $size->getWidthUnit(), $size->getHeightUnit()); } else { return sprintf('new google.maps.Size(%s, %s)', $size->getWidth(), $size->getHeight()); } }
/** * Create a size * * @param integer $width The with * @param integer $height The height * @param string $widthUnit The with unit * @param string $heightUnit The height unit */ public function __construct($width = 1, $height = 1, $widthUnit = null, $heightUnit = null) { parent::__construct($width, $height, $widthUnit, $heightUnit); }