예제 #1
0
 public function testConstructorShouldAcceptLatLngsAsFirstAndSecondArgument()
 {
     $bounds = new Bounds(new LatLng(2.5678, 1.1234), new LatLng(4.5678, 3.1234));
     $this->assertTrue($bounds->getSouthWest() instanceof LatLng);
     $this->assertEquals(1.1234, $bounds->getSouthWest()->getLongitude());
     $this->assertEquals(2.5678, $bounds->getSouthWest()->getLatitude());
     $this->assertTrue($bounds->getNorthEast() instanceof LatLng);
     $this->assertEquals(3.1234, $bounds->getNorthEast()->getLongitude());
     $this->assertEquals(4.5678, $bounds->getNorthEast()->getLatitude());
 }
예제 #2
0
파일: Bounds.php 프로젝트: folkevil/geokit
 /**
  * @param  Bounds $bounds
  * @return Bounds
  */
 public function union(Bounds $bounds)
 {
     $newBounds = $this->extend($bounds->getSouthWest());
     return $newBounds->extend($bounds->getNorthEast());
 }