Skip to content
Snippets Groups Projects
Commit b993841e authored by Italo Mairo's avatar Italo Mairo
Browse files

Revert "Issue #3406303 by progga, itamair: Pass additional parameters to geocoders"

This reverts commit 90265a17.
parent 90265a17
No related branches found
No related tags found
No related merge requests found
......@@ -10,7 +10,6 @@ use Geocoder\Model\AddressCollection;
use Geocoder\Query\GeocodeQuery;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\geocoder\Entity\GeocoderProvider;
use Geocoder\Provider\Provider as ProviderInterface;
/**
* Provides a geocoder factory class.
......@@ -85,15 +84,8 @@ class Geocoder implements GeocoderInterface {
if (is_string($address)) {
$result = $provider->getPlugin()->geocode($address);
}
elseif ($provider->getPlugin() instanceof ProviderInterface) {
/** @var \Geocoder\Provider\Provider $provider_plugin */
$provider_plugin = $provider->getPlugin();
try {
$result = $provider_plugin->geocodeQuery($address);
}
catch (\Exception $e) {
$this->getLogger('geocoder')->warning($e->getMessage());
}
elseif ($provider->getPlugin() instanceof ProviderGeocoderPhpInterface) {
$result = $provider->getPlugin()->geocodeQuery($address);
}
if (!isset($result) || $result->isEmpty()) {
......
......@@ -13,7 +13,7 @@ interface GeocoderInterface {
/**
* Geocodes a string.
*
* @param \Geocoder\Query\GeocodeQuery|string $address
* @param GeocodeQuery|string $address_string
* The GeocodeQuery or string to geocode.
* @param \Drupal\geocoder\GeocoderProviderInterface[] $providers
* A list of Geocoder providers to use to perform the geocoding.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment