Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Map address should be clickable to bring up map app on mobile #518
This SO post is a good intro of how to link to a map from mobile devices. Potential solutions are:
Linking to maps.apple.com seems like the safest approach since it gets you to a map regardless of what device you're using. The only non-ideal case is when you are visiting from an Apple desktop, where I would prefer to have the map open as Google Maps in a browser tab, but the computer tries to open Apple Maps instead.
Thoughts on which approach to use? I supposed we could also do some browser sniffing if you think it's worth it, but it seems like keeping code to a minimum is a goal for you over the next few months.
Yeah, there are browser sniffing gems like https://github.com/fnando/browser that seem fairly minimal but I think at this stage that would be overkill for what this adds. An approach I'm thinking about is only responding with the map app route if the link is clicked using a touch event. This doesn't guarantee a mobile device, but will exclude a lot of desktop environments. Unfortunately, detecting input types consistently is the new version of the screen size variation and resolution boondoggle of mobile development.
It could look something like this: create a JS module that hooks into links that have a certain CSS class added (maybe
Ties into #602 ... I don't think the zip and address both should be clickable and perform different functions. They could perform the same function (in-app location search vs open map app) depending on whether a click or touch event was used, but I'd lean toward confining the map-app function to the address shown on the map only, at least at this stage. The details map has its own infowindow that opens with the address as well, though that may easily go unnoticed.
Hello! This issue looks like it still needs help!
If you wrote this issue, you can always update the labels for specifying tasks, add more info in the description to make it easier to contribute, or re-write the title to make more contributors interested in helping out.
Just doing a little