Is there a link format for physical street address?
Asked Answered
H

2

8

Mobile devices have started to do link detection fairly well. They now detect links, email address, phone numbers and physical street addresses.

The problem is that link detection is not 100% correct. So to be more explicit, for most of these, we can use a link.

<a href="tel:+1-408-555-5555">1-408-555-5555</a>

Is there an equivalent link format for a physical street address?

Hardigg answered 27/6, 2012 at 1:26 Comment(6)
What transport protocol would you use for an address? walk:? drive:? :)Orazio
physical address? as in the geography address?Cunnilingus
@Orazio well these might not even be in the same country. i just want the device to bring up the map to the addressHardigg
@Cunnilingus physical street address. so yes "geography address". update questionHardigg
@Hardigg not sure about geography address (probably different country has different address format), but geo may come close to achieve what you want.Cunnilingus
let's make it <a snail:"123 Street, city, country, zip" />Nationalize
D
5

There doesn't seem to be one defined, according to the IANA. Here is a discussion about creating one, but it doesn't seem it ever went anywhere. The closest I can find is geo, which is just latitude and longitude, not a postal address. I see from the update that you want to display a map, so what you want is to geocode the address to get a geo URI. You could use Google's API but I don't know if there is any need for the geo URI at that point.

Divan answered 27/6, 2012 at 1:43 Comment(0)
E
0

You can use the maps: syntax in a link. https://developer.apple.com/library/archive/featuredarticles/iPhoneURLScheme_Reference/MapLinks/MapLinks.html

  const full_address = '123 Main street Fort Lauderdale, FL 33321';

  <a
    href={`maps:?q=${full_address}`}
    target="_blank"
  >
    <address>{full_address}</address>
  </a>

I tested this with Chrome on MacOS and Edge/Chrome on iOS and it works.

Exaltation answered 13/4, 2024 at 15:48 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.