Index: trunk/extensions/Maps/Geocoders/Maps_Geocoder.php |
— | — | @@ -99,7 +99,15 @@ |
100 | 100 | |
101 | 101 | // Call the geocode function in the spesific geocoder class. |
102 | 102 | $coordinates = call_user_func( array( $egMapsGeoServices[$service], 'geocode' ), $address ); |
103 | | - |
| 103 | + |
| 104 | + // If there address could not be geocoded, and contains comma's, try again without the comma's. |
| 105 | + // This is cause several geocoding services such as geonames do not handle comma's well. |
| 106 | + if ( !$coordinates && strpos( $address, ',' ) !== false ) { |
| 107 | + $coordinates = call_user_func( |
| 108 | + array( $egMapsGeoServices[$service], 'geocode' ), str_replace( ',', '', $address ) |
| 109 | + ); |
| 110 | + } |
| 111 | + |
104 | 112 | // Add the obtained coordinates to the cache when there is a result and the cache is enabled. |
105 | 113 | if ( $egMapsEnableGeoCache && $coordinates ) { |
106 | 114 | MapsGeocoder::$mGeocoderCache[$address] = $coordinates; |