diff --git a/leaflet.formatters.inc b/leaflet.formatters.inc index a71187d..ee250d6 100644 --- a/leaflet.formatters.inc +++ b/leaflet.formatters.inc @@ -361,23 +361,24 @@ function leaflet_apply_map_settings(&$map, &$features, $map_settings, $entity_ty // Apply zoom settings (will override hook_leaflet_map_info() values): if (isset($map_settings['zoom']['initialZoom']) && $map_settings['zoom']['initialZoom'] >= 0) { $map['settings']['zoom'] = intval($map_settings['zoom']['initialZoom']); } if (isset($map_settings['zoom']['minZoom']) && $map_settings['zoom']['minZoom'] >= 0) { $map['settings']['minZoom'] = intval($map_settings['zoom']['minZoom']); } if (isset($map_settings['zoom']['maxZoom']) && $map_settings['zoom']['maxZoom'] >= 0) { $map['settings']['maxZoom'] = intval($map_settings['zoom']['maxZoom']); } - if (isset($map_settings['zoom']['scroolWheelZoom']) && $map_settings['zoom']['scroolWheelZoom']) { - $map['settings']['scroolWheelZoom'] = intval($map_settings['zoom']['scroolWheelZoom']); + if (isset($map_settings['zoom']['scrollWheelZoom'])) { + $map['settings']['scrollWheelZoom'] = $map_settings['zoom']['scrollWheelZoom']; } + $icon = 'none'; if (isset($map_settings['icon']['iconType'])) { $icon = $map_settings['icon']['iconType']; $classes = NULL; if ($icon == 'html' && isset($map_settings['icon']['htmlClass'])) { // Clean the user-entered classes. $classes = explode(' ', $map_settings['icon']['htmlClass']); array_walk($classes, 'drupal_html_class'); $map_settings['icon']['htmlClass'] = implode(' ', $classes); } @@ -564,21 +565,21 @@ function leaflet_form_elements($group, $settings, $options = NULL) { '#description' => t('The maximum zoom level allowed. (How close in can you get?).'), '#type' => 'select', '#options' => $zoom_options, '#default_value' => isset($settings[$group]['maxZoom']) ? $settings[$group]['maxZoom'] : -1, '#element_validate' => array('leaflet_max_zoom_validate'), ); $form_element['scrollWheelZoom'] = array( '#title' => t('Scroll wheel zoom'), '#description' => t('Allow map to be zoomed with the mouse wheel.'), '#type' => 'checkbox', - '#default_value' => isset($settings[$group]['scrollWheelZoom']) ? $settings[$group]['scrollWheelZoom'] : 0, + '#default_value' => isset($settings[$group]['scrollWheelZoom']) ? $settings[$group]['scrollWheelZoom'] : 1, ); break; case 'icon': $form_element = array( '#title' => t('Point Icon'), '#description' => t('These settings will overwrite the icon settings defined in the map definition.'), '#type' => 'fieldset', '#collapsible' => TRUE, '#collapsed' => TRUE, diff --git a/leaflet_views/leaflet_views_plugin_style.inc b/leaflet_views/leaflet_views_plugin_style.inc index 5e9a101..287a65c 100644 --- a/leaflet_views/leaflet_views_plugin_style.inc +++ b/leaflet_views/leaflet_views_plugin_style.inc @@ -40,20 +40,21 @@ class leaflet_views_plugin_style extends views_plugin_style { $options['height'] = array('default' => '400'); $options['hide_empty'] = array('default' => ''); $options['popup']['contains'] = array( 'show' => array('default' => ''), 'text' => array('default' => ''), ); $options['zoom']['contains'] = array( 'initialZoom' => array('default' => ''), 'minZoom' => array('default' => 0), 'maxZoom' => array('default' => 18), + 'scrollWheelZoom' => array('default' => 1), ); $options['icon']['contains'] = array( 'iconType' => array('default' => 'marker'), 'iconUrl' => array('default' => ''), 'shadowUrl' => array('default' => ''), 'iconSize' => array( 'contains' => array( 'x' => array('default' => ''), 'y' => array('default' => ''), )),