[OpenLayers-Users] wms+wfs+google with overlay+kml

cwest cwesta at hotmail.com
Wed Dec 24 00:27:35 EST 2008


hi all,
 i 've got a problem with nested layer,i set google as baselayer, 
 wms,wfs,and kml as overlayers.I can show individual of them,but i
 cant nested them all,maybe some difference of projection ,
 Is there anyway that I can nested them.

follow is my code:
////////////////////////////////////
 var map;

        function init(){
		OpenLayers.IMAGE_RELOAD_ATTEMPTS = 3;
	    OpenLayers.Util.onImageLoadErrorColor = "transparent";

		var bounds = new OpenLayers.Bounds(
                  243000,466000,257000,482000//242300, 465200,257700,
482800//
                );
                var options = { 
        projection: new OpenLayers.Projection("EPSG:900913"), 
        displayProjection: new OpenLayers.Projection("EPSG:4326"), 
        units: "m", 
        maxResolution: 156543.0339, 
        maxExtent: bounds
		}; 

         map = new OpenLayers.Map('map',options); //      nothing display
when i add options
	 //map = new OpenLayers.Map('map');//           i can nested them except
wfs when no options
            
	var googlehybrid = new OpenLayers.Layer.Google( "Google Hybrid" ,
{type:G_HYBRID_MAP,isBaseLayer: true});



	wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
                    "http://192.168.0.105:8081/geoserver/wms", {layers:
'topp:SW_PIPE',maxExtent: bounds,maxResolution: '68.75',projection:
"EPSG:28992",units: 'm',tiled: 'true',transparent: true}
					//{reproject: true,opacity: 0.8,isBaseLayer: false} 
	);
	//layer1.transparent=true;
	wms.isBaseLayer=false;


	var wfs = new OpenLayers.Layer.WFS( "WFS",
"http://192.168.0.105:8081/geoserver/wfs",
         {typename: 'topp:RD_ROAD_OBJECT'},
         {
                    typename: 'topp:RD_ROAD_OBJECT',
                    featureNS: 'http://www.openplans.org/topp',
                    extractAttributes: false,
                    visibility:false
	  },{ featureClass: OpenLayers.Feature.WFS});

	kml=new OpenLayers.Layer.GML("KML0",
"http://192.168.0.125:8080/geoserver/www/sw4.kml", 
        {
                format: OpenLayers.Format.KML, 
               formatOptions: {
                  extractStyles: true, 
                  extractAttributes: false
             }
        });
  

            map.addLayers([googlehybrid,wms,wfs,kml]);

            map.setCenter(new
OpenLayers.LonLat(6.785026240707595,52.27358741413968), 13);

            map.addControl( new OpenLayers.Control.LayerSwitcher() );
        }
///////////////////////////////////////////////////////

Thanks in advance

 cwest
-- 
View this message in context: http://www.nabble.com/wms%2Bwfs%2Bgoogle-with-overlay%2Bkml-tp21154863p21154863.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list