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'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 : http://www.localhost.com/qgis/qgis_mapserv.fcgi.exe?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities&map=D:/OSGeo4W/apps/qgis/bin/MyLondon.qgs

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

2 Answers 2

I've posted a solution that works for me on http://underdark.wordpress.com/2012/03/30/qgis-server-on-ubuntu-step-by-step/. Adjusted to your information, it would be something like:

wms = new OpenLayers.Layer.WMS(
'london_basic', "http://www.localhost.com/qgis/qgis_mapserv.fcgi.exi",
    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 vmap0.tiles.osgeo.org/wms/vmap0 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

Is the same for me, I stil have nothing in OpenLayers, but its works in QGIS. Do you solve this problem?


share|improve this answer
Welcome to GIS.StackExchange! Just for future reference, you should probably put this in a comment rather than an answer. Its just the way StackExchange works. Thanks! –  Rob Quincey Apr 17 '13 at 9:00
This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post. –  BradHards Apr 17 '13 at 9:32
This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. You can also add a bounty to draw more attention to this question once you have enough reputation. –  Curlew Apr 17 '13 at 9:56

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.