[OpenLayers-Users] Openlayers - tilecache and overlay problem

Christopher Schmidt crschmidt at metacarta.com
Wed Dec 6 06:44:36 EST 2006


On Wed, Dec 06, 2006 at 12:04:25PM +0100, Vincent Picavet wrote:
> Hello,
> Here is my setup :
> * mapserver serving a WMS layer
> * Tilecache caching this layer (same host)
> * Openlayers as a client
> 
> I set up Openlayers to display the layer as WMS directly from mapserver, it 
> works well. Then I set it up to display the same layer from tilecache, and it 
> works like a charm.
> 
> The thing is that I would like to have this layer as a transparent overlay in 
> openlayers. When I enable the transparency (transparent: "true" in layer 
> creation), the WMS appears as an overlay. Everything fine up to here.
> But when I do the same with WMSC from tilecache, and check the corresponding 
> layer in openlayer's overlay list, I only have broken images. Same result if 
> I create the WMS layer without transparency, and try this just after 
> creation :
> wmsc_layer.setIsBaseLayer(false);
> 
> The trouble seems to be on openlayer's side, but I can't figure out why it 
> can't find tilecache images when the layer is in overlay mode, whereas it can 
> find them in BaseLayer mode.
> Any idea ?

Vincent:

In order to display images over the top of Google Maps, there is
additional functionality in OpenLayers that modifies the bounding box of
the image when it is an overlay.

To turn off this functionality, you can turn reprojection off:

  layer = new OpenLayers.Layer.WMS("WMS-C", "URL", {'layers':'foo'},
  {'isBaseLayer':false, 'reproject': false});

The fact that putting an overlay over a standard WMS causes this to
break is an issue I'm aware of, but haven't yet had time to track down.
I think Tim Schaub spent some time looking at it, and has given us a few
patches for it -- Tim, can you comment on if these patches had actually
fixed the issue for you? or were you just using reproject=false?

Note also that sending 'transprent':true in the OpenLayers config won't
actually change the TileCache images. To create transparent tileCache
images, your 'url' on your WMS Layer should be something like:

  http://example.com/cgi-bin/mapserv?TRANSPARENT=true

Once you've set the reproject flag to false, and modified your URL line
in your TileCache config, everything should work just fine.

Sorry for not better documenting this known issue.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list