public function testDefaultState() { $this->assertSame('<p>Default content</p>', $this->infoWindow->getContent()); $this->assertNull($this->infoWindow->getPosition()); $this->assertFalse($this->infoWindow->hasPixelOffset()); $this->assertFalse($this->infoWindow->isOpen()); $this->assertTrue($this->infoWindow->isAutoOpen()); $this->assertSame(MouseEvent::CLICK, $this->infoWindow->getOpenEvent()); $this->assertFalse($this->infoWindow->isAutoClose()); }
/** * Configures the json builder in order to render an info window. * * @param \Ivory\GoogleMap\Helper\Overlays\InfoWinfow $infoWindow The info window. * @param boolean $renderPosition TRUE if the position is rendered else FALSE. */ protected function doRender(InfoWindow $infoWindow, $renderPosition) { $this->jsonBuilder->reset(); if ($renderPosition) { $this->jsonBuilder->setValue('[position]', $infoWindow->getPosition()->getJavascriptVariable(), false); } if ($infoWindow->hasPixelOffset()) { $this->jsonBuilder->setValue('[pixelOffset]', $infoWindow->getPixelOffset()->getJavascriptVariable(), false); } $this->jsonBuilder->setValue('[content]', $infoWindow->getContent())->setValues($infoWindow->getOptions()); }