Safari cannot open the page because the address is not valid for Google Maps on iPad

We have a link that relates to Google Maps for routes, using only the usual format for the Google Maps URL: https://www.google.com/maps/dir/Current+Location/38.8992,-77.0482 .

This works fine on google chrome and other browsers, it seems that this problem also does not exist, but somehow on the iPad with OS 8.1.3 using the Safari browser a warning appears with the message "Safari cannot open the page because the address is invalid"

Anyone else having this problem?

The page is still loading, but a warning appears and needs to be fired and distracted from the user's work. Since the link is compliant with the Google Maps API standard and seems to work differently, why is this happening and what can be done to prevent this from happening?

In addition, something strange happened when, after the link works several times, the message no longer appears when the user is redirected to the page. However, after clearing the history and data for the Safari browser on the iPad, the problem arises again.

+5
source share
2 answers

In case someone else came here but didn’t get this error due to a link in Google Maps, look at some JS that you are listening for a link click event.

In my case, I found that the previous developer added

e.preventDefault(); 

in the click event.

+1
source

It may be worth noting that, as the developer of PhoneGap, I have confirmed that the iOS GPS data looks better than, say, on an Android phone or an HP laptop. The number of accuracy digits on the iPad is significantly longer than on other platforms.

Perhaps when iOS pushes so many precision digits that their server sees this as an error. This discussion seems to suggest that Google will throw out unnecessary accuracy, but it is possible that a recent update on Google Maps has swept the excess.

Also note: if a language other than English is installed on your phone, the Google API expects a word in that language for "current", for example, "votre + location" in French.

0
source

Source: https://habr.com/ru/post/1213085/


All Articles