/**
  * Checks the render method
  */
 public function testRender()
 {
     $mapTypeControlTest = new MapTypeControl();
     $mapTypeControlTest->setMapTypeIds(array(MapTypeId::ROADMAP));
     $mapTypeControlTest->setControlPosition(ControlPosition::BOTTOM_CENTER);
     $mapTypeControlTest->setMapTypeControlStyle(MapTypeControlStyle::DROPDOWN_MENU);
     $this->assertEquals(self::$mapTypeControlHelper->render($mapTypeControlTest), '{"mapTypeIds":[google.maps.MapTypeId.ROADMAP],"position":google.maps.ControlPosition.BOTTOM_CENTER,"style":google.maps.MapTypeControlStyle.DROPDOWN_MENU}');
 }
 /**
  * Renders the map type control
  *
  * @param Ivory\GoogleMapBundle\Model\Controls\MapTypeControl $mapTypeControl
  * @return string HTML output
  */
 public function render(MapTypeControl $mapTypeControl)
 {
     $mapTypeIds = array();
     foreach ($mapTypeControl->getMapTypeIds() as $mapTypeId) {
         $mapTypeIds[] = $this->mapTypeIdHelper->render($mapTypeId);
     }
     return sprintf('{"mapTypeIds":[%s],"position":%s,"style":%s}', implode(', ', $mapTypeIds), $this->controlPositionHelper->render($mapTypeControl->getControlPosition()), $this->mapTypeControlStyleHelper->render($mapTypeControl->getMapTypeControlStyle()));
 }
 /**
  * Create a map type control
  */
 public function __construct()
 {
     parent::__construct();
 }
 /**
  * Checks the map type control getter & setter
  */
 public function testMapTypeControl()
 {
     $mapTypeControlTest = new Controls\MapTypeControl();
     $mapTypeControlTest->setMapTypeIds(array(Model\MapTypeId::ROADMAP));
     $mapTypeControlTest->setControlPosition(Controls\ControlPosition::BOTTOM_CENTER);
     $mapTypeControlTest->setMapTypeControlStyle(Controls\MapTypeControlStyle::HORIZONTAL_BAR);
     $this->assertFalse(self::$map->hasMapTypeControl());
     $this->assertFalse(self::$map->hasMapOption('mapTypeControl'));
     self::$map->setMapTypeControl($mapTypeControlTest);
     $this->assertTrue(self::$map->hasMapTypeControl());
     $this->assertEquals(self::$map->getMapTypeControl()->getMapTypeIds(), array('roadmap'));
     $this->assertEquals(self::$map->getMapTypeControl()->getControlPosition(), 'bottom_center');
     $this->assertEquals(self::$map->getMapTypeControl()->getMapTypeControlStyle(), 'horizontal_bar');
     $this->assertTrue(self::$map->hasMapOption('mapTypeControl'));
     self::$map->setMapTypeControl(array(Model\MapTypeId::SATELLITE), Controls\ControlPosition::BOTTOM_LEFT, Controls\MapTypeControlStyle::DROPDOWN_MENU);
     $this->assertEquals(self::$map->getMapTypeControl()->getMapTypeIds(), array('satellite'));
     $this->assertEquals(self::$map->getMapTypeControl()->getControlPosition(), 'bottom_left');
     $this->assertEquals(self::$map->getMapTypeControl()->getMapTypeControlStyle(), 'dropdown_menu');
     self::$map->setMapTypeControl(null);
     $this->assertNull(self::$map->getMapTypeControl());
     $this->assertFalse(self::$map->hasMapOption('mapTypeControl'));
     $this->setExpectedException('InvalidArgumentException');
     self::$map->setMapTypeControl('foo');
 }