Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've installed qgis server and it works fine. I've put qgs file in the server folder dir and using "Add WMS layer" from QGIS I manage to view the qgs file.

This is how I use get capabilities for example :

Now my problem is that in all Openlayers WMS examples , adding wms layer looks like this :

 layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
          {layers: 'basic'}

How do I convert my WMS to this format ? Where in the url I set the project name and where the layer name ?


share|improve this question

I've posted a solution that works for me on Adjusted to your information, it would be something like:

wms = new OpenLayers.Layer.WMS(
'london_basic', "",
    layers: 'basic', 
    format: 'image/png',
    map: 'D:/OSGeo4W/apps/qgis/bin/MyLondon.qgs',
    buffer: 1, 
    isBaseLayer: true, 
    graphicZIndex: 0, 
share|improve this answer
Thank you , is there a way to configure my qgis server to be more URL friendly like the example I've posted ? – Alophind Jan 27 '13 at 17:31
Anita , in your Vienna example u didn't write use map name , how come ? – Alophind Jan 27 '13 at 17:34
I had only one project in the same folder, so it automatically used that one. Sorry, but what do you mean by URL friendly? – underdark Jan 27 '13 at 20:50
I meant be able to use url instead of the entire QGIS settings – Alophind Jan 28 '13 at 8:17
Btw , this still doesnt work for me. I see white rectangle while QGIS does show me the 3 layers inside my project (from the WMS) – Alophind Jan 28 '13 at 8:51

Your Answer


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.