Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm trying to setup a map with WMS and WFS Layers by using Geoserver. However, when I'm combining WFS and WMS (with some Google basemaps) together in one map I got following error in Firebug: TypeError: this.resolutions is undefined which is located in the http://openlayers.org/dev/OpenLayers.js JS-file Then I can see the WFS layer but not the WMS layer, furthermore also navigating in the map becomes very difficult...

The WFS Layer look like this:

       var tracks = new OpenLayers.Layer.Vector("Tracks", {
    strategies: [new OpenLayers.Strategy.BBOX()],
    styleMap: style,
    protocol: new OpenLayers.Protocol.WFS({
        version: "1.1.0",
        url: "http://localhost:8080/geoserver/wfs",
        featureNS: "http://shapes.net/shapes",
        featureType: "tracks",
        geometryName: "the_geom",
    })
});

Well, thise works quite good but as soon as I'm adding also a WMS Layer into the map i got the Error

var corine =  new OpenLayers.Layer.WMS( "OpenLayers WMS",
                "http://vmap0.tiles.osgeo.org/wms/vmap0",
                {layers: 'basic'} );

It doesn't matter if I take a WMS from my Geoserver or from an other external source (like in the code here), I always got the error when I'm activating this layer.

Btw. if the layers are not combined the works fine...

My assumption is that there could be a problem with the projection. Both layers are defined in Geoserver with EPSG:4326.

In the init.js I'm using this projects here:

projection: new OpenLayers.Projection("EPSG:4326"),
displayProjection: new OpenLayers.Projection("EPSG:900913"),

Any ideas?

share|improve this question
add comment

1 Answer

For a wms layer, you have to specify available resolutions, i.e. zoom levels. Add this to your options object for the wms layer:

resolutions: [1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125]

Note, this only covers a few zoom levels, you should google for the full resolutions array which contains 18 standard zoom levels/resolutions, or more if neccessary

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.