You are here

private function GeofieldMapFieldTrait::setMapDimensionsElement in Geofield Map 8

Same name and namespace in other branches
  1. 8.2 src/GeofieldMapFieldTrait.php \Drupal\geofield_map\GeofieldMapFieldTrait::setMapDimensionsElement()

Set Map Dimension Element.

Parameters

array $settings: The Form Settings.

array $elements: The Form element to alter.

1 call to GeofieldMapFieldTrait::setMapDimensionsElement()
GeofieldMapFieldTrait::generateGmapSettingsForm in src/GeofieldMapFieldTrait.php
Generate the Google Map Settings Form.

File

src/GeofieldMapFieldTrait.php, line 422

Class

GeofieldMapFieldTrait
Class GeofieldMapFieldTrait.

Namespace

Drupal\geofield_map

Code

private function setMapDimensionsElement(array $settings, array &$elements) {
  $elements['map_dimensions'] = [
    '#type' => 'fieldset',
    '#title' => $this
      ->t('Map Dimensions'),
  ];
  $elements['map_dimensions']['width'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Map width'),
    '#default_value' => $settings['map_dimensions']['width'],
    '#size' => 25,
    '#maxlength' => 25,
    '#description' => $this
      ->t('The default width of a Google map, as a CSS length or percentage. Examples: <em>50px</em>, <em>5em</em>, <em>2.5in</em>, <em>95%</em>'),
    '#required' => TRUE,
  ];
  $elements['map_dimensions']['height'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Map height'),
    '#default_value' => $settings['map_dimensions']['height'],
    '#size' => 25,
    '#maxlength' => 25,
    '#description' => $this
      ->t('The default height of a Google map, as a CSS length or percentage. Examples: <em>50px</em>, <em>5em</em>, <em>2.5in</em>, <em>95%</em>'),
    '#required' => TRUE,
  ];
}