Click here to Skip to main content
13,289,439 members (66,233 online)
Rate this:
Please Sign up or sign in to vote.
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.
Posted 17-Oct-12 3:10am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1


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.

Arunprasath Natarajan 17-Oct-12 9:16am
Thank you for your suggestion. But is it possible to track using respective end user IP.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

I have solved it myself.
It will be very useful in place of location default display
You have to Pass your IP at the end of this URL.[^]
var clientip = data.ip;
var url =""+clientip+"?callback=?";
jQuery.getJSON(url, function(data){
$.each(data, function(key, val) {
alert(key+' : '+val);

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

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.171207.1 | Last Updated 21 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100