public function LocationInputBase::getForm in Geolocation Field 8.3
Same name and namespace in other branches
- 8.2 src/LocationInputBase.php \Drupal\geolocation\LocationInputBase::getForm()
Get center form.
Parameters
int $center_option_id: LocationInput option ID.
array $center_option_settings: The current feature settings.
mixed $context: Context like field formatter, field widget or view.
array $default_value: Optional form values.
Return value
array Form.
Overrides LocationInputInterface::getForm
2 calls to LocationInputBase::getForm()
- ClientLocation::getForm in src/
Plugin/ geolocation/ LocationInput/ ClientLocation.php - Get center form.
- Geocoder::getForm in src/
Plugin/ geolocation/ LocationInput/ Geocoder.php - Get center form.
3 methods override LocationInputBase::getForm()
- ClientLocation::getForm in src/
Plugin/ geolocation/ LocationInput/ ClientLocation.php - Get center form.
- Geocoder::getForm in src/
Plugin/ geolocation/ LocationInput/ Geocoder.php - Get center form.
- Location::getForm in src/
Plugin/ geolocation/ LocationInput/ Location.php - Get center form.
File
- src/
LocationInputBase.php, line 90
Class
- LocationInputBase
- Class LocationInputBase.
Namespace
Drupal\geolocationCode
public function getForm($center_option_id, array $center_option_settings, $context = NULL, array $default_value = NULL) {
$form['coordinates'] = [
'#type' => 'geolocation_input',
'#title' => $this
->t('Coordinates'),
];
if (!empty($default_value)) {
$form['coordinates']['#default_value'] = $default_value;
}
return $form;
}