Get position data from mobile browser

北城余情 提交于 2019-12-30 00:06:12

问题


I am developing a web app that will be hit frequently by mobile browsers. I am wondering if there is a way to get enough information from the browser request to lookup position data (triangulation or GPS) Not from the request directly, of course. A colleague suggested there some carriers supply a unique identifier in the request header that can be sent to a web service exposed by said provider that will return position data if the customer has enabled that. Can anyone point me in the right direction for this or any other method for gleaning position data, even very approximate. Obviously this is app candy, e.g. if the data is not available the app doesn't really care...

Or perhaps a web service by carrier that will provide triangulated data by IP?


回答1:


Google has ClientLocation as part of their AJAX APIs. You'll need to load Google's AJAX API (requires an API key) and it'll try to resolve the user's location data for you.




回答2:


I've got blackberry gps to javascript working OK in a GMaps mashup. Pretty simple, actually. http://www.saefern.org/tickets/test4.php -- help yrself to view source.

(I don't currently have a bb. A user emailed me with "... it seems to be polling every 15 seconds or so, so it keeps adding new locations ... ".)

I'm looking for javascript gps info on an iPhone equivalent. And Nokia, and ... .

Any information appreciated.




回答3:


I have used this javascript library sucessfully:

http://code.google.com/p/geo-location-javascript/

The examples work great. The user will always be prompted to share their location--don't know a way to avoid that.




回答4:


Use the source IP address to approximate a network location. No, you won't get latitude and longitude in an HTTP request from an iPhone. Not unless you write a 3rd party app and ask them to run it.

You might be better off just running a poll on your website.




回答5:


I know that some providers in Japan have a tracking service for location of cellphones. I also know that the information is not public. I think you need to have a very good reason before the provider gives that information free as it is in my opinion sensitive personal data. Of course they will give the information to police officers but not to the general public.



来源:https://stackoverflow.com/questions/97865/get-position-data-from-mobile-browser

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!