Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET Google-Maps
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 2:10am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  
Comments
Arunprasath Natarajan at 17-Oct-12 9:16am
   
Thank you for your suggestion. But is it possible to track using respective end user IP.
Rate this: bad
good
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
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);
});
});
}); 
 
Other method is using database, it will require frequent updation,
above one is better
Other Method
  Permalink  
v2

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



Advertise | Privacy | Mobile
Web03 | 2.8.141015.1 | Last Updated 21 Oct 2012
Copyright © CodeProject, 1999-2014
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