[OpenLayers-Users] openlayers and tilecache

Eric Lemoine eric.lemoine at gmail.com
Thu Jan 18 09:23:23 EST 2007


Hi Erik and Christopher,

On 1/17/07, Erik Uzureau <euzuro at gmail.com> wrote:
> Hi Eric, I added your question to the OpenLayers FAQ here [1]
> Is  this all the information one would need to know or should the answer
> be more complete?

I'd say it's ok not to give details and point the user to the HTML example.

However, the directives provided in the README file don't suffice for
the user to be able to run the HTML example. Indeed, the TileCache
code must be extracted in a web directory, not only in a directory
that can run CGI (or mod_python) scripts.

Also, index.html only works if TileCache was set up under CGI, and
doesn't work if TileCache was set up under mod_python.

Attached to this email is a patch to README reflecting the suggested
doc changes.


Patch also provided inline:




--- README.old	2007-01-18 15:14:19.000000000 +0100
+++ README	2007-01-18 15:13:55.000000000 +0100
@@ -33,10 +33,19 @@
 To set up a TileCache under CGI
 ===============================

- * Extract the code to some location which can run CGI scripts.
+ * Extract the code to some web directory (e.g. in /var/www).
  * Edit tilecache.cfg to point the DiskCache to the location you wish
    to cache tiles, and the layers to point to the map file or WMS
    server you wish to cache
+ * Permit CGI execution in the TileCache directory.
+   For example, if TileCache is to be run with Apache, the
+   following must be added in your Apache configuration:
+     <Directory /var/www/tilecache>
+  	  AddHandler cgi-script .cgi
+	  Options +ExecCGI
+     </Directory>
+   where /var/www/tilecache is the directory resulting from
+   the code extraction.
  * Visit:

    http://example.com/yourdir/tilecache.cgi?LAYERS=basic&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG:4326&BBOX=-180,-90,0,90&WIDTH=256&HEIGHT=256
@@ -48,8 +57,7 @@
 To set up a TileCache under mod_python
 ======================================

- * Extract the code to some location under which you can run
-   mod_python scripts.
+ * Extract the code to some web directory (e.g. /var/www).
  * Edit tilecache.cfg to point the DiskCache to the location you wish
    to cache tiles, and the layers to point to the map file or WMS
    server you wish to cache
@@ -58,11 +66,13 @@
        PythonHandler TileCache.Service
        PythonOption TileCacheConfig /path/to/tilecache.cfg
    An example might look like:
-     <Directory /var/www/wms-c/>
+     <Directory /var/www/tilecache/>
          AddHandler python-program .py
          PythonHandler TileCache.Service
-         PythonOption TileCacheConfig /path/to/tilecache.cfg
+         PythonOption TileCacheConfig /var/www/tilecache/tilecache.cfg
      </Directory>
+   where /var/www/tilecache is the directory resulting from
+   the code extraction.
  * Visit one of the URLs described above, replacing tilecache.cgi with
    tilecache.py
  * If you see a tile you have set up your configuration correctly. Congrats!
@@ -112,4 +122,18 @@
   url -- URL to use when requesting images from a remote WMS server. Required
          for WMSLayer.

+OpenLayers with TileCache
+=========================
+
+To run OpenLayers with TileCache the URL passed to the OpenLayers.Layer.WMS
+constructor must point to the TileCache script, i.e. tilecache.cgi or
+tilecache.py. As an example see the index.html file included in the TileCache
+distribution.
+
+Note: index.html assumes TileCache is set up under CGI (see above). If you set
+up TileCache under mod_python you'd need to slighly modify index.html: the URL
+passed to the OpenLayers.Layer.WMS constructor must point to the mod_python
+script as opposed to the CGI script, so replace tilecache.cgi with
+tilecache.py.
+

-- 
Eric
-------------- next part --------------
A non-text attachment was scrubbed...
Name: README-patch
Type: application/octet-stream
Size: 2899 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/openlayers-users/attachments/20070118/d415cd12/README-patch.obj


More information about the Users mailing list