Given a street, city, lat/long, and zip, how do you create an anchor link to a Google Map?
Following a Gmap result, I tried to mimic the link it gave. So far, I have tried:
$street = str_replace(' ', '+', $location['street']);
$street = str_replace('#', '%23', $street);
$city = str_replace(' ', '+', $location['city']);
$state = str_replace(' ', '+', $location['state']);
$zip = $location['zip'];
$lat = $location['lat'];
$long = $location['long'];
$map = 'http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q='.$street.'+'.$city.'+'.$state.'&sll='.$lat.','.$long.'&ie=UTF8&hq=&hnear='.$street.',+'.$city.',+'.$state.',+'.$zip.'&ll='.$lat.','.$long;
Sometimes it works, other times I get "We could not understand your request". Does anyone know of a way to make this work for any result?
I've always simplified it down to just the query (q) and i've never had an issue
http://www.google.com/maps?q=address(tooltip/infowindow title)
whatever you put in the () will be the tooltip text and the title for the infowindow
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