Skip to content

Commit

Permalink
Fix #256, part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
ttempleton committed Aug 2, 2024
1 parent 62d47c9 commit 6ae43ab
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/adapters/googlemaps/detectors/Code.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,13 @@ private function _getPosition(string $mode, string $path): array
];

if ($mode === 'view') {
$pos = explode(',', getDirectory($path, 1));
$position['coordinates'] = str_replace('@', '', $pos[0]).','.$pos[1];
$position['zoom'] = str_replace('z', '', $pos[2]);
foreach (explode('/', $path) as $pathComponent) {
if (str_starts_with($pathComponent, '@')) {
$pos = explode(',', $pathComponent);
$position['coordinates'] = str_replace('@', '', $pos[0]).','.$pos[1];
$position['zoom'] = str_replace('z', '', $pos[2]);
}
}
}

if ($mode === 'streetview') {
Expand Down

0 comments on commit 6ae43ab

Please sign in to comment.