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",
         "http://vmap0.tiles.osgeo.org/wms/vmap0",
          {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 ?

Thx.

share|improve this question

1 Answer 1

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

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.