[ka-Map-users] ka-Map and OpenLayers
rst at alum.mit.edu
Wed Jun 21 21:50:58 EDT 2006
Paul Spencer writes:
> Good point ... we were discussing tiling today. I can actually see
> ka-Map turning into a tile-cache server project separate from
> OpenLayers. The shortest path to integration is to add a kaMap layer
> and tile class to OpenLayers and use the existing kaMap tile.php to
> serve tiles to it. I'm currently working on designing a better
> strategy for tile caching since the current directory structure is
> very limited for large caches (it only goes one directory deep when
> you really look at it).
One thing that might be useful to look at is the Rails caching strategy.
Which actually relies on a dirty trick:
Rails registers itself with its host webserver as a 404 (file not
found) handler. So, when a request is made for a cacheable item, the
webserver first tries to read it as an ordinary file. If such a file
is present, it gets served normally, like any other static file, and
no dynamic code of any kind (Ruby or otherwise) is invoked. If not,
then Rails is invoked --- and if the item is cacheable, it stores the
data it's serving in a file, for the host server to serve normally
The approach has been tried at least once for map tiles --- see
for an example and downloads. The code implementing tile generation
is in these files:
The 'controller' is the code that responds directly to web requests;
the 'tiler' classes do tile generation.
(Also on display: a prototype-based map tile layer which also displays
polygons using SVG or VML, if the browser supports one or the other...).
Hope this is of interest...
More information about the ka-Map-users