@@ -39,9 +39,9 @@ public function __construct(Adapter $adapter)
3939
4040 // check streetview mode
4141 // simple check,- starts with @, ends with t
42- if ((substr ($ mode , 0 , 1 ) === '@ ' ) && (substr ($ mode , -1 ) === 't ' )) {
43- $ this ->mode = 'streetview ' ;
44- }
42+ if ((substr ($ mode , 0 , 1 ) === '@ ' ) && (substr ($ mode , -1 ) === 't ' )) {
43+ $ this ->mode = 'streetview ' ;
44+ }
4545 }
4646
4747 /**
@@ -146,23 +146,22 @@ private static function getPosition($mode, Url $url)
146146
147147 if ($ mode === 'view ' ) {
148148 $ pos = explode (", " , $ url ->getDirectoryPosition (1 ));
149- $ position ['coordinates ' ] = str_replace ('@ ' ,'' ,$ pos [0 ]).', ' .$ pos [1 ];
150- $ position ['zoom ' ] = str_replace ('z ' ,"" ,$ pos [2 ]);
149+ $ position ['coordinates ' ] = str_replace ('@ ' , '' , $ pos [0 ]).', ' .$ pos [1 ];
150+ $ position ['zoom ' ] = str_replace ('z ' , "" , $ pos [2 ]);
151151 }
152152
153153 if ($ mode === 'streetview ' ) {
154154 $ pos = explode (", " , $ url ->getDirectoryPosition (1 ));
155- $ position ['coordinates ' ] = str_replace ('@ ' ,'' ,$ pos [0 ]).', ' .$ pos [1 ];
156- $ position ['zoom ' ] = str_replace ('a ' ,'' ,$ pos [2 ]); // seems not used by google (emulated by other params)
157- $ position ['heading ' ] = str_replace ('h ' ,'' ,$ pos [4 ]);
158- $ position ['fov ' ] = str_replace ('y ' ,'' ,$ pos [3 ]);
159- $ pitch = str_replace ('t ' ,'' ,$ pos [5 ]); // t is pitch but in 180% format
155+ $ position ['coordinates ' ] = str_replace ('@ ' , '' , $ pos [0 ]).', ' .$ pos [1 ];
156+ $ position ['zoom ' ] = str_replace ('a ' , '' , $ pos [2 ]); // seems not used by google (emulated by other params)
157+ $ position ['heading ' ] = str_replace ('h ' , '' , $ pos [4 ]);
158+ $ position ['fov ' ] = str_replace ('y ' , '' , $ pos [3 ]);
159+ $ pitch = str_replace ('t ' , '' , $ pos [5 ]); // t is pitch but in 180% format
160160 if (is_numeric ($ pitch )) {
161161 $ position ['pitch ' ] = floatval ($ pitch ) - 90 ;
162162 }
163163 }
164164
165165 return $ position ;
166166 }
167-
168167}
0 commit comments