PMA\libraries\gis\GISPolygon::_drawPath PHP Method

_drawPath() private method

Draws a ring of the polygon using SVG path element.
private _drawPath ( string $polygon, array $scale_data ) : string
$polygon string The ring
$scale_data array Array containing data related to scaling
return string the code to draw the ring
    private function _drawPath($polygon, $scale_data)
    {
        $points_arr = $this->extractPoints($polygon, $scale_data);
        $row = ' M ' . $points_arr[0][0] . ', ' . $points_arr[0][1];
        $other_points = array_slice($points_arr, 1, count($points_arr) - 2);
        foreach ($other_points as $point) {
            $row .= ' L ' . $point[0] . ', ' . $point[1];
        }
        $row .= ' Z ';
        return $row;
    }