Brazil.php in Geolocation Field 8.2
File
modules/geolocation_leaflet/src/Plugin/geolocation/GeocoderCountryFormatting/Brazil.php
View source
<?php
namespace Drupal\geolocation_leaflet\Plugin\geolocation\GeocoderCountryFormatting;
use Drupal\geolocation_leaflet\NominatimRoadFirstFormattingBase;
class Brazil extends NominatimRoadFirstFormattingBase {
public function format(array $atomics) {
$address_elements = parent::format($atomics);
if ($atomics['state']) {
$address_elements['administrativeArea'] = $atomics['state'];
}
if ($atomics['suburb']) {
$address_elements['dependentLocality'] = $atomics['suburb'];
unset($address_elements['addressLine2']);
}
return $address_elements;
}
}
Classes
Name |
Description |
Brazil |
Provides address formatting. |