0

my problem is i want to show my registered site user on to google map but dont know how to locate the user, means i dont know the latitude and longitude of every user . I am a newbie in google map so plz help

Thanks a ton

4 Answers 4

4

What location data do you have for your users? Cities, states, countries?

You might want to have a look at Google's Geocoding APIs.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks coomer im interested in cities
3

there are two possible ways of doing this.

  1. Ask the user to search a google map and place themselves on it. Look here for an idea on how to do this http://www.designing4u.de/2008/08/google-maps-jquery-and-xml-saving-markers-with-user-input/
  2. Use an IP to Location database to find out the location based on their IP. Look here for how to do this http://www.ip2nation.com/ip2nation

1 Comment

Thanks JOsh for such an awesome answer
1

There is no way to reliably locate a user using their IP address. However if you are developing for a mobile device it may be possible to acquire their GPS coordinates. Or you could require them to enter an address and place a point on the map from that address with geocoding.

1 Comment

Thanks jjclarkson but i am interested in locating the cities in the map
1

If you are collecting the address of each registered user, you can get the latitude and longitude on the server-side through the Google Maps HTTP Geocoding Service.

You would use the following HTTP request:

http://maps.google.com/maps/geo?q=Oxford+Street,+London&output=csv&sensor=false

Simply change the q parameter with your user's address.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.