Polygon::addPoint PHP Method

addPoint() public method

public addPoint ( Point $point )
$point Point
    public function addPoint(Point $point)
    {
        $this->points[] = $point;
    }

Usage Example

 static function fromResponse($arr)
 {
     if (!$arr) {
         return null;
     }
     $polygon = new Polygon();
     foreach ($arr as $point) {
         $polygon->addPoint($point["x"], $point["y"]);
     }
     return $polygon;
 }
All Usage Examples Of Polygon::addPoint