[Map-Module] Cannot get info from Google Maps
|
bjo
Joined: 2007-02-13
Posts: 5 |
Posted: Tue, 2007-02-13 18:04
|
|
Hello, I'm running the Google-Map-Module 0.5.1d with Gallery 2.1.2 as a multisite installation. The module es working fine, except getting coordinates by address: "Cannot get info from Google Maps" The url of the Gallery is http://photos.bjo.nord-west.org TIA |
|

Posts: 5
It seems the problem is caused by allow_furl_open off - but i don't want to change it for the whole gallery.
Posts: 1894
I have been thinking of using the built-in Geocodeer in Google Maps but I won't be doing this as it does not allow to encode UK and China address.
Right now the only good way is to use furl_open, I'll see if I can make it work with curl instead but other than that ... there really isn't a lot of choices here
See you !
- http://www.termitenshort.com/
-------------------------
The Termite -
Posts: 5
Thanks for the idea with curl ;)
I tried a bit with curl, now the module gets the coordinates.
$url = "http://maps.google.com/maps?q=".$correctedaddress."&output=js"; $ch = curl_init($url); $fp = fopen("coords.txt", "w"); curl_setopt($ch, CURLOPT_FILE, $fp); curl_setopt($ch, CURLOPT_HEADER, 0); curl_exec($ch); curl_close($ch); fclose($fp); $file=""; @$filepointer = fopen("coords.txt","r"); if($filepointer){ while(!feof($filepointer)){ $buffer = fgets($filepointer, 4096); $file .= $buffer; } fclose($filepointer);I had to change $coords = $match[2].",".$match[1]; to $coords = $match[1].",".$match[2];, otherwise the coords were interchanged.