yahayadeveloper / php-google-map-api

Automatically exported from code.google.com/p/php-google-map-api
0 stars 0 forks source link

Bug in geoGetCoords when building API request string #8

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Call geoGetCoords() when the lookup service is YAHOO

What is the expected output? What do you see instead?
It should build the proper request string and connect to the Yahoo API, however 
the string gets formatted (sprintf) while being appended to and misses the 
domain/host of the request.  This causes the network request to fail since 
there is a '%s' where the domain/host should be.

What version of the product are you using? On what operating system?
3.0

Please provide any additional information below.
Warning: 
file_get_contents(http://%s/MapsService/V1/geocode?appid=api.local.yahoo.com&loc
ation=<removed>) [function.file-get-contents]: failed to open stream: 
php_network_getaddresses: getaddrinfo failed: Name or service not known in 
GoogleMap.php on line 2515

To fix it, replace lines 2466-2477 with:

                $_url = sprintf('http://%s/MapsService/V1/geocode?appid=%s&location=%s',$this->lookup_server['YAHOO'],$this->app_id,rawurlencode($address));

Original issue reported on code.google.com by tparkin on 14 Jun 2010 at 5:13

GoogleCodeExporter commented 8 years ago
+1

Original comment by johannes...@socialisten.at on 25 Jul 2011 at 7:20

GoogleCodeExporter commented 8 years ago
Fixed and checked into v3 source as suggested.  To be honest, I haven't done 
much with the Yahoo geocoding stuff, that was really just included in the 
original class as Google geocoding wasn't possible at the time.

Original comment by b...@mycnl.com on 18 Sep 2011 at 5:16