I am coming from the ESRI side and learning GeoServer/OpenLayers. It seems the only way to overlay one layer on Bing or the like is to use WFS. In my opinion, WFS transfers a lot of data to the client side and the client has to render it. It's not that efficient when all I need is to have one layer on the top of the base map. allOverlays=true is too extreme for my case.
Is there a way to overlay it as WMS? Similar to that in ArcGIS Server.
Thanks
Here is my code to try to overlay wms on Bing. The wms layer is not displaying. What's wrong?
var map;
function init(){
var restrictedExtent = new OpenLayers.Bounds(-180, -90,
180, 90);
map = new OpenLayers.Map("map");
//map.allOverlays = true;
map.addControl(new OpenLayers.Control.LayerSwitcher());
var shaded = new OpenLayers.Layer.VirtualEarth("Shaded", {
type: VEMapStyle.Shaded
});
var hybrid = new OpenLayers.Layer.VirtualEarth("Hybrid", {
type: VEMapStyle.Hybrid
});
var aerial = new OpenLayers.Layer.VirtualEarth("Aerial", {
type: VEMapStyle.Aerial
});
var states = new OpenLayers.Layer.WMS(
"States", "http://localhost:8080/geoserver/wms",
{
layers: 'state',
styles: '',
format: 'image/png',
transparent: true
}, {
opacity: 0.5,
singleTile: false,
ratio: 1,
isBaseLayer: true
}
);
map.addLayers([aerial, hybrid, shaded, states]);
map.setCenter(new OpenLayers.LonLat(-110, 45), 3);
}