[OpenLayers-Users] Transparent WMS overlay on top of a Google layer

Erik Heinz erik at iks-jena.de
Fri Apr 11 17:51:32 EDT 2008


Hi,

could anyone please point me to a working example of a transparent 
WMS layer as overlay over a Google Maps layer in EPSG:900913 projection?

My current attempt looks like this:

    var options = {
      projection: "EPSG:900913",
      units: 'm',
      maxExtent: new OpenLayers.Bounds(
        1272516.0, 6585124.3, 1319786.0, 6632981.0),
      controls: [new OpenLayers.Control.MouseDefaults()]
    };
    map = new OpenLayers.Map('map', options);

    l_gsat = new OpenLayers.Layer.Google('Google',
      {type: G_SATELLITE_MAP, 'sphericalMercator': true} );

    l_rr = new OpenLayers.Layer.WMS('Radrouten',
      'http://wms.adfc-jena.de/rrtop.php?show=all',
      {layers:'Radrouten', format:'img/png', transparent:'true'},
      {'reproject': false, 'isBaseLayer': false}
    );

    map.addLayers([l_gsat,l_rr]);

Complete example is at: http://www.adfc-jena.de/karte/radrouten1.php
The Google layer is being displayed but the WMS server never gets queried.
I played around changing parameters but without avail.

(The WMS server is not a complete implementation but does only simple GetMap
queries. It works fine as a single layer in OpenLayers though.)

What I'm doing wrong here? Any help is greatly appreciated. 
I am using OpenLayers-2.5 for now.

Thank you in advance,
Erik



More information about the Users mailing list