I am trying to accomplish a two step task on the server side using Google Map API v3 rather than on the client side but have not found much documentation as to how to accomplish this. So I was wondering if anyone here can help or guide me in the right direction.
The 1st step is getting the geo-code location of an address using PHP. I think I have figured this out and that is by making a curl call to http://maps.google.com/maps/api/geocode/json?sensor=false&address= and processing the JSON response. Once I have the geo-codes, I store them in my database.
The 2nd step is finding random addresses in a specific radius of the address in 1st step. This I cannot seem to find how to do in the server side.
Any help or guidance would be truly appreciated.
Easiest way
$url = 'http://maps.google.com/maps/api/geocode/json?sensor=false&address=' . urlencode($address); $data = json_decode(file_get_contents($url), true); // insert in the database
Searching with the given radius and center point (lat, lng): https://developers.google.com/maps/articles/phpsqlsearch
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With