You are here

private function ip_geoloc_plugin_style_leaflet::_add_map_and_height in IP Geolocation Views & Maps 7

1 call to ip_geoloc_plugin_style_leaflet::_add_map_and_height()
ip_geoloc_plugin_style_leaflet::options_form in views/ip_geoloc_plugin_style_leaflet.inc
Implements options_form().

File

views/ip_geoloc_plugin_style_leaflet.inc, line 222

Class

ip_geoloc_plugin_style_leaflet

Code

private function _add_map_and_height(&$form, &$weight) {
  $maps = array();
  foreach (ip_geoloc_plugin_style_leaflet_map_get_info() as $key => $map) {
    $maps[$key] = $map['label'];
  }
  $form['map'] = array(
    '#title' => t('Map'),
    '#type' => 'select',
    '#options' => $maps,
    '#default_value' => $this->options['map'],
    '#required' => TRUE,
    '#weight' => $weight++,
  );
  $desc1 = t('Examples: <em>250</em> or <em>50em</em> or <em>40vh</em> (percentage of viewport height).');
  $desc2 = t('If left blank, the height defaults to 300 pixels. The width of the map will extend to its bounding container.');
  $desc3 = t('You may enter <em>&lt;none></em>. If you do, then the height attribute must be set through Javascript or CSS elsewhere or the map will not display. CSS example: <em>.ip-geoloc-map .leaflet-container { height: 150px; }</em>');
  $form['map_height'] = array(
    '#title' => t('Map height'),
    '#type' => 'textfield',
    '#size' => 7,
    '#default_value' => $this->options['map_height'],
    '#description' => $desc1 . '<br/>' . $desc2 . '<br/>' . $desc3,
    '#weight' => $weight++,
  );
}