[OpenLayers-Users] Save&restore map extent

Christopher Schmidt crschmidt at metacarta.com
Tue Mar 25 07:51:48 EDT 2008


On Tue, Mar 25, 2008 at 09:21:21AM +0100, Gérald Quintana wrote:
> Hello,
> 
> I push the map extent bounds (map.getExtent()) to server with Ajax request.
> Later I restore it (map.zoomToExtent(...)), but I don't the one
> stored: the map is properly centered but the zoom level is one step
> lower than expected (I have to push '+').
> 
> How can I correct this?

Don't save the extent: It's susceptible to rounding errors. Save center
+ zoom instead.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list