You are here

private function ip_geoloc_plugin_style_leaflet::_add_markercluster in IP Geolocation Views & Maps 7

1 call to ip_geoloc_plugin_style_leaflet::_add_markercluster()
ip_geoloc_plugin_style_leaflet::options_form in views/ip_geoloc_plugin_style_leaflet.inc
Implements options_form().

File

views/ip_geoloc_plugin_style_leaflet.inc, line 704

Class

ip_geoloc_plugin_style_leaflet

Code

private function _add_markercluster(&$form, $lib_markercluster, &$weight) {
  $desc_a = t('A typical cluster radius is 20 to 100 px. When you use a <em>cluster region differentiator</em> (see below), a marker radius of 200 px or more may give superior results. <br/>The visitor marker is excluded from clustering. Enter 0 to disable clustering altogether.');
  $desc_b = t('Requires the <a target="project" href="!url_project">Leaflet MarkerCluster</a> module.', array(
    '!url_project' => url('http://drupal.org/project/leaflet_markercluster'),
  ));
  $form['cluster_radius'] = array(
    '#title' => t('Marker cluster radius'),
    '#type' => 'textfield',
    '#field_suffix' => t('px'),
    '#size' => 4,
    '#default_value' => $this->options['cluster_radius'],
    '#description' => $lib_markercluster ? $desc_a : $desc_b,
    '#weight' => $weight++,
  );
  $form['disable_clustering_at_zoom'] = array(
    '#title' => t('Disable clustering at zoom'),
    '#type' => 'textfield',
    '#size' => 4,
    '#default_value' => is_numeric($this->options['disable_clustering_at_zoom']) ? $this->options['disable_clustering_at_zoom'] : '',
    '#description' => t('If you specify a zoom level, then there will be no clustering beyond that zoom level, regardless of the radius specified.'),
    '#weight' => $weight++,
  );
  $form['allow_clusters_of_one'] = array(
    '#title' => t('Allow clusters of one'),
    '#type' => 'checkbox',
    '#default_value' => $this->options['allow_clusters_of_one'],
    '#description' => t('Especially recommended when your clusters employ aggregation functions.'),
    '#weight' => $weight++,
  );
}