public function testMultipleBuildWithReset()
 {
     $this->coordinateBuilder->setPrefixJavascriptVariable('foo')->setLatitude(1)->setLongitude(2)->setNoWrap(false);
     $coordinate1 = $this->coordinateBuilder->build();
     $this->coordinateBuilder->reset();
     $coordinate2 = $this->coordinateBuilder->build();
     $this->assertSame('foo', substr($coordinate1->getJavascriptVariable(), 0, 3));
     $this->assertSame(1, $coordinate1->getLatitude());
     $this->assertSame(2, $coordinate1->getLongitude());
     $this->assertFalse($coordinate1->isNoWrap());
     $this->assertSame('coordinate_', substr($coordinate2->getJavascriptVariable(), 0, 11));
     $this->assertSame(0, $coordinate2->getLatitude());
     $this->assertSame(0, $coordinate2->getLongitude());
     $this->assertTrue($coordinate2->isNoWrap());
 }
 /**
  * {@inheritdoc}
  *
  * @return \Ivory\GoogleMap\Overlays\InfoWindow The info window.
  */
 public function build()
 {
     $infoWindow = new $this->class();
     if ($this->prefixJavascriptVariable !== null) {
         $infoWindow->setPrefixJavascriptVariable($this->prefixJavascriptVariable);
     }
     if ($this->content !== null) {
         $infoWindow->setContent($this->content);
     }
     if (!empty($this->position)) {
         $position = $this->coordinateBuilder->reset()->setLatitude($this->position[0])->setLongitude($this->position[1])->setNoWrap($this->position[2])->build();
         $infoWindow->setPosition($position);
     }
     if (!empty($this->pixelOffset)) {
         $pixelOffset = $this->sizeBuilder->reset()->setWidth($this->pixelOffset[0])->setHeight($this->pixelOffset[1])->setWidthUnit($this->pixelOffset[2])->setHeightUnit($this->pixelOffset[3])->build();
         $infoWindow->setPixelOffset($pixelOffset);
     }
     if ($this->open !== null) {
         $infoWindow->setOpen($this->open);
     }
     if ($this->openEvent !== null) {
         $infoWindow->setOpenEvent($this->openEvent);
     }
     if ($this->autoOpen !== null) {
         $infoWindow->setAutoOpen($this->autoOpen);
     }
     if ($this->autoClose !== null) {
         $infoWindow->setAutoClose($this->autoClose);
     }
     if (!empty($this->options)) {
         $infoWindow->setOptions($this->options);
     }
     return $infoWindow;
 }
 /**
  * {@inheritdoc}
  *
  * @return \Ivory\GoogleMap\Base\Bound The bound.
  */
 public function build()
 {
     $bound = new $this->class();
     if ($this->prefixJavascriptVariable !== null) {
         $bound->setPrefixJavascriptVariable($this->prefixJavascriptVariable);
     }
     if (!empty($this->southWest)) {
         $southWest = $this->coordinateBuilder->reset()->setLatitude($this->southWest[0])->setLongitude($this->southWest[1])->setNoWrap($this->southWest[2])->build();
         $bound->setSouthWest($southWest);
     }
     if (!empty($this->northEast)) {
         $northEast = $this->coordinateBuilder->reset()->setLatitude($this->northEast[0])->setLongitude($this->northEast[1])->setNoWrap($this->northEast[2])->build();
         $bound->setNorthEast($northEast);
     }
     return $bound;
 }
 /**
  * {@inheritdoc}
  *
  * @return \Ivory\GoogleMap\Overlays\Circle The circle.
  */
 public function build()
 {
     $circle = new $this->class();
     if ($this->prefixJavascriptVariable !== null) {
         $circle->setPrefixJavascriptVariable($this->prefixJavascriptVariable);
     }
     if (!empty($this->center)) {
         $center = $this->coordinateBuilder->reset()->setLatitude($this->center[0])->setLongitude($this->center[1])->setNoWrap($this->center[2])->build();
         $circle->setCenter($center);
     }
     if ($this->radius !== null) {
         $circle->setRadius($this->radius);
     }
     if (!empty($this->options)) {
         $circle->setOptions($this->options);
     }
     return $circle;
 }
 /**
  * {@inheritdoc}
  *
  * @return \Ivory\GoogleMap\Overlays\Marker The marker.
  */
 public function build()
 {
     $marker = new $this->class();
     if ($this->prefixJavascriptVariable !== null) {
         $marker->setPrefixJavascriptVariable($this->prefixJavascriptVariable);
     }
     if (!empty($this->position)) {
         $position = $this->coordinateBuilder->reset()->setLatitude($this->position[0])->setLongitude($this->position[1])->setNoWrap($this->position[2])->build();
         $marker->setPosition($position);
     }
     if ($this->animation !== null) {
         $marker->setAnimation($this->animation);
     }
     if (!empty($this->options)) {
         $marker->setOptions($this->options);
     }
     return $marker;
 }