From: Anthony Talarico Date: Tue, 9 Oct 2018 14:00:34 +0000 (-0400) Subject: adding click to enable and disable zoom so scrolling is easier in desktop X-Git-Tag: v1.0.0^2~51 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=94c2037496f0b51a3533aded851fcc5e15520b45;p=WP-Themes%2Flakesideclub.git adding click to enable and disable zoom so scrolling is easier in desktop --- diff --git a/parts/map-image.php b/parts/map-image.php index d418db1..29bf46b 100644 --- a/parts/map-image.php +++ b/parts/map-image.php @@ -24,8 +24,19 @@ var 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;