Disabling map scrolling in The Events Calendar

I’ve been working a lot the past few days to get a site setup for my newest client, Bad Moon Shooting. The primary role of the site is to allow visitors to find a handgun class and register for it online. It makes heavy use of three plugins for the core functionality. WooCommerce (free) handles the commerce part of things (the cart, accepting payments, etc). The Events Calendar (free) is used for scheduling classes, and finally WooTickets ($50) is used to sell tickets to events through WooCommerce. This has been a great combination, and all the plugins are well polished.

The Events Calendar includes a map on the event page, which is great because it helps people associate with where the classes are being held. The problem is that the map is set by default to be full-page width, and I found that as I scrolled the page, and my cursor fell over the map I would end up zooming the map instead of scrolling the page. Annoying. The Google Maps API is pretty robust, and includes the ability to disable this, but the plugin settings did not have any front facing option to do so. So I added one.

It was an easy tweak, and one I’ve submitted to the Tribe guys (authors of The Events Calendar and WooTickets). If you’re interested in it though and know your way around a diff file, I’ll include one below.

--- /the-events-calendar/admin-views/event-map.php  Tue Apr  2 21:47:46 2013
+++ /the-events-calendar/admin-views/event-map.php	Tue Apr  2 21:41:11 2013
@@ -14,6 +14,7 @@

function initialize() {
var myOptions = {
+	    scrollwheel: <?php echo tribe_get_option( 'embedGoogleMapsEnableScrollWheel', true ) ? 'true' : 'false' ; ?>,
    zoom: <?php echo tribe_get_option( 'embedGoogleMapsZoom', '10' ); ?>,
    center: event_address,
    mapTypeId: google.maps.MapTypeId.ROADMAP




--- /the-events-calendar/admin-views/tribe-options-general.php  Tue Apr  2 21:47:46 2013
+++ /the-events-calendar/admin-views/tribe-options-general.php	Tue Apr  2 21:38:27 2013
@@ -157,6 +157,15 @@
        'class' => 'google-embed-field',
        'validation_type' => 'number_or_percent',
     ),
+		 'embedGoogleMapsEnableScrollWheel' => array(
+			'type' => 'checkbox_bool',
+			'label' => __( 'Google Maps Enable Scrollwheel', 'tribe-events-calendar' ),
+			'tooltip' => __( 'Turn off to disable scrollwheel zooming on the map', 'tribe_events_calendar' ),
+			'size' => 'small',
+			'default' => true,
+			'class' => 'google-embed-field',
+			'validation_type' => 'boolean',
+		 ),
    'sendPressTrendsData' => array(
        'type' => 'checkbox_bool',
        'label' => __( 'Send PressTrends Data', 'tribe-events-calendar' ),