AW: [OpenLayers-Users] mapserver, openlayers //// wms and google

Arnd Wippermann arnd.wippermann at web.de
Fri Sep 23 16:37:47 EDT 2011


Hi,

Try something like this:
 
function init()
{
    var A = new OpenLayers.Projection("EPSG:4326");
    var B = new OpenLayers.Projection("EPSG:900913");

    map = new OpenLayers.Map('map',
    { maxExtent: new
OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),
      numZoomLevels: 19,
      maxResolution: 156543.0399,
      units: 'm',
      projection: new OpenLayers.Projection("EPSG:900913"),
      displayProjection: new OpenLayers.Projection("EPSG:4326"),
	  controls:[
	  new OpenLayers.Control.Navigation(),
	  new OpenLayers.Control.LayerSwitcher(),
	  new OpenLayers.Control.MousePosition(),
	  new OpenLayers.Control.ScaleLine(),
	  new OpenLayers.Control.PanZoomBar(),
	  new OpenLayers.Control.Attribution()
		]
    });

		 
    var ghyb = new OpenLayers.Layer.Google("Google Hybrid", 
        {'type': G_HYBRID_MAP, sphericalMercator:true, numZoomLevels: 20});
    
    var mapurl="[url]";
    
    var soilmap = new OpenLayers.Layer.WMS("Soils",
        mapurl,    
        {layers: 'poias', format: 'image/png', transparent: "true"}, 
        {isBaseLayer: false, opacity: 0.6}
    );

    map.addLayers([ghyb,soilmap]);
    map.setCenter(new OpenLayers.LonLat(105,65).transform(A,B), 3);

}

Arnd

-----Ursprüngliche Nachricht-----
Von: openlayers-users-bounces at lists.osgeo.org
[mailto:openlayers-users-bounces at lists.osgeo.org] Im Auftrag von ribnick
Gesendet: Freitag, 23. September 2011 16:49
An: users at openlayers.org
Betreff: [OpenLayers-Users] mapserver, openlayers //// wms and google

Hello. Could you help me please. 

I am trying to display google map with WMS layer with openlayers/mapserver. 

My WMS layer fits in right position, but* borders of it going on north *
(screenshot: http://gis-lab.info/forum/download/file.php?id=3162 ). 

Code: http://pastebin.com/ZRpXYpxL

Thanks!

--
View this message in context:
http://osgeo-org.1803224.n2.nabble.com/mapserver-openlayers-wms-and-google-t
p6824486p6824486.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users



More information about the Users mailing list