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

Conversation

frett
Copy link
Contributor

@frett frett commented Mar 25, 2024

Wikipedia lists an unofficial extension using the q parameter to have Google Maps show a pin from a GeoURI. See: https://en.wikipedia.org/wiki/Geo_URI_scheme#Unofficial_extensions

I tested this on Android Google Maps and opening the link directly through the Tesla app.

I also tested the url pattern: geo:0,0?q={x},{y}, but opted to go with the committed pattern to account for external maps that may not recognize the q parameter

@@ -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.

@TurtIeSocks
Copy link
Collaborator

Thanks for the PR but can you change the target to develop? I'll sync them up in the very near future as I don't have much planned for develop currently.

@frett frett changed the base branch from main to develop March 25, 2024 15:44
@frett
Copy link
Contributor Author

frett commented Mar 25, 2024

give me a second to rebase and remove the other changes that are from master :)

frett added 2 commits March 25, 2024 09:50
Wikipedia lists an unofficial extension using the `q` parameter to have Google Maps show a pin from a GeoURI. See: https://en.wikipedia.org/wiki/Geo_URI_scheme#Unofficial_extensions

I tested this on Android Google Maps and opening the link directly through the Tesla app.

I also tested the url pattern: `geo:0,0?q={x},{y}`, but opted to go with the committed pattern to account for external maps that may not recognize the `q` parameter
@frett frett requested a review from TurtIeSocks March 25, 2024 15:58
Copy link
Collaborator

@TurtIeSocks TurtIeSocks left a comment

Choose a reason for hiding this comment

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

Looks great, thank you for the contribution!

@TurtIeSocks TurtIeSocks merged commit 4b4e99d into WatWowMap:develop Mar 25, 2024
2 checks passed
Copy link

🎉 This PR is included in version 1.32.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants