Example #1
0
 /**
  * Renders the javascript container points.
  *
  * @param \Ivory\GoogleMap\Map $map The map.
  *
  * @return string The JS output.
  */
 public function renderJsContainerPoints(Map $map)
 {
     $output = array();
     foreach ($this->computePoints($map) as $point) {
         $output[] = sprintf('%s.points.%s = %s', $this->getJsContainerName($map), $point->getJavascriptVariable(), $this->pointHelper->render($point));
     }
     return implode('', $output);
 }
 public function testRender()
 {
     $point = new Point(1.1, 2.1);
     $point->setJavascriptVariable('foo');
     $this->assertSame('foo = new google.maps.Point(1.1, 2.1);' . PHP_EOL, $this->pointHelper->render($point));
 }