/** * Checks the map street view control getter & setter */ public function testStreetViewControl() { $streetViewControlTest = new Controls\StreetViewControl(); $streetViewControlTest->setControlPosition(Controls\ControlPosition::BOTTOM_CENTER); $this->assertFalse(self::$map->hasStreetViewControl()); $this->assertFalse(self::$map->hasMapOption('streetViewControl')); self::$map->setStreetViewControl($streetViewControlTest); $this->assertTrue(self::$map->hasStreetViewControl()); $this->assertEquals(self::$map->getStreetViewControl()->getControlPosition(), 'bottom_center'); $this->assertTrue(self::$map->hasMapOption('streetViewControl')); self::$map->setStreetViewControl(Controls\ControlPosition::BOTTOM_LEFT); $this->assertEquals(self::$map->getStreetViewControl()->getControlPosition(), 'bottom_left'); self::$map->setStreetViewControl(null); $this->assertNull(self::$map->getStreetViewControl()); $this->assertFalse(self::$map->hasMapOption('streetViewControl')); $this->setExpectedException('InvalidArgumentException'); self::$map->setStreetViewControl('foo'); }
/** * Create a street view control */ public function __construct() { parent::__construct(); }
/** * Checks the render method */ public function testRender() { $streetViewControl = new StreetViewControl(); $streetViewControl->setControlPosition(ControlPosition::BOTTOM_CENTER); $this->assertEquals(self::$streetViewControlHelper->render($streetViewControl), '{"position":google.maps.ControlPosition.BOTTOM_CENTER}'); }
/** * Renders the street view control * * @param Ivory\GoogleMapBundle\Model\Controls\StreetViewControl $streetViewControl * @return string HTML output */ public function render(StreetViewControl $streetViewControl) { return sprintf('{"position":%s}', $this->controlPositionHelper->render($streetViewControl->getControlPosition())); }