*** orig_panzoombar.js 2010-12-11 11:59:40.000000000 +0100 --- my_panzoombar.js 2010-12-11 11:55:40.000000000 +0100 *************** *** 1,7 **** --- 1,15 ---- + //---------------------------------------------------------------------------- + // Parameter "minZoom" verkürzt den Slideranzeigebereich + // manipuliert aber *nicht* map.zoom + // + // Funktion von Mouseradzoom und "zoomout"-Button bleiben unangetastet + //---------------------------------------------------------------------------- + OpenLayers.Control.PanZoomBar=OpenLayers.Class(OpenLayers.Control.PanZoom, { zoomStopWidth:18, zoomStopHeight:11, + minZoom:0, slider:null, sliderEvents:null, zoombarDiv:null, *************** *** 80,86 **** "click":this.doubleClick }); var sz=new OpenLayers.Size(); ! sz.h=this.zoomStopHeight*this.map.getNumZoomLevels(); sz.w=this.zoomStopWidth; var div=null; if(OpenLayers.Util.alphaHack()) { --- 88,94 ---- "click":this.doubleClick }); var sz=new OpenLayers.Size(); ! sz.h=this.zoomStopHeight*Math.max(this.map.getNumZoomLevels()-this.minZoom,1); sz.w=this.zoomStopWidth; var div=null; if(OpenLayers.Util.alphaHack()) { *************** *** 104,110 **** this.startTop=parseInt(div.style.top); this.div.appendChild(slider); this.map.events.register("zoomend",this,this.moveZoomBar); ! centered=centered.add(0,this.zoomStopHeight*this.map.getNumZoomLevels()); return centered; }, --- 112,118 ---- this.startTop=parseInt(div.style.top); this.div.appendChild(slider); this.map.events.register("zoomend",this,this.moveZoomBar); ! centered=centered.add(0,this.zoomStopHeight*Math.max(this.map.getNumZoomLevels()-this.minZoom,1)); return centered; }, *************** *** 199,213 **** }else { zoomLevel+=Math.round(deltaY/this.zoomStopHeight); } ! this.map.zoomTo(zoomLevel); this.mouseDragStart=null; this.zoomStart=null; OpenLayers.Event.stop(evt); } }, moveZoomBar:function() { ! var newTop=((this.map.getNumZoomLevels()-1)-this.map.getZoom())*this.zoomStopHeight+this.startTop+1; this.slider.style.top=newTop+"px"; }, --- 207,222 ---- }else { zoomLevel+=Math.round(deltaY/this.zoomStopHeight); } ! this.map.zoomTo(Math.max(zoomLevel, this.minZoom)); this.mouseDragStart=null; this.zoomStart=null; OpenLayers.Event.stop(evt); + this.moveZoomBar(); } }, moveZoomBar:function() { ! var newTop=((this.map.getNumZoomLevels()-1)-Math.max(this.map.getZoom(),this.minZoom))*this.zoomStopHeight+this.startTop+1; this.slider.style.top=newTop+"px"; },