Exemplo n.º 1
0
 /**
  * @covers MultiMaps\Bounds::__get
  */
 public function test__get()
 {
     $point = new Point(123, 456);
     $this->object->extend(array($point));
     $this->assertEquals($this->object->ne, $this->object->sw);
     $this->assertEquals($this->object->ne, $this->object->center);
     $this->assertEquals($this->object->ne, $point);
     $this->assertNull($this->object->tralala);
 }
Exemplo n.º 2
0
 /**
  * Add circle to map
  * @param string $value
  * @return boolean
  */
 public function addElementCircle($value)
 {
     $return = true;
     $stringscircle = explode($GLOBALS['egMultiMaps_SeparatorItems'], $value);
     foreach ($stringscircle as $circlevalue) {
         if (trim($circlevalue) == '') {
             continue;
         }
         $circle = new Circle();
         if (!$circle->parse($circlevalue, $this->classname)) {
             $return = false;
             $this->errormessages = array_merge($this->errormessages, $circle->getErrorMessages());
         }
         if (!$circle->isValid()) {
             continue;
         }
         $this->circles[] = $circle;
         $circlescount = count($circle->pos);
         for ($index = 0; $index < $circlescount; $index++) {
             $ne = new Point($circle->pos[$index]->lat, $circle->pos[$index]->lon);
             $sw = new Point($circle->pos[$index]->lat, $circle->pos[$index]->lon);
             $ne->move($circle->radiuses[$index], $circle->radiuses[$index]);
             $sw->move(-$circle->radiuses[$index], -$circle->radiuses[$index]);
             $this->elementsBounds->extend(array($ne, $sw));
         }
     }
     return $return;
 }