开发者

get latitude longitude with out gps using HTML/java script

Is it possible to get (approx) latitude and longitude using HTML and java script? I have seen some sites that give the gps coordinates based on ip address/wifi triangulation.

Can we do the same with a simple html page? If y开发者_C百科es, please provide some link that can help me get started.


Try an IP based geolocation API. Here's one:

http://www.iplocationtools.com/api.html#b

The rub on that one is that you have to display their banner on your page. There are others out there, but usually you have to pay for the privilege of using them.

EDIT:

Here's another one:

http://www.maxmind.com/app/geolitecity

This one has a free version and a paid version; both assume that you can host the data on your own site, in a relational database. Updated monthly (free version) or weekly (paid version).

Also note that IP based geolocation is usually accurate only down to the city level. It will NEVER be as accurate as the results you get from an actual GPS sensor.


The w3c method is another option: http://dev.w3.org/geo/api/spec-source.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜