map.getCenter() should return a cloned center, so that (for example)

transforming the center doesn't break the map. patch by edgemaster,
r=me, (Closes #1853)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@8410 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2008-11-23 22:31:12 +00:00
parent ccbbcd5759
commit ca30d3df62
2 changed files with 8 additions and 2 deletions

View File

@@ -1330,7 +1330,11 @@ OpenLayers.Map = OpenLayers.Class({
* {<OpenLayers.LonLat>}
*/
getCenter: function () {
return this.center;
var center = null;
if (this.center) {
center = this.center.clone();
}
return center;
},