public function Here::getSettingsForm in Geolocation Field 8.2
Same name and namespace in other branches
- 8.3 modules/geolocation_here/src/Plugin/geolocation/MapProvider/Here.php \Drupal\geolocation_here\Plugin\geolocation\MapProvider\Here::getSettingsForm()
Provide a generic map settings form array.
Parameters
array $settings: The current map settings.
array $parents: Form parents.
Return value
array A form array to be integrated in whatever.
Overrides MapProviderBase::getSettingsForm
File
- modules/
geolocation_here/ src/ Plugin/ geolocation/ MapProvider/ Here.php, line 62
Class
- Here
- Provides HERE Maps API.
Namespace
Drupal\geolocation_here\Plugin\geolocation\MapProviderCode
public function getSettingsForm(array $settings, array $parents = []) {
$settings += self::getDefaultSettings();
if ($parents) {
$parents_string = implode('][', $parents);
}
else {
$parents_string = NULL;
}
$form = parent::getSettingsForm($settings, $parents);
$form['height'] = [
'#group' => $parents_string,
'#type' => 'textfield',
'#title' => $this
->t('Height'),
'#description' => $this
->t('Enter the dimensions and the measurement units. E.g. 200px or 100%.'),
'#size' => 4,
'#default_value' => $settings['height'],
];
$form['width'] = [
'#group' => $parents_string,
'#type' => 'textfield',
'#title' => $this
->t('Width'),
'#description' => $this
->t('Enter the dimensions and the measurement units. E.g. 200px or 100%.'),
'#size' => 4,
'#default_value' => $settings['width'],
];
$form['zoom'] = [
'#group' => $parents_string,
'#type' => 'select',
'#title' => $this
->t('Zoom level'),
'#options' => range(0, 20),
'#description' => $this
->t('The initial resolution at which to display the map, where zoom 0 corresponds to a map of the Earth fully zoomed out, and higher zoom levels zoom in at a higher resolution.'),
'#default_value' => $settings['zoom'],
'#process' => [
[
'\\Drupal\\Core\\Render\\Element\\RenderElement',
'processGroup',
],
[
'\\Drupal\\Core\\Render\\Element\\Select',
'processSelect',
],
],
'#pre_render' => [
[
'\\Drupal\\Core\\Render\\Element\\RenderElement',
'preRenderGroup',
],
],
];
return $form;
}