openlayers
Version:
Build tools and sources for developing OpenLayers based mapping applications
13 lines (12 loc) • 476 B
HTML
layout: example.html
title: Mousewheel/Trackpad Zoom
shortdesc: Restrict wheel/trackpad zooming to integer zoom levels.
docs: >
By default, the `ol.interaction.MouseWheelZoom` can leave the map at
fractional zoom levels. If instead you want to constrain wheel/trackpad
zooming to integer zoom levels, set <code>constrainResolution: true</code>
when constructing the interaction.
tags: "trackpad, mousewheel, zoom, interaction"
<div id="map" class="map"></div>