[OpenLayers-Users] Can't display WMS using Spherical Mercator

Maria Panagou snowdrop at ath.forthnet.gr
Sun Dec 30 15:04:17 EST 2007


I have tried using the Spherical Mercator example with my data with no
success. I have transformed my WMS layer 'Quakes' in Spherical mercator ( I
can see the .map file is allright using MapBrowser) and I have used the
following code for openlayers which doesn't work. Any ideas?

var blow = OpenLayers.Layer.SphericalMercator.forwardMercator(20, 34.8);
		var bhigh = OpenLayers.Layer.SphericalMercator.forwardMercator(28.4,
41.6);

        function init(){
		 	var options = {
				projection: "EPSG:900913",
				units: "m",
				maxExtent: new OpenLayers.Bounds(blow.lon, blow.lat, bhigh.lon,
bhigh.lat),
				restrictedExtent: new OpenLayers.Bounds(blow.lon, blow.lat, bhigh.lon,
bhigh.lat),
				controls: [new OpenLayers.Control.LayerSwitcher(),
				new OpenLayers.Control.PanZoomBar(),
				new OpenLayers.Control.MouseToolbar(),
				new OpenLayers.Control.MousePosition({prefix: 'x: ', separator: ', y:
'})],
				
				 theme:null
            }
            map = new OpenLayers.Map('map', options);
            
            var satellite = new OpenLayers.Layer.Google( "Google Satellite"
, {type: G_SATELLITE_MAP, 'sphericalMercator':true} );
            var hybrid = new OpenLayers.Layer.Google( "Google Hybrid" ,
{type: G_HYBRID_MAP, 'sphericalMercator':true });
	    var dtm = new OpenLayers.Layer.WMS( "ICEDS (Integrated CEOS European
Data Server) WMS",
                "http://iceds.ge.ucl.ac.uk/cgi-bin/icedswms?", {layers:
"srtm"});
		
				
	    var quakes = new OpenLayers.Layer.WMS( "Earthquakes", 
                        "http://127.0.0.1:80/cgi-bin/mapserv.exe?", 
                        { map: '../htdocs/mpanagou/Quakes2.map', 
                          layers: 'Quakes', 'format':'png'},
                          {transparent:true, isBaseLayer:false,
reproject:false});
				
		    map.addLayers([satellite, hybrid, dtm, quakes]);
    
 			map.setCenter(new OpenLayers.LonLat(centerM.lon, centerM.lat), zoom);
            
        }
-- 
View this message in context: http://www.nabble.com/Can%27t-display-WMS-using-Spherical-Mercator-tp14550588p14550588.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list