/** * Renders the javascript container sizes. * * @param \Ivory\GoogleMap\Map $map The map. * * @return string The JS output. */ public function renderJsContainerSizes(Map $map) { $output = array(); foreach ($this->computeSizes($map) as $size) { $output[] = sprintf('%s.sizes.%s = %s', $this->getJsContainerName($map), $size->getJavascriptVariable(), $this->sizeHelper->render($size)); } return implode('', $output); }
public function testRenderWithUnits() { $size = new Size(1.1, 2.1, 'px', '%'); $size->setJavascriptVariable('foo'); $this->assertSame('foo = new google.maps.Size(1.1, 2.1, "px", "%");' . PHP_EOL, $this->sizeHelper->render($size)); }