OpenLayers OpenLayers

Ticket #1157: setextent.patch

File setextent.patch, 1.6 kB (added by pgiraud, 1 year ago)
  • lib/OpenLayers/Renderer/VML.js

    old new  
    7676        var resolution = this.getResolution(); 
    7777     
    7878        var org = extent.left/resolution + " " +  
    79                     extent.top/resolution
     79                    (extent.top/resolution - this.size.h)
    8080        this.root.setAttribute("coordorigin", org); 
    8181 
    82         var size = extent.getWidth()/resolution + " " +  
    83                     -extent.getHeight()/resolution; 
     82        var size = this.size.w + " " + this.size.h; 
    8483        this.root.setAttribute("coordsize", size); 
     84         
     85        // flip the VML display Y axis upside down so it  
     86        // matches the display Y axis of the map 
     87        this.root.style.flip = "y"; 
    8588    }, 
    8689 
    8790 
  • lib/OpenLayers/Renderer/SVG.js

    old new  
    120120        // Set the viewbox -- the left/top will be pixels-dragged-since-res change, 
    121121        // the width/height will be pixels. 
    122122        var extentString = left + " " + top + " " +  
    123                              extent.getWidth() / resolution + " " + extent.getHeight() / resolution
     123                             this.size.w + " " + this.size.h
    124124        //var extentString = extent.left / resolution + " " + -extent.top / resolution + " " +  
    125125        this.rendererRoot.setAttributeNS(null, "viewBox", extentString); 
    126126    },