Location\Bounds::getCenterLng PHP Method

getCenterLng() protected method

protected getCenterLng ( ) : float
return float
    protected function getCenterLng()
    {
        $centerLng = ($this->getEast() + $this->getWest()) / 2;
        $overlap = $this->getWest() > 0 && $this->getEast() < 0;
        if ($overlap && $centerLng > 0) {
            return -180 + $centerLng;
        }
        if ($overlap && $centerLng < 0) {
            return 180 + $centerLng;
        }
        if ($overlap && $centerLng == 0) {
            return 180;
        }
        return $centerLng;
    }