Skip to content

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

Merged
TurtIeSocks merged 3 commits into
WatWowMap:developfrom
frett:patch-1
Mar 25, 2024
Merged

Update GeoURI to drop a pin when opened with Google Maps#990
TurtIeSocks merged 3 commits into
WatWowMap:developfrom
frett:patch-1

Conversation

@frett

@frett frett commented Mar 25, 2024

Copy link
Copy Markdown
Contributor

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

{
"name": "GeoURI",
"url": "geo:{x},{y}"
"url": "geo:{x},{y}?q={x},{y}"

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

frett commented Mar 25, 2024

Copy link
Copy Markdown
Contributor Author

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

@TurtIeSocks TurtIeSocks left a comment

Copy link
Copy Markdown
Collaborator

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
@github-actions

Copy link
Copy Markdown

🎉 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