Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function optionsForm(&$form, &$form_state)
 {
     $form['options']['layers'] = array('#type' => 'select', '#title' => t('Layers'), '#default_value' => isset($form_state['item']->options['layers']) ? $form_state['item']->options['layers'] : '', '#description' => t('Select the layers.'), '#options' => openlayers_layer_options(), '#required' => TRUE, '#multiple' => TRUE);
     $form['options']['positioning'] = array('#type' => 'select', '#title' => t('Positioning'), '#default_value' => isset($form_state['item']->options['positioning']) ? $form_state['item']->options['positioning'] : 'top-left', '#description' => t('Defines how the overlay is actually positioned. Default is top-left.'), '#options' => openlayers_positioning_options(), '#required' => TRUE);
     $form['options']['autoPan'] = array('#type' => 'checkbox', '#title' => t('Autopan'), '#description' => t('If set to true the map is panned when calling setPosition, so that the overlay is entirely visible in the current viewport. The default is false.'), '#default_value' => $this->getOption('autoPan', FALSE));
     $form['options']['autoPanAnimation'] = array('#type' => 'textfield', '#title' => t('Autopan animation duration'), '#default_value' => $this->getOption('autoPanAnimation', 1000), '#description' => t('The options used to create a ol.animation.pan animation. This animation is only used when autoPan is enabled. By default the default options for ol.animation.pan are used. If set to zero the panning is not animated. The duration of the animation is in milliseconds. Default is 1000.'));
     $form['options']['autoPanMargin'] = array('#type' => 'textfield', '#title' => t('Autopan Animation'), '#default_value' => $this->getOption('autoPanMargin', 20), '#description' => t('The margin (in pixels) between the overlay and the borders of the map when autopanning. The default is 20.'));
 }
Ejemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function optionsForm(&$form, &$form_state)
 {
     $layers = ctools_export_crud_load_all('openlayers_layers');
     $options = array('' => t('<Choose the layer>'));
     foreach ($layers as $machine_name => $data) {
         $options[$machine_name] = $data->name;
     }
     $form['options']['layer'] = array('#type' => 'select', '#title' => t('Layer'), '#default_value' => isset($form_state['item']->options['layer']) ? $form_state['item']->options['layer'] : '', '#description' => t('Select the layer.'), '#options' => $options, '#required' => TRUE);
     $form['options']['positioning'] = array('#type' => 'select', '#title' => t('Positioning'), '#default_value' => isset($form_state['item']->options['positioning']) ? $form_state['item']->options['positioning'] : 'top-left', '#description' => t('Defines how the overlay is actually positioned. Default is top-left.'), '#options' => openlayers_positioning_options(), '#required' => TRUE);
 }
Ejemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function optionsForm(&$form, &$form_state)
 {
     $form['options']['source'] = array('#type' => 'select', '#title' => t('Source'), '#default_value' => isset($form_state['item']->options['source']) ? $form_state['item']->options['source'] : '', '#description' => t('Select the source.'), '#options' => openlayers_source_options(), '#required' => TRUE);
     $form['options']['zoom'] = array('#type' => 'textfield', '#title' => t('Zoom'), '#default_value' => isset($form_state['item']->options['zoom']) ? $form_state['item']->options['zoom'] : 10, '#description' => t('Integer or <em>auto</em>.'), '#required' => TRUE);
     $form['options']['enableAnimations'] = array('#type' => 'checkbox', '#title' => t('Enable animations'), '#default_value' => isset($form_state['item']->options['enableAnimations']) ? $form_state['item']->options['enableAnimations'] : FALSE, '#description' => t('Enable pan and zoom animation.'));
     $form['options']['animations'] = array('#type' => 'fieldset', '#title' => 'Animations options', '#states' => array('visible' => array('input[name="options[enableAnimations]"' => array('checked' => TRUE))));
     $form['options']['animations']['pan'] = array('#type' => 'textfield', '#title' => t('Pan animation duration'), '#default_value' => isset($form_state['item']->options['animations']['pan']) ? $form_state['item']->options['animations']['pan'] : '500', '#description' => t('Duration of the pan animation.'));
     $form['options']['animations']['zoom'] = array('#type' => 'textfield', '#title' => t('Zoom animation duration'), '#default_value' => isset($form_state['item']->options['animations']['zoom']) ? $form_state['item']->options['animations']['zoom'] : '500', '#description' => t('Duration of the zoom animation.'));
     $form['options']['positioning'] = array('#type' => 'select', '#title' => t('Positioning'), '#default_value' => isset($form_state['item']->options['positioning']) ? $form_state['item']->options['positioning'] : 'top-left', '#description' => t('Defines how the overlay is actually positioned. Default is top-left.'), '#options' => openlayers_positioning_options(), '#required' => TRUE);
 }
Ejemplo n.º 4
0
 /**
  * {@inheritdoc}
  */
 public function optionsForm(&$form, &$form_state)
 {
     $form['options']['layer'] = array('#type' => 'select', '#title' => t('Layer'), '#empty_option' => t('- Select a Layer -'), '#default_value' => isset($form_state['item']->options['layer']) ? $form_state['item']->options['layer'] : '', '#description' => t('Select the layer.'), '#options' => \Drupal\openlayers\Openlayers::loadAllAsOptions('Layer'), '#required' => TRUE);
     $form['options']['positioning'] = array('#type' => 'select', '#title' => t('Positioning'), '#default_value' => isset($form_state['item']->options['positioning']) ? $form_state['item']->options['positioning'] : 'top-left', '#description' => t('Defines how the overlay is actually positioned. Default is top-left.'), '#options' => openlayers_positioning_options(), '#required' => TRUE);
 }