Take the 2-minute tour ×

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.


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);
share|improve this question
should work out of the box - what is your issue? –  iant May 25 '12 at 14:54
which is working out of box? Overlaying WMS or overlaying WFS. I know the latter is working. –  freddell May 25 '12 at 17:08
Overlaying WMS is the usual way to use it - what doesn't work for you? –  iant May 25 '12 at 17:40
isBaseLayer: true - may be the problem? –  iant May 25 '12 at 17:41
Yeah. That was the problem. Thanks Iant. –  freddell May 25 '12 at 18:08

Your Answer



Browse other questions tagged or ask your own question.