<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>mouse wheel &#8211; stoimen&#039;s web log</title>
	<atom:link href="/tag/mouse-wheel/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>on web development</description>
	<lastBuildDate>Tue, 13 Feb 2018 08:18:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.0.3</generator>
	<item>
		<title>OpenLayers disable mouse wheel on zoom</title>
		<link>/2009/06/20/openlayers-disable-mouse-wheel-on-zoom/</link>
		<comments>/2009/06/20/openlayers-disable-mouse-wheel-on-zoom/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 06:29:49 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[micro tutorial]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[mouse wheel]]></category>
		<category><![CDATA[openlayers]]></category>
		<category><![CDATA[OpenLayers.Control.Navigation]]></category>
		<category><![CDATA[zoom]]></category>

		<guid isPermaLink="false">/?p=603</guid>
		<description><![CDATA[What is OpenLayers? OpenLayers is a open source JavaScript library, which helps for the usage and development of web based map applications. Usually when you use something like http://openstreetmap.org/ you&#8217;ve a tile server, which contains, or dynamically, renders tiles on a specific coordinates and zoom level. Such application in basic are most of the map &#8230; <a href="/2009/06/20/openlayers-disable-mouse-wheel-on-zoom/" class="more-link">Continue reading <span class="screen-reader-text">OpenLayers disable mouse wheel on zoom</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2009/07/14/openlayers-disable-dragging/" rel="bookmark" title="OpenLayers disable dragging">OpenLayers disable dragging </a></li>
<li><a href="/2009/07/01/javascript-disable-mouse-wheel/" rel="bookmark" title="JavaScript disable mouse wheel">JavaScript disable mouse wheel </a></li>
<li><a href="/2010/03/19/openlayers-can-be-faster/" rel="bookmark" title="OpenLayers Can Be Faster!">OpenLayers Can Be Faster! </a></li>
<li><a href="/2010/01/14/optimizing-openlayers-make-it-smaller-and-faster/" rel="bookmark" title="Optimizing OpenLayers. Make it smaller and faster!">Optimizing OpenLayers. Make it smaller and faster! </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>What is OpenLayers?</h2>
<p>OpenLayers is a open source JavaScript library, which helps for the usage and development of web based map applications. Usually when you use something like <a title="Open Street Map" href="http://openstreetmap.org/" target="_blank">http://openstreetmap.org/</a> you&#8217;ve a tile server, which contains, or dynamically, renders tiles on a specific coordinates and zoom level. Such application in basic are most of the map servers you may know, as Google, Yahoo and Live (now Bing). Than you need a layer above that, that must generate the correct HTTP queries to the server and after receiving the tiles to position them correctly. Of course a open library like OpenLayers do much more. In fact this is complex JavaScript application that gives enough flexability to manipulate rich map applications.</p>
<h2>How to disable the zoom with the mouse wheel</h2>
<p>Very common problem (if we can say so) in map sites is the scroll, cause sometimes the user wants to scroll the page, and sometimes to scroll the map, which action results in zooming the map. Yes, there are so many solutions as many are the combinations of those scenarios. But the case here was how to disable the mouse wheel on OpenLayers.<span id="more-603"></span></p>
<h2>Why it&#8217;s not working</h2>
<p>Described in the documentation as a simple task, it appears to be not so much! Following the official instructions, you must add those lines of code:<em></em></p>
<pre lang="javascript">var movemap = new OpenLayers.Control.Navigation({'zoomWheelEnabled': false});

movemap.disableZoomWheel();</pre>
<p>&#8230; but that&#8217;s not working.</p>
<h2>How to make it really work</h2>
<p>Actually something&#8217;s blocking the effect of disableZoomWheel in the chain of the Control class, so the solution is as simple as it&#8217;s:</p>
<pre lang="javascript">controls = map.getControlsByClass('OpenLayers.Control.Navigation');

for(var I = 0; i < controls.length; ++i)
     controls.disableZoomWheel();
</pre>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2009/07/14/openlayers-disable-dragging/" rel="bookmark" title="OpenLayers disable dragging">OpenLayers disable dragging </a></li>
<li><a href="/2009/07/01/javascript-disable-mouse-wheel/" rel="bookmark" title="JavaScript disable mouse wheel">JavaScript disable mouse wheel </a></li>
<li><a href="/2010/03/19/openlayers-can-be-faster/" rel="bookmark" title="OpenLayers Can Be Faster!">OpenLayers Can Be Faster! </a></li>
<li><a href="/2010/01/14/optimizing-openlayers-make-it-smaller-and-faster/" rel="bookmark" title="Optimizing OpenLayers. Make it smaller and faster!">Optimizing OpenLayers. Make it smaller and faster! </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2009/06/20/openlayers-disable-mouse-wheel-on-zoom/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
	</channel>
</rss>
