[OpenLayers-Users] Removing Google Maps as a layer, appreciate advice

BMcBride bmcbride at chacompanies.com
Fri Aug 6 10:35:22 EDT 2010


Try this:


var map,wms;
function init(){
map = new OpenLayers.Map( 'map' );
wms = new OpenLayers.Layer.WMS("Redgis - Layers",
"http://ITS701X5J1/RedWMS/Request.aspx",
{
layers: ['Hydro, Major_Parks'],
format: 'image/png',
VERSION: "1.1.1",
transparent: true
},
{ isBaseLayer: true
, singleTile: true
}
);
wms.setOpacity(0.5);
map.addLayers([wms]);
var startupLat = 52.27210;
var startupLon = -113.80288;
var startupLevel = 10;
var lonLat = new OpenLayers.LonLat(startupLon, startupLat);
map.setCenter(lonLat, startupLevel);
map.addControl( new OpenLayers.Control.LayerSwitcher() );
}


Once you remove the gmap layer, you have to set the wms to be a baselayer.
Every OL map must have at least one baselayer.

-----
Bryan R. McBride, GISP
http://www.bryanmcbride.com bryanmcbride.com 
http://geoserving.net/ geoserving.net 
-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Removing-Google-Maps-as-a-layer-appreciate-advice-tp5372989p5380783.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list