Reputation: 1240
I'm using http://gmap.nurtext.de/documentation.html library to display the map for my address field (mysql table)
How I can get the latitude
and longitude
for each address, for example:
I have this address: 'McLester road'
Note:
my visitor (user) who added the address (into Mysql table)
Upvotes: 3
Views: 13695
Reputation: 1329
Google's geocoding sevice can convert address to coordinates.
There is a javascript api, but geocoding is available as a webservice too.
Upvotes: 1
Reputation: 10771
Enter the desired address into Google Maps.
Now, enter this into the address bar:
javascript:void(prompt('',gApplication.getMap().getCenter()))
This will return the longitude and latitude for you. Simply copy and paste these numbers into your code.
EDIT
Since this question is still getting some attention I'd like to say that nowadays most browsers will search for the text you put into the address bar, so instead it may be better to open up your browser's console and just enter a portion of the above code:
prompt('',gApplication.getMap().getCenter())
Also, if you just want the just the javascript object returned, just call:
gApplication.getMap().getCenter()
That way, you can do things programatically as well.
Upvotes: 6