You are here

function geofield_ymap_field_widget_settings_form in Geofield Yandex Maps 7

Implements hook_field_widget_settings_form().

File

./geofield_ymap.widget.inc, line 30

Code

function geofield_ymap_field_widget_settings_form($field, $instance) {
  $settings = $instance['widget']['settings'];
  $form['map_type'] = array(
    '#type' => 'select',
    '#title' => t('Map type'),
    '#options' => _geofield_ymap_get_map_types(),
    '#default_value' => $settings['map_type'],
  );
  $form['map_center'] = array(
    '#type' => 'textfield',
    '#title' => t('Map center'),
    '#description' => t('Map center coordinates: Longtitude,Latitude. Example: <code>37.62,55.75</code>'),
    '#default_value' => $settings['map_center'],
  );
  $form['map_zoom'] = array(
    '#type' => 'textfield',
    '#title' => t('Map zoom'),
    '#description' => t('From 1 to 16'),
    '#default_value' => $settings['map_zoom'],
    '#size' => 5,
  );
  $form['map_object_types'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Object types'),
    '#description' => t('Select object types that the user can add to the map'),
    '#options' => array(
      'point' => t('Point'),
      'line' => t('Line'),
      'polygon' => t('Polygon'),
    ),
    '#default_value' => $settings['map_object_types'],
  );
  $form['map_selected_control'] = array(
    '#type' => 'select',
    '#title' => t('Default selected control'),
    '#options' => array(
      '' => t('< none >'),
      'point' => t('Point'),
      'line' => t('Line'),
      'polygon' => t('Polygon'),
    ),
    '#default_value' => $settings['map_selected_control'],
  );
  $form['map_object_preset'] = array(
    '#type' => 'textfield',
    '#title' => t('Preset name'),
    '#description' => t('<a href="@url" target="_blank">Preset name</a>. Example: <code>islands#blackDotIcon</code>', array(
      '@url' => 'http://api.yandex.ru/maps/doc/jsapi/2.1/ref/reference/option.presetStorage.xml',
    )),
    '#default_value' => $settings['map_object_preset'],
  );
  $form['map_controls'] = array(
    '#type' => 'textfield',
    '#title' => t('Controls'),
    '#description' => t('<a href="@url" target="_blank">Controls</a> through a comma, or controls set name. Use <code>&lt;none&gt;</code> to hide all controls. Example: <code>fullscreenControl,searchControl</code>. Default set name: <code>default</code>', array(
      '@url' => 'http://api.yandex.ru/maps/doc/jsapi/2.1/ref/reference/control.Manager.xml#add',
    )),
    '#default_value' => $settings['map_controls'],
  );
  return $form;
}