array()); $options['width'] = array('default' => 'auto'); $options['height'] = array('default' => '400px'); $options['initial_point']['contains'] = array( 'auto' => array('default' => TRUE), 'latitude' => array('default' => ''), 'longitude' => array('default' => ''), 'zoom' => array('default' => 10), 'zoom_single' => array('default' => 5), ); $options['controls'] = array('default' => array()); $options['behaviours'] = array('default' => array()); $options['overlays'] = array('default' => array('markers' => 'markers')); $options['zoom_control'] = array('default' => array()); $options['default_maptype'] = array('default' => array()); $options['fields']['contains'] = array( 'latitude' => array('default' => ''), 'longitude' => array('default' => ''), 'class' => array('default' => ''), ); return $options; } /** * Return a form containing the mapping options for the view. * * @param string $form * @param string $form_state */ function options_form(&$form, &$form_state) { parent::options_form($form, $form_state); $form['api'] = array( '#type' => 'select', '#title' => t('Mapping API'), '#description' => t('Select the Mapstraction API to use for this view. Make sure you have specfied an !api where needed.', array('!api' => l('API key', 'admin/settings/mapstraction'))), '#options' => mapstraction_apis(), '#default_value' => $this->options['api'], ); foreach (mapstraction_apis(TRUE) as $key => $api) { module_load_include('inc', 'mapstraction', 'mapstraction.apis'); if (isset($api['settings form']) && function_exists($api['settings form'])) { $form['api_settings'][$key] = $api['settings form']($this->options['api_settings'][$key], $key); } } $form['width'] = array( '#type' => 'textfield', '#title' => t('Width'), '#size' => 10, '#maxlength' => 255, '#default_value' => $this->options['width'], ); $form['height'] = array( '#type' => 'textfield', '#title' => t('Height'), '#size' => 10, '#maxlength' => 255, '#default_value' => $this->options['height'], ); $form['initial_point'] = array( '#type' => 'fieldset', '#tree' => TRUE, '#title' => t('Initial point'), ); $form['initial_point']['auto'] = array( '#type' => 'checkbox', '#title' => t('Auto detect initial point'), '#description' => t('If checked, the map will auto detect initial coordinates and zoom level based on all markers on the map. Otherwise you can specify these values by yourself. You can also specify the zoom level to use for a single result.'), '#default_value' => $this->options['initial_point']['auto'], ); $form['initial_point']['latitude'] = array( '#type' => 'textfield', '#title' => t('Latitude'), '#size' => 40, '#maxlength' => 255, '#process' => array('views_process_dependency'), '#dependency' => array( 'edit-style-options-initial-point-auto' => array(0) ), '#default_value' => $this->options['initial_point']['latitude'], ); $form['initial_point']['longitude'] = array( '#type' => 'textfield', '#title' => t('Longitude'), '#size' => 40, '#maxlength' => 255, '#process' => array('views_process_dependency'), '#dependency' => array( 'edit-style-options-initial-point-auto' => array(0) ), '#default_value' => $this->options['initial_point']['longitude'], ); $form['initial_point']['zoom'] = array( '#type' => 'textfield', '#title' => t('Zoom level'), '#size' => 2, '#maxlength' => 2, '#process' => array('views_process_dependency'), '#dependency' => array( 'edit-style-options-initial-point-auto' => array(0) ), '#default_value' => $this->options['initial_point']['zoom'], ); $form['initial_point']['zoom_single'] = array( '#type' => 'textfield', '#title' => t('Single result zoom level'), '#size' => 2, '#maxlength' => 2, '#process' => array('views_process_dependency'), '#dependency' => array( 'edit-style-options-initial-point-auto' => array(1) ), '#default_value' => $this->options['initial_point']['zoom_single'], ); $form['behaviours'] = array( '#type' => 'checkboxes', '#title' => t('Behaviours'), '#options' => array( 'hover' => t('Show info bubble on mouse hover'), 'declutter' => t('Declutter points') ), '#default_value' => $this->options['behaviours'], ); $form['overlays'] = array( '#type' => 'checkboxes', '#title' => t('Display following overlay types'), '#options' => array( 'markers' => t('Markers'), 'polylines' => t('Polyines'), ), '#default_value' => $this->options['overlays'], ); $form['controls'] = array( '#type' => 'checkboxes', '#title' => t('Controls'), '#description' => t('Select which controls should be displayed on the map.'), '#options' => array( 'pan' => t('Pan'), 'overview' => t('Overview'), 'scale' => t('Scale'), 'map_type' => t('Map type')), '#default_value' => $this->options['controls'], ); $form['zoom_control'] = array( '#type' => 'select', '#title' => t('Zoom Control'), '#options' => array( 0 => t('None'), 'large' => t('Large'), 'small' => t('Small'), ), '#default_value' => $this->options['controls']['zoom'], '#description' => t('Select an optional zoom control.'), ); $form['default_maptype'] = array( '#type' => 'select', '#title' => t('Default Map Type'), '#description' => t('Select which map type you would like to use as default: Standard Map, Satellite, or Hybrid'), '#options' => array( 'mxn.Mapstraction.ROAD' => t('Map'), 'mxn.Mapstraction.SATELLITE' => t('Satellite'), 'mxn.Mapstraction.HYBRID' => t('Hybrid'), 'mxn.Mapstraction.PHYSICAL' => t('Physical'), ), '#default_value' => $this->options['controls']['default_maptype'], ); $handlers = $this->display->handler->get_handlers('field'); if (empty($handlers)) { $form['error_markup'] = array( '#value' => t('You need at least one field before you can configure your field settings'), '#prefix' => '