Looking for solution to define an address as a default map app link

@Webdeersign - your address: link works on my iPhone by long pressing it.

1 Like

My link guessed example was:
<a href="address:10 Downing Street, London, SW1A 2AA">10 Downing Street, London, SW1A 2AA</a>
10 Downing Street, London, SW1A 2AA

I can’t get this to work on mobile with a long press and also in Safari I get the error Safari cannot open the page because the address is invalid.

What exactlink did you use and how exactly did you use i?

I can’t get it to work again now.

I just pressed your link (which of course shouldn’t work as its in a comment) and the map appeared in a floating window (as happens when you select and drag things like images). It definitely showed downing street though as per the link.

It seems close to a solution. Of course it may be a long way from a solution but looks promising.

Finally got it to do it again but it took ages and I don’t really know what made it work. 9 time out of 10, iOS just selects the text and doesn’t open a link.

1 Like

This seems to work!

On macOS 12.6 and Safari 16.0 this is what happens on a force click (a normal click does nothing):

On iOS 16.0 this is what happens on a long press:

Sometimes it goes straight to “get directions”, sometimes the selection pop up… ehh… pops up and you need to scroll to the right to get to “Get Directions”. And sometimes it does nothing. And sometimes it opens Apple Maps.

I think iOS is simply buggy on this point.

Btw, I have my iOS set to Australian English (Siri too). Maybe that makes a difference?

Cheers,
Erwin

That’s good information. Thanks.

There appears to be multiple and sometimes inconsistent behaviours here across devices. Just what we don’t need.

On my iPad (iPadOS 15.7] it’s treated as any other text, no directions, no get directions and no popup scroll combo to get directions.

Tav, your solution above using JS. How would I tie this to a ButtonPlus button, to act as the launcher, so to speak?

Its not my solution - just a link and I may well suggest a different way of detecting the operating system. Just add their JS code to you page or site wide JS.

To make it work with button plus you would just use the data attribute settings:

Data Name: onclick
Data Value:mapsSelector()

Note that the code in that link only sends iOS devices to Apple Maps and wouldn’t send MacOS browsers to it. Thats obviously easy to add to the list if you want to use this method or indeed to use feature detection rather than the JS navigator.platform() method as per that code.

2 Likes

Thanks for that.