You are here

public function ip_geoloc_plugin_style_leaflet::options_form in IP Geolocation Views & Maps 7

Implements options_form().

@todo refactor, break up into more mangeable pieces

Overrides views_plugin_style::options_form

File

views/ip_geoloc_plugin_style_leaflet.inc, line 188

Class

ip_geoloc_plugin_style_leaflet

Code

public function options_form(&$form, &$form_state) {
  parent::options_form($form, $form_state);
  $path = drupal_get_path('module', 'ip_geoloc');
  $select_css_file = strpos(ip_geoloc_marker_directory(), 'amarkers') ? 'ip_geoloc_admin_select_amarkers.css' : 'ip_geoloc_admin_select_markers.css';
  $form['#attached'] = array(
    'css' => array(
      "{$path}/css/ip_geoloc_admin.css",
      "{$path}/css/{$select_css_file}",
    ),
  );
  $form_state['renderer'] = 'leaflet';
  $weight = 1;
  $this
    ->_add_map_and_height($form, $weight);
  ip_geoloc_plugin_style_bulk_of_form($this, $weight, $form, $form_state);
  $form['center_option']['#options'][0] = t('Auto-box to fit all markers (include visitor marker if color <strong>not</strong> set to &lt;none&gt;)');
  $lib_markercluster = module_exists('leaflet_markercluster') ? leaflet_markercluster_get_library_path() : FALSE;
  $fields = ip_geoloc_get_display_fields($this->display->handler, FALSE, TRUE);
  $this
    ->_add_default_marker($form, $weight);
  $this
    ->_add_visitor_marker($form, $weight);
  $this
    ->_add_check_boxes($form, $lib_markercluster, $weight);
  $this
    ->_add_mini_map_inset($form, $weight);
  $this
    ->_add_marker_tags($form, $fields, $weight);
  $this
    ->_add_marker_tooltips($form, $fields, $weight);
  $this
    ->_add_marker_class_names($form, $fields, $weight);
  $this
    ->_add_sync($form, $weight);
  $this
    ->_add_markercluster($form, $lib_markercluster, $weight);
  $this
    ->_add_cluster_differentiator($form, $form_state, $lib_markercluster, $weight);
  $this
    ->_add_more_map_options($form, $weight);
  $this
    ->_add_vector_display_options($form, $weight);
}