Posted by naden on September 10, 2010 at 1:10pm
7 followers
| Project: | Location |
| Version: | 6.x-3.1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
| Issue tags: | geocode |
Issue Summary
If the user only selected a country geoding was not working for me. Therefore I set "$q" to countrycode if empty.
I added a small fix to geocoding/google.inc in "google_geocode_location".
$q = _google_geocode_flatten($location);
if(empty($q)) {
$q = $location['country'];
}
$query = array(
'key' => $key,
'sensor' => 'false', // Required by TOS.
'output' => 'xml',
//'ll' => 0,
//'spn' => 0,
'gl' => $location['country'],
'q' => $q, // $q goes here
); Patch attached.
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| 0-geocoding_google-6.x.3.1.patch | 203 bytes | Ignored: Check issue status. | None | None |
Comments
#1
Lets get this committed
#2
Instead of checking the address after the call to _google_geocode_flatten() we should probably fix _google_geocode_flatten() itself.
This patch changes _google_geocode_flatten() to make it add the country to the address.
I also snuck in a little bit of code cleanup.
Can you test my patch for your use case?
The patch is against current cvs dev. Should apply to current dev download too.
Or you can manually apply to the 3.1 release if it doesn't apply cleanly.
#3
The patch in #2 works for me.
My use case is the user enters just a country and no other details and the coords are geocoded from that.
#4
Patch #2 work for me too.
#5
Patch #2 works for me too.
#6
Thanks for reviewing.
Committed to all versions.
http://drupalcode.org/project/location.git/commit/8c8ce88
http://drupalcode.org/project/location.git/commit/293dcd8
http://drupalcode.org/project/location.git/commit/2e563cf
http://drupalcode.org/project/location.git/commit/9f75ca6
#7
Automatically closed -- issue fixed for 2 weeks with no activity.