最终用户的地理位置 [英] Geo-Map Location of End User

查看:98
本文介绍了最终用户的地理位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友,

我想显示一个地理地图,并应该显示最终用户的位置.
为此,我需要纬度和经度的位置.
如何从编码中获取相同的信息.

请指导我.我不知道从哪里开始以及如何开始.

Dear Friends,

I want to display a Geo-Map and should show the end user''s location.
For that I need the latitude and longitude position.
How to get the same from coding.

Kindly guide me on same. I dont know where to start and how to start.

推荐答案



在您的应用程序中,当最终用户当时注册时,用户是否输入其地址?如果否,那么应该有用于最终用户地址的字段.使用Google API,您可以从地址中找到经度和纬度.
因此,您可以将其保存到数据库的2个不同的列中,例如纬度和经度.
因此,当您要显示最终用户的地理位置时,可以使用保存的纬度和经度来显示他们.

希望对您有所帮助.

谢谢,
Viprat
Hi,

In your application when end user register at that time the user enter his address or not? If no then there should be fields for end user address. Using google api you can find the latitude and longitude from the address.
So you can save that into the database in 2 different column, let`s say lattitude and longitude.
So when you want to show end user geo location then you can show them using saved lattitude and longitude.

I hope it might be help you.

Thanks,
Viprat


我自己解决了.
代替位置默认显示将非常有用.
基于URL的-返回JSON
您必须在此URL的末尾传递IP. [ ^ ]
编码:
I have solved it myself.
It will be very useful in place of location default display
URL BASED – RETURNS JSON
You have to Pass your IP at the end of this URL.[^]
Coding:
jQuery.getJSON("http://jsonip.appspot.com?callback=?",
function(data){
var clientip = data.ip;
var url ="http://freegeoip.net/json/"+clientip+"?callback=?";
jQuery.getJSON(url, function(data){


.each(data, function(key, val) { alert(key+'' : ''+val); }); }); });
.each(data, function(key, val) { alert(key+'' : ''+val); }); }); });



其他方法正在使用数据库,将需要频繁更新,
以上一种更好
其他方法



Other method is using database, it will require frequent updation,
above one is better
Other Method


这篇关于最终用户的地理位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆