Ejemplo n.º 1
0
 /**
  * Test tileToLat
  *
  * @return void
  */
 public function test_tileToLat()
 {
     $this->assertEquals(85.05112, Util_Tile::tileToLat(0, 0), '', 0.0002);
     $this->assertEquals(0, Util_Tile::tileToLat(1, 1), '', 0.0002);
     $this->assertEquals(0, Util_Tile::tileToLat(2, 2), '', 0.0002);
     $this->assertEquals(83.026183, Util_Tile::tileToLat(14, 8), '', 0.0002);
 }
Ejemplo n.º 2
0
 public function before()
 {
     parent::before();
     // If zoom/x/y are passwed get bounding box
     $zoom = $this->request->param('zoom', FALSE);
     $x = $this->request->param('x', FALSE);
     $y = $this->request->param('y', FALSE);
     if ($zoom !== FALSE and $x !== FALSE and $y !== FALSE) {
         $this->_boundingbox = Util_Tile::tileToBoundingBox($zoom, $x, $y);
         $this->request->query('bbox', implode(',', $this->_boundingbox->as_array()));
     }
 }