views:

272

answers:

6

Is there any way to get the location of a cell phone (i.e. latitude/longitude) automatically when the user views a web page? This will primarily be used outside of the United States, so if there is some international standard that the US may or may not follow, that's what I'd need to know.

+3  A: 

You can use their IP address to get a general idea. It's not very specific, but it works.

This place has a web service that will let you get their location with PHP or another server side scriping language.

http://www.geobytes.com/IpLocator.htm?Getlocation

sakabako
A: 

There is no standard. The GSM and CDMA phone systems can easily be traced as per their design but you as a non government / network operator cannot trace a cellphone without a user's permission.

Do the words invasion of privacy come to mind?

I know that google has a service that can publish your GPS location if you wish, but this is opt in and you are able to switch it off.

Spence
Link to said google service? I'm not trying to invade people's privacy (even though I realize this is possible), and what I'm trying to do is opt-in anyway.
Shadow
How does google maps do it on a non gps enabled smartphone?
Cipher
http://code.google.com/p/gears/wiki/GeolocationAPI
colithium
And here is a sample app that uses it: http://code.google.com/apis/gears/samples/hello_world_geolocation.html
colithium
Google uses a combination of IP geo location and operating system language tokens. Its a best guess, but note that it doesn't zoom in on your location unless you're using a public WIFI spot which they have mapped.
Spence
A: 

As a iPhone user, I know that there is some applications that actually ask the user permission before geolocating there position. So there might be something in the iPhone SDK.

That way, it is reasonable to think that there is some way to do it.

Frank
A: 

Firefox 3.5 now supports geolocation, but it's not a very popular mobile browser.

http://en-gb.www.mozilla.com/en-GB/firefox/geolocation/

Ben Rowe
A: 

I'll probably try using Latitude with it's JSON feed.

Shadow
A: 

See Yahoo's Fire Eagle service. Your user would require a Fire Eagle account.

lance