public function FitLocations::getSettingsForm in Geolocation Field 8.3
Same name and namespace in other branches
- 8.2 src/Plugin/geolocation/MapCenter/FitLocations.php \Drupal\geolocation\Plugin\geolocation\MapCenter\FitLocations::getSettingsForm()
Settings form by ID and context.
Parameters
int $center_option_id: MapCenter option ID.
array $settings: The current option settings.
mixed $context: Current context.
Return value
array A form array to be integrated in whatever.
Overrides MapCenterBase::getSettingsForm
File
- src/
Plugin/ geolocation/ MapCenter/ FitLocations.php, line 35
Class
- FitLocations
- Fixed coordinates map center.
Namespace
Drupal\geolocation\Plugin\geolocation\MapCenterCode
public function getSettingsForm($option_id = NULL, array $settings = [], $context = NULL) {
$form = parent::getSettingsForm($option_id, $settings, $context);
$form['min_zoom'] = [
'#type' => 'number',
'#min' => 0,
'#step' => 1,
'#title' => $this
->t('Set a minimum zoom, especially useful when only location is centered on.'),
'#default_value' => $settings['min_zoom'],
];
$form['reset_zoom'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Reset zoom after fit.'),
'#default_value' => $settings['reset_zoom'],
];
return $form;
}