protected function TestProvider::doGeocode in Geocoder 8.2
Performs the geocoding.
Parameters
string $source: The data to be geocoded.
Return value
\Geocoder\Model\AddressCollection|\Geometry|null The Address, NULL otherwise.
Overrides ProviderBase::doGeocode
File
- modules/
geocoder_geofield/ tests/ modules/ geocoder_geofield_test/ src/ Plugin/ Geocoder/ Provider/ TestProvider.php, line 28
Class
- TestProvider
- Provides a geocoding provider for testing purposes.
Namespace
Drupal\geocoder_geofield_test\Plugin\Geocoder\ProviderCode
protected function doGeocode($source) {
switch ($source) {
case 'Gotham City':
return $this
->getAddressFactory()
->createFromArray([
[
'latitude' => 20,
'longitude' => 40,
],
]);
default:
return FALSE;
}
}