private static function getPosition($mode, Url $url)
    {
        // Set defaults
        $position = [
            'coordinates' => '',
            'zoom' => '4',
            'heading' => '0',
            'pitch' => '0',
            'fov' => '90'
        ];

        if ($mode === 'view') {
            $pos = explode(",", $url->getDirectoryPosition(1));
            $position['coordinates'] = str_replace('@', '', $pos[0]).','.$pos[1];
            $position['zoom'] = str_replace('z', "", $pos[2]);
        }

        if ($mode === 'streetview') {
            $pos = explode(",", $url->getDirectoryPosition(1));
            $position['coordinates'] = str_replace('@', '', $pos[0]).','.$pos[1];
            $position['zoom'] = str_replace('a', '', $pos[2]); // seems not used by google (emulated by other params)
            $position['heading'] = str_replace('h', '', $pos[4]);
            $position['fov'] = str_replace('y', '', $pos[3]);
            $pitch = str_replace('t', '', $pos[5]); // t is pitch but in 180% format
            if (is_numeric($pitch)) {
                $position['pitch'] = floatval($pitch) - 90;
            }
        }

        return $position;
    }
private static function getPosition($mode, Url $url)
    {
        // Set defaults
        $position = [
            'coordinates' => '',
            'zoom' => '4',
            'heading' => '0',
            'pitch' => '0',
            'fov' => '90'
        ];

        if ($mode === 'view') {
            $pos = explode(",", $url->getDirectoryPosition(1));
            $position['coordinates'] = str_replace('@', '', $pos[0]).','.$pos[1];
            $position['zoom'] = str_replace('z', "", $pos[2]);
        }

        if ($mode === 'streetview') {
            $pos = explode(",", $url->getDirectoryPosition(1));
            $position['coordinates'] = str_replace('@', '', $pos[0]).','.$pos[1];
            $position['zoom'] = str_replace('a', '', $pos[2]); // seems not used by google (emulated by other params)
            $position['heading'] = str_replace('h', '', $pos[4]);
            $position['fov'] = str_replace('y', '', $pos[3]);
            $pitch = str_replace('t', '', $pos[5]); // t is pitch but in 180% format
            if (is_numeric($pitch)) {
                $position['pitch'] = floatval($pitch) - 90;
            }
        }

        return $position;
    }
private static function getPosition ( $ mode , Url $ url ) { // Set defaults $ position = [ 'coordinates' => '' , 'zoom' => '4' , 'heading' => '0' , 'pitch' => '0' , 'fov' => '90' ] ; if ( $ mode === 'view' ) { $ pos = explode ( "," , $ url -> getDirectoryPosition ( 1 ) ) ; $ position [ 'coordinates' ] = str_replace ( '@' , '' , $ pos [ 0 ] ) . ',' . $ pos [ 1 ] ; $ position [ 'zoom' ] = str_replace ( 'z' , "" , $ pos [ 2 ] ) ; } if ( $ mode === 'streetview' ) { $ pos = explode ( "," , $ url -> getDirectoryPosition ( 1 ) ) ; $ position [ 'coordinates' ] = str_replace ( '@' , '' , $ pos [ 0 ] ) . ',' . $ pos [ 1 ] ; $ position [ 'zoom' ] = str_replace ( 'a' , '' , $ pos [ 2 ] ) ; // seems not used by google (emulated by other params) $ position [ 'heading' ] = str_replace ( 'h' , '' , $ pos [ 4 ] ) ; $ position [ 'fov' ] = str_replace ( 'y' , '' , $ pos [ 3 ] ) ; $ pitch = str_replace ( 't' , '' , $ pos [ 5 ] ) ; // t is pitch but in 180% format if ( is_numeric ( $ pitch ) ) { $ position [ 'pitch' ] = floatval ( $ pitch ) - 90 ; } } return $ position ; }
Returns parsed position data from url.

@param  string $mode The url mode
@param  Url    $url

@return array
Returns parsed position data from url .