3

I would like to improve the performance of my application that displays thematic maps using OpenLayers, Google Maps & MapServer with TileCache (http://tilecache.org). Therefore I followed the installation instructions and installed TileCache successfully.

Within my application I have the following code to embed a new layer on top of my basemap that works fine so far:

var wms_layer = new OpenLayers.Layer.WMS("WMS layer","localhost/cgi-bin/mapserv"
        {
        map: [path_to_my_mapfile],
        layers: [list of layers],
        transparent:true
       }); 
my_map.addLayer(wms_layer);

The documentation basically says that the URL passed to the OpenLayers.Layer.WMS constructor must point to the TileCache script, i.e. tilecache.cgi or tilecache.py.

var wms_layer = new OpenLayers.Layer.WMS("WMS layer","localhost/cgi-bin/tilecache/tilecache.cgi"
           {
           map: [path_to_my_mapfile],
           layers: [list of layers],
           transparent:true
          });
my_map.addLayer(wms_layer);

Unfortunately it does not work, meaning that I can see no maps when I switch the url. Any idea what could be wrong? Maybe it is a configuration setting I missed in tilecache.cfg but I could not figure out what the right settings are.

Does anybody have some experiences with this issue?

auralbee
  • 8,741
  • 4
  • 29
  • 36
  • In the meantime, I could solve one problem that was caused because I missed to install Python MapScript. With the TileCacheConfig tool I am now able to view my maps, but still have to figure out how to get them line up correctly with my basemap. – auralbee Jan 15 '10 at 11:34
  • Do the resolutions and extent that you used to configure the tiling service (the ones used in tilecache.cfg) match the ones you use when creating the OpenLayers Map object? When requesting an image directly to the TileCache script, do you receive some kind of error message? – amercader Jan 17 '10 at 21:54
  • The parameter maxResolution matches with the maxResolution parameter of the OpenLayers.Map object and the Google Base Layer. The parameter maxExtent matches with the parameter data_extent and bbox in tilecache.cfg. It now works somehow, the tiles are cached on my disk and displayed in my map application. Although Mapserver is still complaining "Invalid SRS given. SRS must be valid for all requested layers." but this seems to be some issue with reprojecting my layers from epsg:4326 to epsg:900313. – auralbee Jan 18 '10 at 15:14

1 Answers1

1

If you have questions about the above mentioned issues that can´t be answered here, subscribe to the OpenLayers mailing lists. I got great support from the people subscribed to that list so far.
Visit: http://openlayers.org/mailman/listinfo

auralbee
  • 8,741
  • 4
  • 29
  • 36