[OpenLayers-Users] Problem when switching WMS layers on and off with Google Base Layer

Robert Hicks robhyx at gmail.com
Thu Jan 29 16:18:34 EST 2009


Hello all,
I am having an issue when I have some WMS Layers over top of a Google base
map. Basically what happens is when I toggle to layers on and off in the
layer switcher the next time the layer appears it is shifted down relative
to the Google map. It does not do this with the basic OpenLayers base map
from http://labs.metacarta.com/wms/vmap0.

Here are my layer definitions:

var parcels = new OpenLayers.Layer.WMS(
                "Parcels", geoserverDomain,
                {
                    //width: '800',
                    srs: 'EPSG:4326',
                    layers: 'mylayer_parcels',
                    //height: '341',
                    styles: '',
     format: 'image/png',
     transparent: 'true',
     attribution: "A  Service"
                }
            );
            var munic = new OpenLayers.Layer.WMS(
                "Municipality", geoserverDomain,
                {
                    //width: '800',
                    srs: 'EPSG:4326',
                    layers: 'mylayer_munic',
                    //height: '341',
                    styles: '',
                    format: 'image/png',
     transparent: 'true',
     attribution: "A  Service"
                }
            );
            var roadcenterlines = new OpenLayers.Layer.WMS(
                "Road Center Lines", geoserverDomain,
                {
                    //width: '800',
                    srs: 'EPSG:4326',
                    layers: 'mylayer_roadcenterlines_ft',
                    //height: '341',
                    styles: '',
                    format: 'image/png',
     transparent: 'true',
     attribution: "A  Service"
                }
            );
            var raster = new OpenLayers.Layer.WMS(
                "Defiance County Raster", geoserverDomain,
                {
                    //width: '800',
                    srs: 'EPSG:4326',
                    layers: 'gv:county',
                    //height: '341',
                    styles: '',
                    format: 'image/png',
     transparent: 'true',
     attribution: "A  Service"
                }
            );
            var vector = new OpenLayers.Layer.Vector(
       "GlobalView",
             {
             attribution:"A  Service",
             displayInLayerSwitcher: false
             }
            );
            map.addLayers([wms, raster, parcels, munic, roadcenterlines,
vector]);
            // setup controls and initial zooms
            map.addControl(new OpenLayers.Control.PanZoomBar());
            map.addControl(new OpenLayers.Control.Navigation());
            map.addControl(new OpenLayers.Control.Scale($('scale')));
    map.addControl(new OpenLayers.Control.MousePosition({element:
$('location')}));
            map.addControl(new OpenLayers.Control.LayerSwitcher());
            map.addControl(new OpenLayers.Control.Attribution());
            map.setCenter(new
OpenLayers.LonLat(-84.52,41.35),11,false,false);

Has anyone encountered this?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090129/4db39c46/attachment.html


More information about the Users mailing list