7

W3C geolocation API doesn't seem to work in safari 5. I tried this page and it sort of tells me that Geolocation is unsuccessful.

The code: http://code.google.com/apis/maps/documentation/javascript/examples/map-geolocation.html

can somebody explain me why this is so?

2
  • the link provided worked for me. I'm using Safari 5.0.4 on Mac OSX 10.6.6 and are in Germany at the moment. This kind of information might help people to figure out what is wrong in your case. Also could take a look at safari's developer tools. Commented Mar 29, 2011 at 12:20
  • 1
    Doesn't work for me either, using Safari 5.0.4 on Windows. The browser asks if I can share my location, I say Allow and the web page can't get my location. Works in other browsers, just not Safari. Commented Mar 29, 2011 at 14:28

3 Answers 3

11

Looks like geolocation in safari only works when you're connected to wifi (not wired): Geolocation in Safari 5

Sign up to request clarification or add additional context in comments.

Comments

0

I'm using Safari 5.0.5 on Mac Snow Leopard and clicking after on your link I was getting

Error: The Geolocation service failed

Try enabling the location services in Safari.

Go to Preferences->Security and check "Allow websites to ask for location information". Also, make sure System Preferences->Security does not have "Disable Location Services" checked.

Now all works as expected and I'm getting

Location found using W3C standard

1 Comment

You are using Mac Snow Leopard. Does it work on Windows 7 though? Please don't take this as a complaint about your answer, as the original question didn't specify Windows versus Mac.
0

If, like me, you're working on a Mac and none of the other answers helped, check that the Safari application is permitted to determine your location:

System Preferences --> Security and Privacy --> Privacy --> Location Services --> Check the Safari checkbox.

Refresh the page, if prompted, allow Safari to obtain your location and now you should be able to see your location on the map.

The above was reproduced on OS X El Capitan.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.