dongtan5558 2012-05-12 08:51
浏览 39

提供用户位置的Web服务

i m using one webservice to get user location.I give ip address to this webservice and webservice return me latittude,longitude,cityname etc. But when this webservice GOING OFF i cannot get location. So any one can tell me how can i overcome this problem. Any google webservice is there on which i can trust.

Sorry for my poor english

Thanks in advance

  • 写回答

1条回答 默认 最新

  • dongxi2014 2012-05-12 09:10
    关注

    If you want that info for JS, try the geolocation feature of HTML5. This is the example for getting user location: http://www.w3schools.com/html5/html5_geolocation.asp. With this method, you can find the longitude and latitude of user location, however, the accuracy is not guaranteed. And more than that, you have to use additional thing like Google Maps API to get more information about this combination of longitude and latitude like country name, city name, etc.

    For server, user location can be recognised by deciding at which range the IP belongs to. The database of IP ranges can be downloaded from here (26.3 MB): http://www.hostip.info/dl/index.html

    Or follow the instructions in the link provided Moyed Ansari at the first comment below the question.

    评论

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?