OpenLayers OpenLayers

Ticket #1288: ticket1288.patch

File ticket1288.patch, 1.1 kB (added by bartvde, 1 year ago)
  • lib/OpenLayers/Control/PanZoomBar.js

    old new  
    277277            this.map.events.unregister("mouseup", this, this.passEventToSlider); 
    278278            this.map.events.unregister("mousemove", this, this.passEventToSlider); 
    279279            var deltaY = this.zoomStart.y - evt.xy.y 
    280             this.map.zoomTo(this.map.zoom + Math.round(deltaY/this.zoomStopHeight)); 
     280            if (this.map.fractionalZoom) { 
     281                var zoomLevel = this.map.zoom + (deltaY/this.zoomStopHeight); 
     282                var scale = OpenLayers.Util.getScaleFromResolution( 
     283                    this.map.getResolutionForZoom(zoomLevel), this.map.units ); 
     284                this.map.zoomToScale(scale); 
     285            } else { 
     286                this.map.zoomTo(this.map.zoom + Math.round(deltaY/this.zoomStopHeight)); 
     287            } 
    281288            this.moveZoomBar(); 
    282289            this.mouseDragStart = null; 
    283290            OpenLayers.Event.stop(evt);