I have a web application that returns GPS coordinates, sometimes those coordinates get misinterpreted as phone numbers and are then formatted as links by iOS/macOS Safari/mail application. I know that <meta name="format-detection" content="telephone=no">
in the head will disable all phone number from linking, but I just want to do my GPS coordinates. Advice?
-
how are your gps number being displayed? – CecilMerrell aka bringrainfire Oct 17 '18 at 01:18
-
33.8307, -118.3832 (the latter part, -118.3832, shows up as a link.) – Oct 17 '18 at 01:36
-
there are some answers here https://stackoverflow.com/questions/226131/how-to-disable-phone-number-linking-in-mobile-safari – Carol McKay Oct 17 '18 at 02:06
1 Answers
Given that the gps data formated in decimal degrees, and sent as an email as html.
phone number formatting is done by the email client when it detects a phone number and will attempt to have it link to a dialer, or messenger program.
Phone numbers that will get formated
212-389-3934
212.389.3934
(800) 389-3934
1-800-389-3934
(212) 389-3934
212–389–3934
212—389—3934
212–389–3934
212–389–3934
1–212–389–3934
212 -389 -3934
There are two ways to fix the problem with decimal degrees being formatted as phone numbers.
- Have the client fix their email client so it doesn't do this anymore.
or
- Trick the email client into thinking that it is already a link by displaying the numbers as so.
<a href=”#” style=”color:#0F3; text-decoration:none”>29.42808 °N -98.48913 °E</a>
Old answer below
! To display gps latitude and longitude, 1st make sure that your html is formatted to be html5 compatible.
next, if that doesn't fix the issue, try the following example,
https://www.w3schools.com/html/tryit.asp?filename=tryhtml5_geolocation_watchposition
<!DOCTYPE html>
<html>
<body>
<p>Click the button to get your coordinates.</p>
<button onclick="getLocation()">Try It</button>
<p id="demo"></p>
<script>
var x = document.getElementById("demo");
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.watchPosition(showPosition);
} else {
x.innerHTML = "Geolocation is not supported by this browser.";}
}
function showPosition(position) {
x.innerHTML="Latitude: " + position.coords.latitude +
"<br>Longitude: " + position.coords.longitude;
}
</script>
</body>
</html>
The latitude and longitude are separated and labeled.

- 704
- 6
- 19
-
-
so is this data being returned through an email or is it on a web page. – CecilMerrell aka bringrainfire Oct 17 '18 at 03:57
-
-
ok, I'm working on a fix and will update my answer to reflect it. – CecilMerrell aka bringrainfire Oct 17 '18 at 21:25