OpenLayers Object Notation

save state | restore state | clear saved state

serialize map | clear features

This example show how a map can be serialized using OpenLayers Object Notation. The serialized map can be saved somewhere (like a cookie if it's under 4KB), and deserialized to restore the state of a map. Serializing features on a vector layer is possible, but creates a string that is typically too large for cookie storage

Navigate to some location, turn layers on/off, click save state. Close this page and reopen it (or just refresh) to see the state restored.