Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GeoURI to drop a pin when opened with Google Maps #990

Merged
merged 3 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions server/src/configs/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@
},
{
"name": "GeoURI",
"url": "geo:{x},{y}"
"url": "geo:{x},{y}?q={x},{y}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TurtIeSocks I'm assuming you can use the replacement variables multiple times in a pattern

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not currently but if you change

href={url.replace('{x}', lat.toString()).replace('{y}', lon.toString())}

to use replaceAll instead of replace (or a regex) then it shouldn't be a problem.

}
],
"icons": {
Expand Down Expand Up @@ -1022,4 +1022,4 @@
"tracesSampleRate": 0.1
}
}
}
}
4 changes: 3 additions & 1 deletion src/components/popups/Navigation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ export function Navigation({ lat, lon, size = 'large' }) {
const url = useMemory((s) => s.settings.navigation[nav]?.url)
return (
<IconButton
href={url.replace('{x}', lat.toString()).replace('{y}', lon.toString())}
href={url
.replaceAll('{x}', lat.toString())
.replaceAll('{y}', lon.toString())}
target="_blank"
rel="noreferrer"
size={size}
Expand Down