Skip to content

Commit

Permalink
Disable scroll wheel for zooming in favor of map zoom buttons
Browse files Browse the repository at this point in the history
It's causing annoying behaviour for desktop users when scrolling
the page to the bottom and there is more content below the
map.

The behaviour of touchable devices does not seem to be
affected by this change and keeps behaving the same.
  • Loading branch information
Senen committed Mar 27, 2023
1 parent 82a2801 commit 9521f82
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/assets/javascripts/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
return "<a href='/budgets/" + data.budget_id + "/investments/" + data.investment_id + "'>" + data.investment_title + "</a>";
};
mapCenterLatLng = new L.LatLng(mapCenterLatitude, mapCenterLongitude);
map = L.map(element.id).setView(mapCenterLatLng, zoom);
map = L.map(element.id, { scrollWheelZoom: false }).setView(mapCenterLatLng, zoom);
App.Map.maps.push(map);
L.tileLayer(mapTilesProvider, {
attribution: mapAttribution
Expand Down

0 comments on commit 9521f82

Please sign in to comment.