You are here

function openlayers_layer_type_kml::options_form in Openlayers 6.2

Same name and namespace in other branches
  1. 7.2 plugins/layer_types/openlayers_layer_type_kml.inc \openlayers_layer_type_kml::options_form()

Options form which generates layers

Overrides openlayers_layer_type::options_form

File

includes/layer_types/kml.inc, line 42
KML Layer Type

Class

openlayers_layer_type_kml
OpenLayers KML Layer Type class

Code

function options_form() {
  return array(
    'url' => array(
      '#type' => 'textfield',
      '#title' => t('URL'),
      '#description' => t('The URL of the KML file.'),
      '#maxlength' => 1024,
      '#default_value' => isset($this->data['url']) ? $this->data['url'] : '',
    ),
    'formatOptions' => array(
      'extractStyles' => array(
        '#type' => 'checkbox',
        '#title' => t('Extract Styles'),
        '#description' => t('Extract styles from KML.'),
        '#default_value' => isset($this->data['formatOptions']['extractStyles']) ? $this->data['formatOptions']['extractStyles'] : TRUE,
      ),
      'extractAttributes' => array(
        '#type' => 'checkbox',
        '#title' => t('Extract Attributes'),
        '#description' => t('Extract attributes from KML.'),
        '#default_value' => isset($this->data['formatOptions']['extractAttributes']) ? $this->data['formatOptions']['extractAttributes'] : TRUE,
      ),
    ),
    'layer_type' => array(
      '#type' => 'hidden',
      '#value' => 'openlayers_layer_type_kml',
    ),
  );
}