OpenLayers OpenLayers

Ticket #1249: OpenLayers.Map.patch

File OpenLayers.Map.patch, 1.5 kB (added by openlayers, 8 months ago)
  • Map.js

    old new  
    836836        var oldExtent = null; 
    837837        if (this.baseLayer) { 
    838838            oldExtent = this.baseLayer.getExtent(); 
     839            oldProjection = this.getProjectionObject(); 
    839840        } 
    840841 
    841842        if (newBaseLayer != this.baseLayer) { 
     
    866867                    var newCenter = (oldExtent)  
    867868                        ? oldExtent.getCenterLonLat() 
    868869                        : center; 
     870                         
     871                    if(!oldProjection.equals(this.getProjectionObject())) { 
     872                        newCenter.transform(oldProjection, this.getProjectionObject()); 
     873                        oldExtent.transform(oldProjection, this.getProjectionObject()); 
     874                    } 
    869875 
    870876                    //the new zoom will either come from the old Extent or  
    871877                    // from the current resolution of the map                                                 
  • Layer/SphericalMercator.js

    old new  
    128128    }, 
    129129     
    130130    /** 
    131      * Method: projectForward  
     131     * Method: projectInverse 
    132132     * Given an object with x and y properties in Spherical Mercator, modify 
    133133     * the x,y properties on the object to be the unprojected coordinates. 
    134134     *