openlayers/openlayers — pull request #301 by ahocevar (2012-03-08 13:26:36+00:00)
Title: Adding CacheRead and CacheWrite controls.

These controls read tiles from and write them to the browser's localStorag. Example with a seeding tool included.

Because these controls only rely on layer events, support for other offline storage backends (even asynchronous ones or filesystem) than localStorage could easily be added. I could especially think of making it so application developers can provide their own backends. All it would take would be a modification of the ```fetch``` (Control.CacheRead) and ```cache``` (Control.CacheWrite) methods. But that would be separate pieces of work.

Tests pass in Safari 5, Chrome 17, Firefox 10, Opera 11, IE 7 (no localStorage, no Canvas), IE 8 (no Canvas) and IE 9.