/** * Checks the render method */ public function testRender() { $mapTest = new Map(); $boundTest = new Bound(); $boundTest->setSouthWest(new Coordinate(-1.1, -2.1, true)); $boundTest->setNorthEast(new Coordinate(1.1, 2.1, true)); $groundOverlayTest = new GroundOverlay(); $groundOverlayTest->setUrl('url'); $groundOverlayTest->setBound($boundTest); $this->assertEquals(self::$groundOverlayHelper->render($groundOverlayTest, $mapTest), 'var ' . $groundOverlayTest->getBound()->getJavascriptVariable() . ' = new google.maps.LatLngBounds(new google.maps.LatLng(-1.1, -2.1, true), new google.maps.LatLng(1.1, 2.1, true));' . PHP_EOL . 'var ' . $groundOverlayTest->getJavascriptVariable() . ' = new google.maps.GroundOverlay("' . $groundOverlayTest->getUrl() . '", ' . $groundOverlayTest->getBound()->getJavascriptVariable() . ', {"map":' . $mapTest->getJavascriptVariable() . '});' . PHP_EOL); $groundOverlayTest->setOptions(array('option1' => 'value1', 'option2' => 'value2')); $this->assertEquals(self::$groundOverlayHelper->render($groundOverlayTest, $mapTest), 'var ' . $groundOverlayTest->getBound()->getJavascriptVariable() . ' = new google.maps.LatLngBounds(new google.maps.LatLng(-1.1, -2.1, true), new google.maps.LatLng(1.1, 2.1, true));' . PHP_EOL . 'var ' . $groundOverlayTest->getJavascriptVariable() . ' = new google.maps.GroundOverlay("' . $groundOverlayTest->getUrl() . '", ' . $groundOverlayTest->getBound()->getJavascriptVariable() . ', {"map":' . $mapTest->getJavascriptVariable() . ',"option1":"value1","option2":"value2"});' . PHP_EOL); }
/** * Checks the render ground overlays method */ public function testRenderGroundOverlays() { $mapTest = new Model\Map(); $groundOverlayTest = new Overlays\GroundOverlay(); $groundOverlayTest->setUrl('url'); $groundOverlayTest->setBound(new Base\Coordinate(-1.1, -2.1, true), new Base\Coordinate(1.1, 2.1, true)); $mapTest->addGroundOverlay($groundOverlayTest); $this->assertEquals(self::$mapHelper->renderGroundOverlays($mapTest), 'var ' . $groundOverlayTest->getBound()->getJavascriptVariable() . ' = new google.maps.LatLngBounds(new google.maps.LatLng(-1.1, -2.1, true), new google.maps.LatLng(1.1, 2.1, true));' . PHP_EOL . 'var ' . $groundOverlayTest->getJavascriptVariable() . ' = new google.maps.GroundOverlay("url", ' . $groundOverlayTest->getBound()->getJavascriptVariable() . ', {"map":' . $mapTest->getJavascriptVariable() . '});' . PHP_EOL); }