Changeset 10878


Ignore:
Timestamp:
Nov 8, 2010 4:26:40 AM (6 years ago)
Author:
ahocevar
Message:

Fixed OverviewMap and PanZoomBar controls. The former was broken because the extent rectangle div now has to be added to the viewPortDiv instead of the div, and the latter because it uses pagePosition where it doesn't need to, with an incorrect argument. r=fredj (closes #2247)

Location:
trunk/openlayers/lib/OpenLayers/Control
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/openlayers/lib/OpenLayers/Control/OverviewMap.js

    r10706 r10878  
    158158        }
    159159
    160         this.mapDiv.removeChild(this.extentRectangle);
     160        this.ovmap && this.ovmap.viewPortDiv.removeChild(this.extentRectangle);
    161161        this.extentRectangle = null;
    162162
     
    230230        this.extentRectangle.style.zIndex = 1000;  //HACK
    231231        this.extentRectangle.className = this.displayClass+'ExtentRectangle';
    232         this.mapDiv.appendChild(this.extentRectangle);
    233232
    234233        this.element.appendChild(this.mapDiv); 
     
    491490                         fallThrough: false}, this.mapOptions);
    492491        this.ovmap = new OpenLayers.Map(this.mapDiv, options);
     492        this.ovmap.viewPortDiv.appendChild(this.extentRectangle);
    493493       
    494494        // prevent ovmap from being destroyed when the page unloads, because
  • trunk/openlayers/lib/OpenLayers/Control/PanZoomBar.js

    r10706 r10878  
    287287            return;
    288288        }
    289         var y = evt.xy.y;
    290         var top = OpenLayers.Util.pagePosition(evt.object)[1];
    291         var levels = (y - top)/this.zoomStopHeight;
     289        var levels = evt.xy.y / this.zoomStopHeight;
    292290        if(this.forceFixedZoomLevel || !this.map.fractionalZoom) {
    293291            levels = Math.floor(levels);
Note: See TracChangeset for help on using the changeset viewer.