<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hey all, I have a simple map with some controls, namely, an OpenLayers.Control.NavToolbar and another control which basically allows capturing of a box being drawn by holding down alt. When the pan / zoom is toggled on the map the latter of the two becomes 'broken' and no longer works. Is this a bug, or does this make sense and I'm just missing something? Thanks in advance! Below is the JavaScript and HTML.<div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" color="#931a68"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(77, 145, 146); "><span style="color: #009193"><!</span>DOCTYPE<span style="color: #000000"> </span><span style="color: #009193">html></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(77, 145, 146); "><span style="color: #009193"><</span>html<span style="color: #009193">></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(77, 145, 146); "><span style="color: #000000"> </span><span style="color: #009193"><</span>head<span style="color: #009193">></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(56, 52, 255); "><span style="color: #000000"> </span><span style="color: #009193"><</span><span style="color: #4d9192">meta</span><span style="color: #000000"> </span><span style="color: #932192">http-equiv</span><span style="color: #000000">=</span>"Content-Type"<span style="color: #000000"> </span><span style="color: #932192">content</span><span style="color: #000000">=</span>"text/html; charset=utf-8"<span style="color: #009193">></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(56, 52, 255); "><span style="color: #000000"> </span><span style="color: #009193"><</span><span style="color: #4d9192">meta</span><span style="color: #000000"> </span><span style="color: #932192">name</span><span style="color: #000000">=</span>"viewport"<span style="color: #000000"> </span><span style="color: #932192">content</span><span style="color: #000000">=</span>"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"<span style="color: #009193">></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(56, 52, 255); "><span style="color: #000000"> </span><span style="color: #009193"><</span><span style="color: #4d9192">meta</span><span style="color: #000000"> </span><span style="color: #932192">name</span><span style="color: #000000">=</span>"apple-mobile-web-app-capable"<span style="color: #000000"> </span><span style="color: #932192">content</span><span style="color: #000000">=</span>"yes"<span style="color: #009193">></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(56, 52, 255); "><span style="color: #000000"> </span><span style="color: #009193"><</span><span style="color: #4d9192">link</span><span style="color: #000000"> </span><span style="color: #932192">rel</span><span style="color: #000000">=</span>"stylesheet"<span style="color: #000000"> </span><span style="color: #932192">href</span><span style="color: #000000">=</span>"<a href="http://openlayers.org/dev/examples/../theme/default/style.css">http://openlayers.org/dev/examples/../theme/default/style.css</a>"<span style="color: #000000"> </span><span style="color: #932192">type</span><span style="color: #000000">=</span>"text/css"<span style="color: #009193">></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(56, 52, 255); "><span style="color: #000000"> </span><span style="color: #009193"><</span><span style="color: #4d9192">link</span><span style="color: #000000"> </span><span style="color: #932192">rel</span><span style="color: #000000">=</span>"stylesheet"<span style="color: #000000"> </span><span style="color: #932192">href</span><span style="color: #000000">=</span>"<a href="http://openlayers.org/dev/examples/style.css">http://openlayers.org/dev/examples/style.css</a>"<span style="color: #000000"> </span><span style="color: #932192">type</span><span style="color: #000000">=</span>"text/css"<span style="color: #009193">></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <span style="color: #009193"><</span><span style="color: #4d9192">title</span><span style="color: #009193">></span>NavToolbar Demo<span style="color: #009193"></</span><span style="color: #4d9192">title</span><span style="color: #009193">></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <span style="color: #009193"><</span><span style="color: #4d9192">style</span> <span style="color: #932192">type</span>=<span style="color: #3834ff">'text/css'</span><span style="color: #009193">></span> </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <span style="color: #4d9192">#map</span> {</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <span style="color: #932192">height</span>: <span style="color: #382ee7">512px</span>;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> }</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <span style="color: #009193"></</span><span style="color: #4d9192">style</span><span style="color: #009193">></span> </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(56, 52, 255); "><span style="color: #000000"> </span><span style="color: #009193"><</span><span style="color: #4d9192">script</span><span style="color: #000000"> </span><span style="color: #932192">src</span><span style="color: #000000">=</span>"<a href="http://openlayers.org/dev/examples/../OpenLayers.js">http://openlayers.org/dev/examples/../OpenLayers.js</a>"<span style="color: #009193">></</span><span style="color: #4d9192">script</span><span style="color: #009193">></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(56, 52, 255); "><span style="color: #000000"> </span><span style="color: #009193"><</span><span style="color: #4d9192">script</span><span style="color: #000000"> </span><span style="color: #932192">type</span><span style="color: #000000">=</span>"text/javascript"<span style="color: #009193">></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <span style="color: #931a68">var</span> lon = 5;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <span style="color: #931a68">var</span> lat = 40;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <span style="color: #931a68">var</span> zoom = 5;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <span style="color: #931a68">var</span> map, layer;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <span style="color: #931a68">function</span> init() {</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> map = <span style="color: #931a68">new</span> OpenLayers.Map( <span style="color: #3834ff">'map'</span>, { controls: [<span style="color: #931a68">new</span> OpenLayers.Control.PanZoom()] } );</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> layer = <span style="color: #931a68">new</span> OpenLayers.Layer.WMS( <span style="color: #3834ff">"OpenLayers WMS"</span>, </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(56, 52, 255); "><span style="color: #000000"> </span>"<a href="http://vmap0.tiles.osgeo.org/wms/vmap0">http://vmap0.tiles.osgeo.org/wms/vmap0</a>"<span style="color: #000000">, {layers: </span>'basic'<span style="color: #000000">} );</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> map.addLayer(layer);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <span style="color: #931a68">var</span> panel = <span style="color: #931a68">new</span> OpenLayers.Control.NavToolbar();</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> map.addControl(panel);</div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; min-height: 15.0px"> <br class="webkit-block-placeholder"></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <span style="color: #931a68">var</span> control = <span style="color: #931a68">new</span> OpenLayers.Control();</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> OpenLayers.Util.extend(control, {</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> draw: <span style="color: #931a68">function</span> () {</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <span style="color: #931a68">this</span>.box = <span style="color: #931a68">new</span> OpenLayers.Handler.Box( control,</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> {<span style="color: #3834ff">"done"</span>: <span style="color: #931a68">this</span>.notice},</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> {keyMask: OpenLayers.Handler.MOD_ALT});</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <span style="color: #931a68">this</span>.box.activate();</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> },</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> notice: <span style="color: #931a68">function</span> (bounds) {</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> areaSelected(bounds);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> }</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> });</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> map.addControl(control);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> map.setCenter(<span style="color: #931a68">new</span> OpenLayers.LonLat(lon, lat), zoom);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> }</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(77, 145, 146); "><span style="color: #000000"> </span><span style="color: #009193"></</span>script<span style="color: #009193">></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(77, 145, 146); "><span style="color: #000000"> </span><span style="color: #009193"></</span>head<span style="color: #009193">></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(56, 52, 255); "><span style="color: #000000"> </span><span style="color: #009193"><</span><span style="color: #4d9192">body</span><span style="color: #000000"> </span><span style="color: #932192">onload</span><span style="color: #000000">=</span>"init()"<span style="color: #009193">></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <span style="color: #009193"><</span><span style="color: #4d9192">h1</span> <span style="color: #932192">id</span>=<span style="color: #3834ff">"title"</span><span style="color: #009193">></span>NavToolbar Demo<span style="color: #009193"></</span><span style="color: #4d9192">h1</span><span style="color: #009193">></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <span style="color: #009193"><</span><span style="color: #4d9192">div</span> <span style="color: #932192">id</span>=<span style="color: #3834ff">"tags"</span><span style="color: #009193">></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> navigation <span style="text-decoration: underline">toolbar</span>, basic</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <span style="color: #009193"></</span><span style="color: #4d9192">div</span><span style="color: #009193">></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(56, 52, 255); "><span style="color: #000000"> </span><span style="color: #009193"><</span><span style="color: #4d9192">p</span><span style="color: #000000"> </span><span style="color: #932192">id</span><span style="color: #000000">=</span>"shortdesc"<span style="color: #009193">></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> Demo the NavToolbar, a subclass of Control.Panel which shows icons for</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> navigation.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <span style="color: #009193"></</span><span style="color: #4d9192">p</span><span style="color: #009193">></span> </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(56, 52, 255); "><span style="color: #000000"> </span><span style="color: #009193"><</span><span style="color: #4d9192">div</span><span style="color: #000000"> </span><span style="color: #932192">id</span><span style="color: #000000">=</span>"map"<span style="color: #000000"> </span><span style="color: #932192">class</span><span style="color: #000000">=</span>"smallmap"<span style="color: #009193">></</span><span style="color: #4d9192">div</span><span style="color: #009193">></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(77, 145, 146); "><span style="color: #000000"> </span><span style="color: #009193"></</span>body<span style="color: #009193">></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(77, 145, 146); "><span style="color: #009193"></</span>html<span style="color: #009193">></span></div></font></div></div></body></html>