adding click to enable and disable zoom so scrolling is easier in desktop
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 9 Oct 2018 14:00:34 +0000 (10:00 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 9 Oct 2018 14:00:34 +0000 (10:00 -0400)
parts/map-image.php

index d418db1..29bf46b 100644 (file)
         var url = '<?php echo $url ?>';
         leafletMap = L.map('front-map-image', {
             center: [45.404496, -84.912744],
-            zoom: 13
+            zoom: 13,
+            scrollWheelZoom: false
         });
+        leafletMap.on('click', function() { 
+            if(!leafletMap.scrollWheelZoom._enabled){
+                leafletMap.scrollWheelZoom.enable(); 
+            }else if(leafletMap.scrollWheelZoom._enabled){
+                leafletMap.scrollWheelZoom.disable();
+            }
+            
+        });
+        // leafletMap.on('mouseover', function() { leafletMap.scrollWheelZoom.enable(); });
+
         var leafletTileServer = 'https://maps.gaslightmedia.com/08172018-4c95c314f0934e680190f27ef99c6dcc/{z}/{x}/{y}.png';
         var leafletMinZoom = 3;
         var leafletMaxZoom = 19;