[OpenLayers-Dev] Shouldn't getCenter return a clone?
joao.c.duarte at co.sapo.pt
Wed Jan 14 10:44:06 EST 2009
While I was developing my application, I got a strange behavior while using
map.getCenter() and map.getExtent().
I was calling map.getCenter() and modifying the value I got in return. Then
the map.getExtent() returned a strange bounding box.
After looking at the getCenter method of OpenLayers.Map, I found that whats
being returned is this.center directly, instead of a clone.
Shouldnt getCenter return a clone to prevent modifications on the return
value from the user, like for example getSize?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Dev