You are here

function getlocations_map_display_basics_form in Get Locations 7

Same name and namespace in other branches
  1. 7.2 getlocations.module \getlocations_map_display_basics_form()

Function

Return value

Returns form

10 calls to getlocations_map_display_basics_form()
getlocations_leaflet_field_formatter_settings_form in modules/getlocations_leaflet/getlocations_leaflet.module
Implements hook_field_formatter_settings_form(). Returns form elements for a formatter's settings.
getlocations_leaflet_plugin_style::options_form in modules/getlocations_leaflet/views/getlocations_leaflet_plugin_style.inc
Options form
getlocations_leaflet_settings_form in modules/getlocations_leaflet/getlocations_leaflet.module
Function
getlocations_mapquest_field_formatter_settings_form in modules/getlocations_mapquest/getlocations_mapquest.module
Implements hook_field_formatter_settings_form(). Returns form elements for a formatter's settings.
getlocations_mapquest_plugin_style::options_form in modules/getlocations_mapquest/views/getlocations_mapquest_plugin_style.inc
Options form

... See full list

File

./getlocations.module, line 4054
getlocations.module @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

Code

function getlocations_map_display_basics_form($defaults, $labels = array()) {
  $label = array(
    'width' => t('Default width'),
    'height' => t('Default height'),
    'styles' => t('Default styles'),
    'latlong' => t('Map center'),
    'zoom' => t('Zoom'),
    'minzoom_map' => t('Minimum Zoom'),
    'maxzoom_map' => t('Maximum Zoom'),
  );
  if (isset($labels['width'])) {
    $label['width'] = $labels['width'];
  }
  if (isset($labels['height'])) {
    $label['height'] = $labels['height'];
  }
  if (isset($labels['styles'])) {
    $label['styles'] = $labels['styles'];
  }
  if (isset($labels['latlong'])) {
    $label['latlong'] = $labels['latlong'];
  }
  if (isset($labels['zoom'])) {
    $label['zoom'] = $labels['zoom'];
  }
  if (isset($labels['minzoom_map'])) {
    $label['minzoom_map'] = $labels['minzoom_map'];
  }
  if (isset($labels['maxzoom_map'])) {
    $label['maxzoom_map'] = $labels['maxzoom_map'];
  }
  $form = array();
  $form['width'] = getlocations_element_map_tf($label['width'], $defaults['width'], t('The default width of a map, as a CSS length or percentage. Examples: <em>50px</em>, <em>5em</em>, <em>2.5in</em>, <em>95%</em>'), 10, 10, TRUE);
  $form['height'] = getlocations_element_map_tf($label['height'], $defaults['height'], t('The default height of a map, as a CSS length or percentage. Examples: <em>50px</em>, <em>5em</em>, <em>2.5in</em>, <em>95%</em>'), 10, 10, TRUE);

  // map_resize
  $form['map_resize'] = getlocations_element_map_checkbox(t('Automatic map resize'), $defaults['map_resize'], t('Set the map dimensions to 100% if the browser is on a mobile device.'));

  // fullscreen_disable
  $form['fullscreen_disable'] = getlocations_element_map_checkbox(t('Disable Fullscreen'), $defaults['fullscreen_disable'], t('Disable the Fullscreen button if the browser is on a mobile device.'));
  $form['styles'] = array(
    '#type' => 'textarea',
    '#title' => $label['styles'],
    '#default_value' => $defaults['styles'],
    '#description' => t('The default styles of a Google map. Use !link for generating your styles', array(
      '!link' => l(t('this wizard'), 'http://gmaps-samples-v3.googlecode.com/svn/trunk/styledmaps/wizard/index.html', array(
        'external' => TRUE,
      )),
    )),
  );
  $form['latlong'] = getlocations_element_map_tf($label['latlong'], $defaults['latlong'], t('The default center coordinates of a map, expressed as a decimal latitude and longitude, separated by a comma. This must not be 0,0'), 40, 50, TRUE);
  $form['zoom'] = getlocations_element_map_zoom($label['zoom'], $defaults['zoom'], t('The default zoom level of a map.'));
  $form['minzoom_map'] = getlocations_element_map_zoom_map($label['minzoom_map'], $defaults['minzoom_map'], t('The default Minimum zoom level of a map.'));
  $form['maxzoom_map'] = getlocations_element_map_zoom_map($label['maxzoom_map'], $defaults['maxzoom_map'], t('The default Maximum zoom level of a map.'));
  return $form;
}